-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mediaqueries-5] redundant media feature #5359
Comments
Effectively, we have solved "issue 6" from the spec by introducing prefers-contrast and prefers-color-scheme without noticing we did.
Now that we have, we can retire light-level. |
BTW, If we go that way, #1727 can be closed. |
The CSS
|
That lack of precision is intentional and a feature of the MQ, and has been discussed with the Device Sensor people in the past. MQs aren't generally usable for responding to fine gradations. |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: redundancy<fantasai> github: https://github.com//issues/5359 <fantasai> florian: Talked about contrast a lot already, fact that we have prefers-contrast is established <fantasai> florian: and forced-colors is established as well <fantasai> florian: and also have prefers-color-scheme to pick between light and dark <fantasai> florian: so this has settled down a lot compared to earlier <fantasai> florian: what we did have early on was a light-level feature with 'washed | dim | normal' <fantasai> florian: to help with LCD screen outdoors or dark room, allow switching color scheme and/or contrast to improve readability <fantasai> florian: outdoors on e-ink doesn't end up washed, for example <fantasai> florian: that as intent of MQ <astearns> ack florian <fantasai> florian: But I think we don't need this anymore <fantasai> florian: UA could respond to this via existing prefers-contrast / prefers-color-scheme <jensimmons> present- <fantasai> florian: so I don't think we need this thing anymore <astearns> ack chris <fantasai> chris: I'm of two minds for this. <fantasai> chris: On one hand, that's not the only uses of this feautre <fantasai> chris: but there's a light levels API that gives you info on lux /etc. <fantasai> chris: which allows adjusting the overall system gamma <fantasai> chris: so I think this is not useful, and we should let those use cases be solved by the API <fantasai> TabAtkins: MQ in general aren't useful for fine gradation, they're broad categories <fantasai> TabAtkins: that said, in agreement with Florian <fantasai> TabAtkins: if we specify that UA should provide ability to map light levels to contrast levels <fantasai> TabAtkins: happy to assume that <fantasai> florian: I would like to remove this MQ and add some notes to other MQ "don't forget, you can respond to these environmental situations using this MQ" <fantasai> RESOLVED: remove light-level |
This change completely drops the "light-level" Media Queries at-rule from BCD. It was never implemented in any browser engines, and has now been removed from the Media Queries spec: * https://drafts.csswg.org/mediaqueries-5/#changes-since-2020-07-15 > Remove the "light-level" media feature as it is redundant > with "prefers-contrast" and "prefers-color-scheme"; add examples of how these > media features may be automatically inferred by the user agent based > on the same factors "light-level" was expected to respond to. * w3c/csswg-drafts@f5b663c * w3c/csswg-drafts#5359 I also filed mdn/sprints#3695 to delete the https://developer.mozilla.org/en-US/docs/Web/CSS/@media/light-level MDN article.
This change completely drops the "light-level" Media Queries at-rule from BCD. It was never implemented in any browser engines, and has now been removed from the Media Queries spec: * https://drafts.csswg.org/mediaqueries-5/#changes-since-2020-07-15 > Remove the "light-level" media feature as it is redundant > with "prefers-contrast" and "prefers-color-scheme"; add examples of how these > media features may be automatically inferred by the user agent based > on the same factors "light-level" was expected to respond to. * w3c/csswg-drafts@f5b663c * w3c/csswg-drafts#5359 I also filed mdn/sprints#3695 to delete the https://developer.mozilla.org/en-US/docs/Web/CSS/@media/light-level MDN article.
Given that we now have
prefers-contrast: high | low
andprefers-color-scheme: light | dark
, do we still needlight-level
?It seems to me that user agents could react to the situations described by
light-level: washed
andlight-level: dim
by setting an appropriate combination of values throughprefers-contrast
andprefers-color-scheme
(possibly giving the user a choice as to how they want the mapping to work).In that case, we wouldn't really need the
light-level
at all, would we?In fact, macOS does something that isn't quite that, but goes in that direction: in addition to its light and dark modes, it has an auto mode that picks between light or dark depending on the time of the day. Maybe instead of the
light-level
feature, we could add a Note indicating that UAs are may (should?) infer preferences likeprefers-contrast
orprefers-color-scheme
based on environmental factors, such as light levels, time of the day, etc.The text was updated successfully, but these errors were encountered: