Skip to content

Instantly share code, notes, and snippets.

@jab
Last active July 11, 2021 15:55
Show Gist options
  • Save jab/c7345030f0f664ddaf229d0baeb53bf4 to your computer and use it in GitHub Desktop.
Save jab/c7345030f0f664ddaf229d0baeb53bf4 to your computer and use it in GitHub Desktop.
dark-mode-aware-svg-demo
Display the source blob
Display the rendered blob
Raw
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 10" style="background: red">
<style>
path { fill: #333; }
@media (prefers-color-scheme: dark) {
path { fill: #aaa; }
}
</style>
<path d="M7.944 4.792a.416.416 0 0 1 0 .416.392.392 0 0 1-.15.15l-5.83 3.527a.374.374 0 0 1-.201.058.405.405 0 0 1-.205-.055.386.386 0 0 1-.15-.153.428.428 0 0 1-.053-.208V1.473a.428.428 0 0 1 .053-.208.386.386 0 0 1 .15-.153.41.41 0 0 1 .407-.003l5.83 3.528a.438.438 0 0 1 .15.155z"/>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment