- From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
- Date: Wed, 13 Apr 2022 15:43:09 +0000
- To: public-css-archive@w3.org
emilio has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-mediaqueries] Should prefers-color-scheme in SVG images be context-dependent? ==
Consider this test-case:
```html
<!doctype html>
<div style="color-scheme: light">
<img>
</div>
<div style="color-scheme: dark">
<img>
</div>
<script>
for (let img of document.querySelectorAll("img")) {
img.src = "data:image/svg+xml;base64," + btoa(`
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<style>
:root { color: blue }
@media (prefers-color-scheme: dark) {
:root { color: purple }
}
</style>
<rect fill="currentColor" width="32" height="32"/>
</svg>
`);
}
</script>
```
Right now the rendering of those images match in all browsers, but one could argue that perhaps they should render differently (top blue, bottom purple)?
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1764354, which is what prompted this discussion.
cc @lilles @smfr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7213 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 13 April 2022 15:43:12 UTC