• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

105
Vistas
nav[role="navigation"].dark is not working?

I have created a JS function for toggle of dark theme and light theme everything is working but this nav one is not working

nav[role="navigation"].dark{
    background-color: #2a2a2a;
}

And my Javascript

document.getElementById("dark").addEventListener('click', () => {
    document.body.classList.toggle('dark')
    localStorage.setItem(
      'theme',
      document.body.classList.contains('dark') ? 'dark' : 'light'
    )
  })
9 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If the dark class is apply to the body your selector probably sould be .dark nav[role="navigation"] and not nav[role="navigation"].dark

.dark nav[role="navigation"] {
    background-color: #2a2a2a;
}
9 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.