Last active
August 29, 2015 14:25
-
-
Save inlikealion/b851e6d323b5a8c79141 to your computer and use it in GitHub Desktop.
Mixin for colorizing svg and giving states.
This file contains hidden or 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
// From: | |
// https://twitter.com/thisisroyal/status/624570142945579008 | |
// http://jsfiddle.net/thisisroyal/mokv8hc2/ | |
@mixin svgcolor($color: #000) { | |
[fill]:not([fill="none"]) { | |
fill: $color; | |
transition: fill 150ms ease-in-out; | |
} | |
[stroke]:not([stroke="none"]) { | |
stroke: $color; | |
transition: stroke 150ms ease-in-out; | |
} | |
} |
This file contains hidden or 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
svg { | |
@include svgcolor(#51ebca); | |
&:hover { | |
@include svgcolor(#2a7d6b); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment