I did find this on codepen, but it uses JS to calculate the filter value manually. I want to be able to do this using SASS so that I can build these more programmatically.
Below is an example of the end results, but it requires me to hard code. We are using gulpjs to compile our SASS files.
How would I be able to do what the codepen does, but with SASS?
.icon {
background-image: url('https://kwiksher.com/wp-content/uploads/2012/09/runningcat.png');
display: block;
}
.icon--single {
width: 50px;
height: 50px;
background-position: 25% 50%;
filter: invert(46%) sepia(36%) saturate(6980%) hue-rotate(159deg) brightness(94%) contrast(101%);
}
<div>
<h2>Hello there</h2>
<span class="icon icon--single">hi</span>
</div>