Light Dark
Web/CSS
Most modern operating systems let us control the preferred color theme. Luckily for us web developers, you can simply adjust the look of our sites by using the light-dark()
function.
This function allows you to define two colors for a property, in which your browser automatically show the appropriate value based on your preferences.
To enable support for the light-dark()
color function, the color-scheme
must have a value of light dark
, usually set on the :root
pseudo-class.
Ref: light-dark()