Skip to content

Instantly share code, notes, and snippets.

@artlesshand
Last active November 16, 2015 08:45
Show Gist options
  • Save artlesshand/002bb45ce58c55d2f199 to your computer and use it in GitHub Desktop.
Save artlesshand/002bb45ce58c55d2f199 to your computer and use it in GitHub Desktop.
Generating buttons with Sass and a color list
$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