Last active
December 21, 2023 13:36
-
-
Save BluePraise/0a3d9ce3462147637627bb12e47a3e59 to your computer and use it in GitHub Desktop.
Change color of image or SVG in <img>
This file contains 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
/* | |
If you'd like to change an image or SVG to black set this styling on the <img> | |
This does not work on background-image. | |
example html | |
<figure><img src="icon.svg" /></figure> | |
*/ | |
figure img { | |
filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment