- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 21 Aug 2024 16:35:09 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[mediaqueries] Effect of <meta name=color-scheme> on the (prefers-color-scheme) MQ`. <details><summary>The full IRC log of that discussion</summary> <matthieud> TabAtkins: Dark mode and spec is weird : when the meta makes the page dark, it is not reflected in the value of the media query<br> <matthieud> TabAtkins: proposition we allow the meta name color-scheme to define the value of the prefers-color-scheme MQ<br> <matthieud> TabAtkins: Uniflow imformation from page to the CSS ; it' s similar to how the viewport meta affect the size MQ on the page<br> <emilio> q+<br> <astearns> ack emilio<br> <matthieud> emilio: It makes sense. If someone does the opposite (set the meta from the value of the MQ?) no reason to do that though<br> <joshtumath> q+<br> <matthieud> TabAtkins: no reason to do that (set meta from MQ)<br> <astearns> ack joshtumath<br> <matthieud> joshtumath: How this work with color-scheme property ?<br> <matthieud> TabAtkins: It still has no effect of the result of the prefer-color-scheme MQ<br> <astearns> ack fantasai<br> <matthieud> fantasai: Currently the color-scheme meta is just setting the color-scheme property. But now it would have a new behavior (affecting the MQ)<br> <matthieud> TabAtkins: it makes more sense than having MQ giving the result of the OS<br> <emilio> q+<br> <matthieud> fantasai: But setting color-scheme property on the root doesnt affect the MQ<br> <matthieud> TabAtkins: Nobody expecty properties to affect MQ, but it' s more reasonable for the HTML (like meta) to affect the MQ<br> <astearns> ack emilio<br> <fantasai> TabAtkins: If I set color-schemen, I get dark controls, but prefers-color-scheme doesn't reflect, so that's confusing<br> <matthieud> emilio: Do we have data on the usage of this ?<br> <joshtumath> q+<br> <fantasai> fantasai: But if you set color-scheme property on the root, you also get dark controls, and prefers-color-scheme doesn't reflect there either<br> <matthieud> TabAtkins: anecdotal I got bit by this behavior already<br> <miriam> q+<br> <astearns> ack joshtumath<br> <ntim> q+<br> <matthieud> joshtumath: As author, I'm often confuse between using the meta tag vs the css property<br> <emilio> q+<br> <matthieud> joshtumath: Are they equivalent ? Now they would not be equivalent anymore<br> <matthieud> joshtumath: And also weird when using the property on the root<br> <matthieud> TabAtkins: they are the same right now<br> <matthieud> emilio: Not really, the meta change the value of "normal"<br> <astearns> ack miriam<br> <emilio> ack emilio<br> <matthieud> miriam: We've discussed similar stuff with the Preferences API (changing the result of MQ)<br> <matthieud> miriam: As author, I'm sometimes interested to know what the user (the OS) setting is even if I overwrite with the property<br> <fantasai> +1 miriam<br> <joshtumath> q+<br> <matthieud> miriam: I would like to be able to query the normal setting on the page (so no overwrite of the MQ) ; but I'm also interested into overwriting it<br> <matthieud> emilio: You can already modify the preferences (with iframe or svg?)<br> <fantasai> [prefers-color-scheme on embedded content takes the value from the embedding element's color-scheme]<br> <matthieud> TabAtkins: Assuming you are on a page with has set the meta to dark. What is the goal of knowing the original user value ?<br> <matthieud> s/with/which<br> <matthieud> miriam: Not sure, interesting to know if my author default is different from the user default. Like for example providing a toggle if they don't match<br> <matthieud> TabAtkins: That would use javascript<br> <matthieud> miriam: yes but it would be more robust with html<br> <matthieud> TabAtkins: But it doesn't work today. If meta is dark, and you use the MQ to set style, you will have inconsistent result<br> <astearns> ack ntim<br> <kizu> q+<br> <astearns> zakim, close queue<br> <Zakim> ok, astearns, the speaker queue is closed<br> <matthieud> ntim: meta tag values are the same as the property, but MQ only supports a subset of them<br> <astearns> ack joshtumath<br> <matthieud> TabAtkins: The proposal is that the prefers MQ takes into account the meta tag ; so it just match only the used value of the color-scheme property (so no issue)<br> <matthieud> joshtumath: Maybe we need a new MQ<br> <matthieud> TabAtkins: If we introduce a new MQ which take into account the meta, there would not be any use for the original one which only reflect the OS value<br> <ntim> q+<br> <matthieud> TabAtkins: it could be a JS API if we really want to have the default value without the meta<br> <astearns> ack kizu<br> <miriam> curious if that's true...<br> <matthieud> kizu: +1 for this as a style query<br> <matthieud> TabAtkins: style quuery is nice to do non color styling, but it is useful for the MQ to differ from the style query ?<br> <matthieud> TabAtkins: do we want both mechanism ?<br> <matthieud> astearns: in your solution the MQ and the style query would differ when you set value on the root<br> <matthieud> TabAtkins: Yes<br> <TabAtkins> <meta name=color-scheme content=dark>, then `color-scheme: light dark`<br> <matthieud> kizu: if html meta dark with only 1 value, but author css color-scheme root both light and dark. What do we do ? Author might want to override this<br> <matthieud> TabAtkins: preference for this should affect how the color-scheme property resolves<br> <astearns> ack fantasai<br> <Zakim> fantasai, you wanted to back up suggestion of style query being more appropriate here<br> <matthieud> fantasai: the style query makes more sense<br> <matthieud> fantasai: we want to used value and not the computed value here<br> <matthieud> fantasai: if you change the color-scheme in the middle of the page, but other part you want the user preference "normal", Tab solution doesnt work<br> <matthieud> fantasai: Only works with a style query<br> <matthieud> fantasai: It would avoid the confusion between color-scheme meta and color-scheme MQ<br> <matthieud> fantasai: And you can do a container query on the root to get the value of the meta tag<br> <emilio> +1 to TabAtkins, not sure they need to be exclusive<br> <matthieud> TabAtkins: Elika solution is nice, let's go back to the issue<br> <fantasai> It would need to be a color-scheme() function<br> <matthieud> TabAtkins: my solution is still valid<br> <fantasai> since the computed value wouldn't work for this purpose<br> <fantasai> we need the used color-scheme<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-2302515655 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 21 August 2024 16:35:10 UTC