Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-color-6] css-color unspecified target contrast ratios with contrast-color() should use the users preference #10029

Open
argyleink opened this issue Mar 4, 2024 · 2 comments
Assignees

Comments

@argyleink
Copy link
Contributor

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 the contrast-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.

@LeaVerou
Copy link
Member

LeaVerou commented Mar 5, 2024

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.

@argyleink
Copy link
Contributor Author

confirm, this is beyond the MVP, it's for when a color list is provided or the potential feature of automatic color discovery

@LeaVerou LeaVerou changed the title css-color unspecified target contrast ratios with contrast-color() should use the users preference [css-color-6] css-color unspecified target contrast ratios with contrast-color() should use the users preference Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants