Created
April 23, 2015 15:23
-
-
Save onebytegone/e24de8a96e9f13711e42 to your computer and use it in GitHub Desktop.
SCSS to control state colors
This file contains 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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin stateColor($normal, $hover:"") { | |
background-color: $normal; | |
@if $hover != '' { | |
&:hover { | |
background-color: $hover; | |
} | |
} | |
} | |
.hover { | |
@include stateColor(#fff, #000); | |
} | |
.normal { | |
@include stateColor(#fff); | |
} |
This file contains 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
.hover { | |
background-color: #fff; | |
} | |
.hover:hover { | |
background-color: #000; | |
} | |
.normal { | |
background-color: #fff; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment