Created
January 29, 2016 10:58
-
-
Save souporserious/0d050e59df6e0731f862 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// libsass (v3.3.2) | |
// ---- | |
@mixin link($initial-state, $hover: $initial-state, $active: $initial-state, $focus: $initial-state, $visited: $initial-state) { | |
$states: ( | |
'hover': $hover, | |
'active': $active, | |
'focus': $focus, | |
'visited': $visited | |
); | |
$same-states: (); | |
@each $state, $color in $states { | |
@if ($initial-state != $color) { | |
&:#{$state} { | |
color: $color; | |
} | |
} @else { | |
$same-states: append($same-states, '&:#{$state}', 'comma'); | |
} | |
} | |
&, #{$same-states} { | |
color: $initial-state; | |
} | |
} | |
a { | |
@include link(red, green, blue) | |
} |
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
a:hover { | |
color: green; | |
} | |
a:active { | |
color: blue; | |
} | |
a, a:focus, a:visited { | |
color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment