Implement the prefers-contrast media-query.

NEW
Unassigned

Status

()

enhancement
P3
normal
6 months ago
3 days ago

People

(Reporter: bugzilla, Unassigned)

Tracking

(Blocks 2 bugs)

65 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 months ago
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

6 months 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!
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
Product: Firefox → Core
There's actually something resembling a spec for this: https://drafts.csswg.org/mediaqueries-5/#prefers-contrast
Priority: -- → P3
Summary: Enable interplay between macOS high contrast setting and CSS → Implement the prefers-contrast media-query.
See Also: → 1539212
You need to log in before you can comment on or make changes to this bug.