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

zoomed image ignores prefers-color-scheme in <source> #171

Open
ayushnix opened this issue Apr 9, 2021 · 0 comments
Open

zoomed image ignores prefers-color-scheme in <source> #171

ayushnix opened this issue Apr 9, 2021 · 0 comments

Comments

@ayushnix
Copy link

ayushnix commented Apr 9, 2021

Bug description

When using <picture> and <source> elements with the prefers-color-scheme media query, medium-zoom ignores them when image is zoomed in and it falls back to the <img> element inside <picture>.

How to reproduce

The following code results in medium zoom using the initial-commits-light.png when zoomed in regardless of the browser theme. Even if the dark version of the image is displayed, zooming in shows the light version.

<picture>
<source srcset="/initial-commits-light.png" media="(prefers-color-scheme: light)" data-zoomable="">
<source srcset="/initial-commits-dark.png" media="(prefers-color-scheme: dark)" data-zoomable="">
<img src="/wiki/images/initial-commits-light.png" data-zoomable="">
</picture>

Expected behavior

The zoomed image should be shown according to the browser theme.

Reproducible example

I'm not sure why but you might need to reload the embedded browser to make the image zoomable.

Link to the bug reproduction

Environment

  • Browser: Firefox 86 and Chromium 89
  • medium-zoom version: 1.0.6
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

2 participants