-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support for picture/source/@media queries #24
Comments
Oh, that sounds hard. 🤔 |
If anyone has an example website/snippet that would already help. |
|
Okay thanks, I briefly looked into this and I can only say it is more complicated. As I parse the AFAIK, the current behaviour is actually buggy. The So I've tried That said, even this does not fix the image/picture element, which is yet another issue… |
Hi, I have great news for you! According to my testing, the latest v2.0 release fixes this issue due to the way it now uses a completely new API to do "dark-mode-changing" "properly". For more information, please see the release notes. If the issue should not be fixed, please let me know. |
Background
The
prefers-color-scheme: dark
media query can appear not only in CSS, but also in thepicture/source/@media
attribute.Proposed solution
Parse all
picture/source
elements, substitutetrue
forprefers-color-scheme: dark
,false
forprefers-color-scheme: light
. Sincetrue
andfalse
aren't allowed syntactically, using something likemin-width: 0px
andmax-width: 0px
can be used in their place.Note that we don't want the switcher to resolve a single source so that the selection stays responsive.
The text was updated successfully, but these errors were encountered: