Skip to content

Instantly share code, notes, and snippets.

@davaynamore
Created December 4, 2019 12:45
Show Gist options
  • Save davaynamore/6a7e8bcab14076edd717ab956cc535aa to your computer and use it in GitHub Desktop.
Save davaynamore/6a7e8bcab14076edd717ab956cc535aa to your computer and use it in GitHub Desktop.
Changing color of background-image svg icon using svg-mask
@mixin icon-mask($url, $size) {
&::after {
content: "";
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: currentColor;
-webkit-mask: url($url);
mask: url($url);
-webkit-mask-size: $size;
-webkit-mask-repeat: no-repeat;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment