• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

177
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'
    )
  })
almost 3 years 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;
}
almost 3 years 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 vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda