Last active
November 16, 2015 08:45
-
-
Save artlesshand/002bb45ce58c55d2f199 to your computer and use it in GitHub Desktop.
Generating buttons with Sass and a color list
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
$color-list: ( | |
"white" : #FFF, | |
"black" : #000, | |
"red" : #BF6060, | |
"blue" : #159BC7, | |
"green" : #659826, | |
"sariinac" : #00979D, | |
"varchin" : #B0419E, | |
"darkvarchin" : #A7529D, | |
"vine" : #AD1336, | |
"cyan" : #04AEB2, | |
"silver" : #6C7A89 | |
); | |
.button { | |
@each $name, $value in $color-list { | |
&.#{$name} { | |
color: $value; | |
border-color: $value; | |
&:hover, | |
&.selected { | |
color: $white; | |
background-color: $value; | |
} | |
&.inverted { | |
color: $white; | |
background-color: $value; | |
&:hover { | |
color: $white; | |
border-color: $white; | |
background-color: transparent; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment