Created
October 24, 2013 19:07
-
-
Save tommymarshall/7143137 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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="button--blue--large--rounded">I'm a button!</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
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
/* Multiple Modifier */ | |
@mixin mm($modifier) { | |
// Gets string length | |
$len: str-length(#{&}); | |
$parent: str-slice(#{&}, 2, $len); | |
@at-root [class^="#{$parent}"][class*="--#{$modifier}"] { | |
@extend .#{$parent}; | |
@content; | |
} | |
} | |
.button { | |
padding: 1em 2em; | |
@include mm(blue) { | |
background: #00f; | |
} | |
@include mm(large) { | |
font-size: 36px; | |
} | |
@include mm(rounded) { | |
border-radius: 10px; | |
} | |
} |
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
/* Multiple Modifier */ | |
.button, [class^="button"][class*="--blue"], [class^="button"][class*="--large"], [class^="button"][class*="--rounded"] { | |
padding: 1em 2em; | |
} | |
[class^="button"][class*="--blue"] { | |
background: #00f; | |
} | |
[class^="button"][class*="--large"] { | |
font-size: 36px; | |
} | |
[class^="button"][class*="--rounded"] { | |
border-radius: 10px; | |
} |
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="button--blue--large--rounded">I'm a button!</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment