[csswg-drafts] [mediaqueries] Effect of <meta name=color-scheme> on img and video sources (#13377)

JoshTumath has just created a new issue for https://github.com/w3c/csswg-drafts:

== [mediaqueries] Effect of <meta name=color-scheme> on img and video sources ==
@johannesodland has raised that, if the author sets `<meta name=color-scheme content=dark>`, although does set the document's _used color scheme_, it does not affect media queries in HTML `source` elements.

For example:

```html
<picture>
  <source srcset="dark-mode-image.png" media="(prefers-color-scheme: dark)" />
  <img alt="" src="light-mode-image.png">
</picture>
```

There are two questions:

1. How would the author ensure that the UA selects the active color scheme set by `<meta name=color-scheme>` rather than the user's actual preference?
2. How would the author ensure that the UA selects the _used color scheme_ (which can be changed for all descendents in the DOM tree using the `color-scheme` CSS property)?

I think we are more concerned with Question 1. Question 2 may be a larger issue to be resolved in the HTML spec?

### See also

IRC log of https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-3779908771 where the issue is briefly discussed

@romainmenke mentioned in https://github.com/w3c/csswg-drafts/issues/10249#issuecomment-3779922742

> Relevant issue on conditionally loading resources based on container queries: https://github.com/whatwg/html/issues/10182

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13377 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 21 January 2026 17:43:18 UTC