how to color svg image in css

87

<svg>
    <use href="logo.svg" style="--color_fill: #000;"></use>
</svg>
/*
	You have to apply a filter, this works for any kink of image
    Play with hue-rotate and saturate to find the color you want
*/
#svg{
    filter: invert(100%) sepia(100%) saturate(1000%) hue-rotate(280deg);
 }
.logo {
  background-color: red;
  -webkit-mask: url(logo.svg) no-repeat center;
  mask: url(logo.svg) no-repeat center;
}

Comments

Submit
0 Comments