W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

Re: [csswg-drafts] [css-media-queries-5] add clarification on applied order for multiple preferences (#4895)

From: Thomas Gossmann via GitHub <sysbot+gh@w3.org>
Date: Thu, 26 Mar 2020 19:22:58 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-604634707-1585250576-sysbot+gh@w3.org>
> There's no hierarchy; they're independent preferences that can be queried separately or together, as the page author desires.


> > Can I define contrast and color scheme independently, so the cascade can do its job?
> Not really right now, because dealing with either preference involves assigning to the same properties (`color`, `background-color`, etc), and ideally you want to handle all combinations of those two preferences.

= hierarchy, because to handle all combinations I need to setup my queries that way, e.g. color-scheme and then contrast and results in those matrices of query (+ selectors)

> _That said_, Color 5 is working on a (still _very_ early stages, don't look to its details as particularly informative of a final design yet) [automatic contrast adjuster](https://drafts.csswg.org/css-color-5/#colorcontrast), where you can feed it two colors and a desired contrast ratio and it spits out one of the colors adjusted appropriately. This should, if we do it right, let you do a quick-and-dirty contrast adjuster automatically: set a `--contrast-ratio` property according to `(prefers-contrast)`, and set `--color-*` properties according to `(prefers-color-scheme)`, then actually write out your color properties by combining the two with `contrast-adjust()`. It's a bit of scaffolding, but it avoids needing to define a 3x2 (for now) set of colors for everything; instead you'd just define 2 sets of colors (light and dark) and let the function deal with contrast for you. The results won't be as good as hand-designing all the combinations, but it should be better than nothing, and you can still do hand-authoring when desired, either totally or piecemeal.

This seems like tackling the problem of spawning the matrices. Thanks for pointing out, will keep an eye on this one.

GitHub Notification of comment by gossi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4895#issuecomment-604634707 using your GitHub account
Received on Thursday, 26 March 2020 19:23:00 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC