Created
August 18, 2016 15:54
-
-
Save tmlangley/ad1effa5a8a2b7a9eccc24f822e47f02 to your computer and use it in GitHub Desktop.
Config based button SASS styles
This file contains hidden or 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
$buttons: ( | |
_base: ( | |
background: $sky-dark, | |
color: #fff, | |
border: $sky-dark, | |
active-background: $sky-dark, | |
active-color: #fff, | |
active-overlay: rgba($sky-light, 0.65), | |
active-border: $sky-dark | |
), | |
blue: ( | |
extend: _base // extend key takes config from provided key and lets you override what's different. | |
), | |
white: ( | |
background: #fff, | |
color: $sky-dark, | |
border: $sky-dark, | |
active-background: #fff, | |
active-color: #bababa, | |
active-border: #bababa, | |
active-overlay: #f5f5f5 | |
), | |
white-no-border: ( | |
extend: white, | |
border: #fff, | |
active-border: #fff | |
) | |
); |
This file contains hidden or 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
// Create button classes | |
@each $key, $configuration in $buttons { | |
@if $key != '_base' { | |
.btn.#{$key}.small { | |
@include btn($key, small); | |
} | |
.btn.#{$key}.large { | |
@include btn($key, large); | |
} | |
} | |
} |
This file contains hidden or 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
// Use on random cta | |
.my-cta { | |
// other styles... | |
button { | |
@include btn(blue, small); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment