Last active
August 29, 2015 14:17
-
-
Save Aupajo/f998208c99b07534262b to your computer and use it in GitHub Desktop.
Sass maps
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
@import "palette"; | |
body { | |
font: 20pt "Helvetica Neue", sans-serif; | |
} | |
$actions: ( | |
primary: ( | |
link: $blue, | |
hover: lighten($blue, 0.1), | |
active: darken($blue, 0.2) | |
), | |
secondary: ( | |
link: $light-blue, | |
hover: lighten($light-blue, 0.2), | |
active: darken($light-blue, 0.2) | |
), | |
destructive: ( | |
link: $red, | |
hover: lighten($red, 0.05), | |
active: darken($red, 0.1) | |
) | |
); | |
@each $action, $states in $actions { | |
.#{$action}-button { | |
background: map_get($states, link); | |
border: none; | |
border-radius: 0.4em; | |
padding: 1em 2em; | |
display: inline-block; | |
font-size: 1em; | |
text-decoration: none; | |
color: white; | |
@each $state, $colour in $states { | |
&:#{$state} { background: $colour; } | |
} | |
} | |
} |
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
<button class="primary-button">Primary</button> | |
<a href=".." class="secondary-button">Secondary</a> | |
<button class="destructive-button">Delete</button> |
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
// Colours | |
$blue: rgb(0, 119, 255); | |
$light-blue: rgb(47, 163, 200); | |
$red: #cc0000; | |
// Derived colours | |
$brand-colour: $blue; | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment