Open argyleink opened 7 months ago
Given that the MVP of contrast-color()
returns either white/black or colors very close to them, these are high contrast combinations anyway, so the user's contrast preference wouldn't change a thing.
confirm, this is beyond the MVP, it's for when a color list is provided or the potential feature of automatic color discovery
https://drafts.csswg.org/css-color-6/
The general goal of
contrast-color()
is to provide legible color pairings for users and make it "easy" for authors. In that ethos, I think the function could use the user's contrast preference when resolving a color. This would prevent code duplication if authors were expected to repeat thecontrast-color()
function within media queries, passing explicit target values within the queries. This issue/proposal wants to make the user's contrast preference easier to implement for authors, and also make the default function value the most dynamic and appropriate value for users.tldr; the default for authors would be to let the browser figure it out for each user, not a default of authors needing to know what scores match each user preference.
Quick user story:
A user prefers contrast
more
in their OS settings,contrast-color()
defaults to using this preference and resolves a value for them to a contrast target of AAA/7.