lmartins
11/22/2014 - 4:15 PM

Increase selector specificity

Increase selector specificity

// 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;
	}
}