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
(Depends on 1 open bug, 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•5 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•5 years ago
|
||
There's actually something resembling a spec for this: https://drafts.csswg.org/mediaqueries-5/#prefers-contrast
Updated•5 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years 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•3 years 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•3 years ago
|
||
Assignee | ||
Comment 8•3 years 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•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Comment 11•3 years 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
•