Created
March 13, 2015 19:34
-
-
Save justinryder/a2321f9411e7e03864d1 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.12) | |
// Compass (v1.0.3) | |
// ---- | |
// Can we increase specificity without typing the class name twice? | |
// e.g .foo.foo {} | |
.foo { | |
// Nope, we just get .foo {} | |
& { | |
color: red; | |
} | |
} | |
.foo { | |
// Not quite, we get .foo .foo {} | |
& & { | |
color: red; | |
} | |
} | |
.foo { | |
// && gives an error, so use interpolation | |
// 3 classes? We get .foo .foo.foo {} | |
#{&}#{&} { | |
color: red; | |
} | |
} | |
.foo { | |
// Back to 2 classes again. We get .foo .foo {} | |
#{&} { | |
color: red; | |
} | |
} | |
.foo { | |
// Success! Increased specificity to duplicate the class name w/o actually typing it twice! | |
// ...this is kinda ungly though. | |
&#{&} { | |
color: red; | |
} | |
} |
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
.foo { | |
color: red; | |
} | |
.foo .foo { | |
color: red; | |
} | |
.foo .foo.foo { | |
color: red; | |
} | |
.foo .foo { | |
color: red; | |
} | |
.foo.foo { | |
color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment