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

precedence with <meta name="color-scheme" ...> #34

Closed
jasonwilliams opened this issue Jun 19, 2024 · 4 comments
Closed

precedence with <meta name="color-scheme" ...> #34

jasonwilliams opened this issue Jun 19, 2024 · 4 comments

Comments

@jasonwilliams
Copy link
Contributor

Should this specification discuss the precedence with the color-scheme meta tag?

I assume the preferences API will override the color scheme tag (as its user driven) but it isn't mentioned in the docs/spec. I don't know if this would require an update to the color-scheme meta tag section?

My assumptions for now is:
Web Prefs Override -> color-scheme meta tag -> OS default

@lukewarlow
Copy link
Collaborator

lukewarlow commented Jun 19, 2024

Off the top of my head I think it works with the meta tag rather than overriding. So you'd say you support both values and then the API can switch which value is chosen. Just like you today say you support both values and the browser picks the correct value based on the UA value (browser > OS).

@jasonwilliams
Copy link
Contributor Author

jasonwilliams commented Jun 19, 2024

Sure, that makes sense when you pass both dark light into the meta tag, but what happens when you only pass one?

<meta name="color-scheme" content="light only">
await navigator.preferences.colorScheme.requestOverride("dark")

refresh page

@lukewarlow
Copy link
Collaborator

Yeah the case with a single value is interesting, and the case with a single value and only is potentially even more interesting. Needs thinking about. I think in all cases the media query would update at least. But potentially the used colour scheme wouldn't?

Similar to #14

@lukewarlow
Copy link
Collaborator

Moved to w3c/csswg-drafts#11576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants