8000 [mediaqueries-5] prefers-contrast: infer contrast preference from forced colors · Issue #5224 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[mediaqueries-5] prefers-contrast: infer contrast preference from forced colors #5224

@0xekez

Description

@0xekez

As discussed in #2943 and #3856 at the moment there is limited OS level support for detecting when high or low contrast is preferred in the prefers-contrast media query. When colors are being forced, an additional way to detect these preferences might be to compare the contrast ratio of the forced background color and text color.

Threshold values could be taken from the Web Content Accessibility Guidelines. For example, a contrast ratio below 4.5:1 (the lowest allowed contrast for AA text) would toggle low for the media query and a contrast ratio at or above 7:1 (lowest for AAA text) would toggle high.

This would interpolate well with existing extensions and otherwise that try and make websites high/low contrast by forcing colors on webpages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0