Skip to content
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

Closed
frivoal opened this issue Jul 24, 2020 · 5 comments
Closed

[mediaqueries-5] redundant media feature #5359

frivoal opened this issue Jul 24, 2020 · 5 comments

Comments

@frivoal
Copy link
Collaborator

frivoal commented Jul 24, 2020

Given that we now have prefers-contrast: high | low and prefers-color-scheme: light | dark, do we still need light-level?

It seems to me that user agents could react to the situations described by light-level: washed and light-level: dim by setting an appropriate combination of values through prefers-contrast and prefers-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 like prefers-contrast or prefers-color-scheme based on environmental factors, such as light levels, time of the day, etc.

@frivoal frivoal self-assigned this Jul 24, 2020
@frivoal
Copy link
Collaborator Author

frivoal commented Jul 24, 2020

Effectively, we have solved "issue 6" from the spec by introducing prefers-contrast and prefers-color-scheme without noticing we did.

Using this media feature for accessibility purposes overlaps a lot with the high-contrast media feature proposed by Microsoft. Can we adjust this so that it covers all use cases for both, or somehow modify them to work in an orthogonal, rather than overlapping, fashion?

Now that we have, we can retire light-level.

@frivoal
Copy link
Collaborator Author

frivoal commented Jul 24, 2020

BTW, If we go that way, #1727 can be closed.

@svgeesus
Copy link
Contributor

The CSS light-level seems over-vague and generally not useful. Compared to the Ambient Device Sensor light-level which gives the background illuminance in lux and is thus directly actionable:

  • moving from device colorimetry to color appearance models
  • adjusting overall system gamma for video, to take into account lighter or darker than nominal background illuminance

@tabatkins
Copy link
Member

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.

@css-meeting-bot
Copy link
Member

css-meeting-bot commented Jul 30, 2020

The CSS Working Group just discussed redundancy, and agreed to the following:

  • RESOLVED: remove light-level
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

@frivoal frivoal added Closed Accepted by CSSWG Resolution Testing Unnecessary Memory aid - issue doesn't require tests labels Jul 31, 2020
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Sep 16, 2020
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.
ddbeck pushed a commit to mdn/browser-compat-data that referenced this issue Sep 17, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants