Summary: Allow authors to react to the used color-scheme like system colors do.

See the discussion in [1] for discussions about use cases and future extensions.

This is a rather simple feature that proves to be very useful to define color-scheme-dependent values, and specially useful if those values might be used in both light and dark contexts in the same page.

We've enabled it in the Firefox front-end for a while and it's getting some usage[2], allowing clean-ups and fixes like this[3].

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1856999
Specification: css-color-5, tentatively[4].
Platform coverage: all
Preference: layout.css.light-dark.enabled
DevTools bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1857006
Link to standards-positions discussion: None (should I file it?)

Other browsers: We'd be the first ones to ship the first implementing, but the feeling in the CSSWG was pretty positive every time this has come up, including both Blink and WebKit folks. In fact, Blink already has an -internal-light-dark() function with essentially the same functionality as we resolved on.

web-platform-tests: I'm adding WPTs as part of this work.

 -- Emilio

[1]: https://github.com/w3c/csswg-drafts/issues/7561
[2]: https://searchfox.org/mozilla-central/search?q=light-dark%28
[3]: https://phabricator.services.mozilla.com/D190070
[4]: https://github.com/w3c/csswg-drafts/pull/9439

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/d6402f39-80d6-42c1-9548-6cac29ab3ed6%40mozilla.com.

Reply via email to