Created
April 21, 2022 14:57
-
-
Save skipshean/c3f44d124904d8be5eada45574445c71 to your computer and use it in GitHub Desktop.
Dark Mode snippet for emails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Source: https://litmus.com/community/snippets/233-dark-mode-support --> | |
<!-- Put both of these sections in the <head> of your email. --> | |
<!-- Enable Dark Mode Support --> | |
<meta name="color-scheme" content="light dark"> | |
<meta name="supported-color-schemes" content="light dark only"> | |
<style type="text/css"> | |
:root { | |
color-scheme: light dark; | |
supported-color-schemes: light dark; | |
} | |
<!-- Use this media query to adapt styles for Dark Mode. --> | |
@media (prefers-color-scheme: dark) { | |
<!-- Target elements as usual within the media query. --> | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment