Last active
September 28, 2016 18:06
-
-
Save ariellephan/e87e7faf5b08a39014af55dcf99d84e2 to your computer and use it in GitHub Desktop.
SCSS best practice
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 { | |
// … button styles | |
+ %button { | |
margin-left: 1rem; | |
} | |
} | |
%modal { | |
// … modal styles | |
%button { | |
// … modal-specific button styles | |
} | |
} | |
// "Exported" classes | |
.button { @extend %button; } | |
.modal { @extend %modal; } | |
//Output | |
.button { /* … button styles */ } | |
.button + .button { margin-left: 1rem; } | |
.modal { /* … modal styles */ } | |
.modal .button { /* … modal-specific button styles */ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment