Created
December 4, 2019 12:45
-
-
Save davaynamore/6a7e8bcab14076edd717ab956cc535aa to your computer and use it in GitHub Desktop.
Changing color of background-image svg icon using svg-mask
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
@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