Home > other >  prefers-color-scheme default styles vs light
prefers-color-scheme default styles vs light

Time:04-18

Can i use:

@media (prefers-color-scheme: light) {
 color: pink;
}

@media (prefers-color-scheme: dark) {
 color: pink;
}

instead of:

color: pink;

@media (prefers-color-scheme: dark) {
 color: pink;
}

I know it's good to leave support for older browsers. But is light the default theme value in modern browsers?

CodePudding user response:

Yes, light color scheme is default on most devices and browsers. Also adding @media with light color scheme won't change anything since there are no other color schemes than light and dark.

  • Related