-1

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?

Lolo Ogly
  • 11
  • 5
  • See https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme for correct use of the media query and also this statement: light Indicates that user has notified that they prefer an interface that has a light theme, or has not expressed an active preference. – A Haworth Apr 17 '22 at 05:27

1 Answers1

0

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.

zielvna
  • 169
  • 5
  • Why won’t using a media query with light not change anything? https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme seems to give an example. – A Haworth Apr 17 '22 at 05:29
  • @AHaworth You can copy that example and apply light color scheme. Nothing will change. – zielvna Apr 17 '22 at 06:19