Created
October 29, 2014 07:44
-
-
Save seyedi/dd137f7b8c9015574d94 to your computer and use it in GitHub Desktop.
An example in oosass and using extend in sass
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
/* The best way */ | |
%button { | |
min-width: 100px; | |
padding: 1em; | |
border-radius: 1em; | |
} | |
%twitter-background { | |
color: #fff; | |
background: #55acee; | |
} | |
%facebook-background { | |
color: #fff; | |
background: #3b5998; | |
} | |
.btn { | |
&--twitter { | |
@extend %button; | |
@extend %twitter-background; | |
} | |
&--facebook { | |
@extend %button; | |
@extend %facebook-background; | |
} | |
} | |
// Usage | |
// <a href="#" class="btn--twitter">Twitter</a> | |
// <a href="#" class="btn--facebook">Facebook</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment