Created
April 3, 2014 18:03
-
-
Save barneycarroll/9959522 to your computer and use it in GitHub Desktop.
Generic mixin to increase the specificity of the contents rules
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