Skip to content

Instantly share code, notes, and snippets.

@souporserious
Last active January 29, 2016 05:00
Show Gist options
  • Save souporserious/af784c3898747c6c0a38 to your computer and use it in GitHub Desktop.
Save souporserious/af784c3898747c6c0a38 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
@mixin link($link, $hover: $link, $active: $link, $focus: $link, $visited: $link) {
$sameProps: ();
& {
@if $hover != $link {
&:hover {
color: $hover;
}
} @else {
$sameProps: append($sameProps, '&:hover', comma)
}
@if $active != $link {
&:active {
color: $active;
}
} @else {
$sameProps: append($sameProps, '&:active', comma)
}
@if $focus != $link {
&:focus {
color: $focus;
}
} @else {
$sameProps: append($sameProps, '&:focus', comma)
}
@if $visited != $link {
&:visited {
color: $visited;
}
} @else {
$sameProps: append($sameProps, '&:visited', comma)
}
&, #{$sameProps} {
color: $link;
}
}
}
a {
@include link(red, green, blue)
}
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