Last active
August 29, 2015 14:17
-
-
Save htmlzengarden/4d029a2ae2f724c95505 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 increase-specificity($selector, $specificity: 2) { | |
@if $specificity > 1 { | |
@include increase-specificity($selector, $specificity - 1) { | |
&#{$selector} { | |
@content; | |
} | |
} | |
} | |
@else { | |
#{$selector} { | |
@content; | |
} | |
} | |
} | |
@include increase-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