Utilities for the light-dark()
CSS function
#12172
lukewarlow
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
this is interesting.... wonder how it's gonna get incorporated. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I was hoping to just use the function on my colors, but it only replaces the first For example
will be converted into:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A new CSS function for choosing colors based on the used colour scheme has been made https://drafts.csswg.org/css-color-5/#light-dark.
See https://www.bram.us/2023/10/09/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark/ for details.
Importantly this is NOT just a nicer way of doing
@media(prefers-color-scheme: dark)
because its based on used color scheme. So works hand in hand with the color-scheme CSS property See #11271 for PR to add that.Firefox Coming in 120
Chrome coming in 123
WebKit Bug: https://webkit.org/b/262914
Beta Was this translation helpful? Give feedback.
All reactions