Implement newly specced behaviour for prefers-color-scheme to be impacted by the page color-scheme
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: oliverwilliams345, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15
Steps to reproduce:
Currently, the color-scheme of the page impacts the prefers-color-scheme media query only in iframes and in SVG. The CSSWG has resolved that this behaviour should be changed to that the color-scheme impacts the media query in all contexts.
This change brings consistency between how the media query works, so is easier to understand for developers. Currently, for any website with an in-page dark mode toggle, the media query is unusable. This change makes the media query usable on websites that allow end-users to override the OS-level color scheme setting. The CSS light-dark() function can only be used to set colors, gradients and background-images. Having the full power of the media query to conditionally apply any CSS property is highly useful e.g to apply a shadow only in light mode, for example.
Comment 1•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Description
•