Skip to content

Instantly share code, notes, and snippets.

@BluePraise
Last active December 21, 2023 13:36
Show Gist options
  • Save BluePraise/0a3d9ce3462147637627bb12e47a3e59 to your computer and use it in GitHub Desktop.
Save BluePraise/0a3d9ce3462147637627bb12e47a3e59 to your computer and use it in GitHub Desktop.
Change color of image or SVG in <img>
/*
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