Created
September 2, 2016 17:07
-
-
Save tmlangley/9d8e73c6e1aade26f1a6b0ffa63edd89 to your computer and use it in GitHub Desktop.
Advanced config based SASS buttons
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
$debug: false; | |
$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