I want an alternative to font icons. So I decided to create SVG icons. I'm using Grunt and https://github.com/jkphl/grunt-iconizr. Everything works fine. There are my output SCSS files using Grunt Iconizr:
First
%icon {
background-repeat: no-repeat;
}
.icon-arrow-down {
@extend %icon;
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2223.90625%22%20viewBox%3D%220%200%20512%20510%22%20enable-background%3D%22new%200%200%20512%20512%22%3E%3Cpath%20d%3D%22M256%20275.311l151.114-150.395%2054.886%2055.148-206%20205.02-206-205.02%2054.887-55.148z%22%2F%3E%3C%2Fsvg%3E");
}
Second output file, an alternative to first file:
%icon {
background-repeat: no-repeat;
}
.icon-arrow-down {
background-position: 0 0;
@extend %icon;
background-image: url(icons/icons.svg);
}
I want to create hover effect on icons. Is there any way how can I do an hover effect using pure CSS solution? I know that I can do that using fill: #CCC;
property ... but only if have SVG in my HTML code. If I use font icons, it can be done easily by changing CSS color property. Is there any way hove can I change a color of SVG attached by background-image: url(...)
?