Skip to content

Instantly share code, notes, and snippets.

@dezinezync
Created September 20, 2019 11:56
Show Gist options
  • Save dezinezync/c9cd6edd3aacca02223c8610eb7374ff to your computer and use it in GitHub Desktop.
Save dezinezync/c9cd6edd3aacca02223c8610eb7374ff to your computer and use it in GitHub Desktop.
Dark Mode <picture>
<picture id="theme-default" class="active">
<source srcset="/images/1.4/image-dark-414.png, /images/1.4/image-dark@2x.png 2x" media="(max-width: 414px) and (prefers-color-scheme: dark)" />
<source srcset="/images/1.4/image-dark-768.png, /images/1.4/image-dark@2x.png 2x" media="(max-width: 768px) and (prefers-color-scheme: dark)" />
<source srcset="/images/1.4/image-dark@3x.png" media="(min-width: 769px) and (prefers-color-scheme: dark)" />
<source srcset="/images/1.4/image-414.png, /images/1.4/image@2x.png 2x" media="(max-width: 414px)" />
<source srcset="/images/1.4/image-768.png, /images/1.4/image@2x.png 2x" media="(max-width: 768px)" />
<source srcset="/images/1.4/image@3x.png" media="(min-width: 769px)" />
<img src="/images/1.4/image@2x.png" alt="Elytra's Primary Interfaces" width="1041" />
</picture>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment