Created
January 16, 2016 10:14
-
-
Save teodragovic/5e69b791f100d73a2304 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
// ---- | |
// libsass (v3.3.2) | |
// ---- | |
// http://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/ | |
@mixin stronger($selector, $factor: 1) { | |
$total: $selector; | |
@if $factor > 0 { | |
@for $i from 1 through $factor { | |
$total: $total + $selector; | |
} | |
#{$total} { | |
@content | |
} | |
} else { | |
@warn "Invalid factor value"; | |
} | |
} | |
// DEMO | |
@include stronger('.class') { | |
test: test; | |
} | |
@include stronger('.class--one', 2) { | |
test: test; | |
} | |
@include stronger('.class--two', 5) { | |
test: test; | |
} | |
@include stronger('.class--three', -5) { | |
test: test; | |
} |
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
.class.class { | |
test: test; | |
} | |
.class--one.class--one.class--one { | |
test: test; | |
} | |
.class--two.class--two.class--two.class--two.class--two.class--two { | |
test: test; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment