Forked from barneycarroll/increase-specificity.scss
Last active
August 29, 2015 14:10
-
-
Save lmartins/d2b1414abfb2bd469c9a to your computer and use it in GitHub Desktop.
Increase selector specificity
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
// Increase class-level specificity of a rule without functionaly modifying the selector | |
@mixin increase-specificity( $depth: 1 ) { | |
$sel : ''; | |
@while($depth > 0) { | |
$sel : $sel + ':nth-child(n)'; | |
$depth : $depth - 1; | |
} | |
&#{$sel} { | |
@content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment