Skip to content

Instantly share code, notes, and snippets.

@inlikealion
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inlikealion/b851e6d323b5a8c79141 to your computer and use it in GitHub Desktop.
Save inlikealion/b851e6d323b5a8c79141 to your computer and use it in GitHub Desktop.
Mixin for colorizing svg and giving states.
// 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;
}
}
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