Created
September 19, 2014 08:05
-
-
Save jnowland/12cea7cdba77b11dbd42 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
// ---- | |
// Sass (v3.4.4) | |
// Compass (v1.0.1) | |
// ---- | |
/* | |
Using silent class | |
*/ | |
%background { | |
background:red; | |
} | |
.Button { | |
@extend %background; | |
} | |
.Random { | |
@extend %background; | |
} | |
div { | |
.Button { | |
color:red; | |
} | |
} | |
/* VS */ | |
/* | |
Using a non silent class | |
*/ | |
.Button2 { | |
background:blue; | |
} | |
.Random2 { | |
@extend .Button2; | |
} | |
div { | |
.Button2 { | |
color:red; | |
} | |
} | |
/* Note that the css output on the last class is doubled.*/ | |
/* | |
Alternate solution | |
*/ | |
.Button3 { | |
background:yellow; | |
} | |
.Random3 { | |
@extend .Button3; | |
} | |
div { | |
[class*="Button3"] { | |
color:orange; | |
} | |
} |
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
/* | |
Using silent class | |
*/ | |
.Button, .Random { | |
background: red; | |
} | |
div .Button { | |
color: red; | |
} | |
/* VS */ | |
/* | |
Using a non silent class | |
*/ | |
.Button2, .Random2 { | |
background: blue; | |
} | |
div .Button2, div .Random2 { | |
color: red; | |
} | |
/* Note that the css output on the last class is doubled.*/ | |
/* | |
Alternate solution | |
*/ | |
.Button3, .Random3 { | |
background: yellow; | |
} | |
div [class*="Button3"] { | |
color: orange; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment