Created
March 31, 2015 19:24
-
-
Save htmlzengarden/7886e9a030db14417319 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
<h1><span class="foo">foo<span class="bar">bar</span></span></h1> |
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) | |
// ---- | |
@mixin incrase-specificity($selector, $specificity: 2) { | |
@if $specificity > 1 { | |
@include incrase-specificity($selector, $specificity - 1) { | |
&#{$selector} { | |
@content; | |
} | |
} | |
} | |
@else { | |
#{$selector} { | |
@content; | |
} | |
} | |
} | |
@include incrase-specificity('.foo') { | |
color: black; | |
.bar { | |
color: black; | |
} | |
} | |
.foo { | |
color: green; | |
.bar { | |
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.foo { | |
color: black; | |
} | |
.foo.foo .bar { | |
color: black; | |
} | |
.foo { | |
color: green; | |
} | |
.foo .bar { | |
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
<h1><span class="foo">foo<span class="bar">bar</span></span></h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment