Qué es Generador de funcion CSS light-dark()?
Generador de funcion CSS light-dark() es una herramienta de navegador para esta tarea: Genera reglas CSS color-scheme y light-dark() para modo oscuro. La salida es fácil de revisar antes de usarla en un sitio publicado.
Quick answer
The light-dark() CSS function returns one of two color values based on the current color scheme, making it easy to support light and dark modes without duplicating CSS rules.
Limitations
- light-dark() only works when the color-scheme property is set on the document or element. Without it the function defaults to the first color.
- The function accepts exactly two color values -- one for light and one for dark. Complex theme switching still requires custom properties or media queries.
- Older browsers do not support light-dark(). Provide a fallback color before the light-dark() function in the property declaration.
Cómo usar esta herramienta
- Abre la herramienta y escribe los valores necesarios.
- Revisa la salida en el panel de resultado.
- Copia solo la parte que encaja con tu página.
- Prueba el cambio antes de publicar.
Para qué puedes usarla
- Resolver tareas repetidas de publicación con menos fricción.
- Preparar marcado, CSS o checklists antes del lanzamiento.
- Evitar pequeños errores comunes en sitios estáticos.