Implement the prefers-contrast media-query
Categories
(Core :: CSS Parsing and Computation, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: bugzilla, Assigned: zekemedley)
References
(Blocks 2 open bugs, )
Details
(Keywords: dev-doc-needed, Whiteboard: [layout:backlog])
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 Steps to reproduce: If the user set high contrast to “checked” in macOS, we can assume he or she will need high contrast in web sites as well. If we can add the feature to CSS that we can detect high contrast mode using CSS, it would be great. @media (prefers-high-contrast: true) { /* CSS code */ } Implementation could be much like prefers-reduced-motion https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
|
||
Comment 1•
2 years ago
|
||
Hi Johan Ronsse, I will set this issue as an enhancement for now. Hopefully, the component is the right one, if not please feel free to add it to the right one. Thanks for the report!
|
||
Comment 2•
2 years ago
|
||
There's actually something resembling a spec for this: https://drafts.csswg.org/mediaqueries-5/#prefers-contrast
|
||
Updated•
1 year ago
|
|
||
Updated•
3 months ago
|
|
||
Updated•
3 months ago
|
|
Assignee | |
Comment 3•
2 months ago
|
||
|
Assignee | |
Comment 4•
2 months ago
|
||
|
||
Updated•
2 months ago
|
|
Assignee | |
Comment 5•
2 months ago
|
||
We've decided that we're not actually going to enable telemetry. The plan now is:
- Remove the telemetry
- Enable
prefers-contrast
by default in browser chrome for use with a high contrast theme. - Enable
prefers-contrast
behind preference on the web.
|
||
Comment 6•
2 months ago
|
||
Will this be covered by RFP? Much like prefers-reduced-motion (returns no-preference) in Bug 1479239 and prefers-color-scheme (returns light) in Bug 1494034
|
||
Comment 7•
2 months ago
|
||
|
Assignee | |
Comment 8•
2 months ago
|
||
(In reply to Simon Mainey from comment #6)
Will this be covered by RFP? Much like prefers-reduced-motion (returns no-preference) in Bug 1479239 and prefers-color-scheme (returns light) in Bug 1494034
Our current plan is to return no-preference
when RFP is enabled but still be honest about whether or not forced colors are in use. There is some discussion about this on phabricator here. This has to do with with the addition of a forced option to the media query recently.
Pushed by mreschenberg@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eea7e31fdade Implement the prefers-contrast media-query. r=morgan,emilio
|
||
Comment 10•
2 months ago
|
||
bugherder |
|
||
Updated•
2 months ago
|
|
||
Comment 11•
1 month ago
|
||
Adding the intent to prototype here https://groups.google.com/g/mozilla.dev.platform/c/bTEmQxffGvA
Not yet enabled by default. Behind layout.css.prefers-contrast.enabled
Description
•