Created
March 2, 2012 10:02
-
-
Save mahmoud/1957471 to your computer and use it in GitHub Desktop.
less css scoping 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
@test: 0; | |
.mixin() when (@test = 0) { background: blue !important; } | |
.mixin() when (@test = 1) { @test: 2; background: red !important; } | |
.mixin() when (@test = 2) { background: black !important; } | |
body { | |
@test: 1; | |
.mixin; | |
.mixin; | |
} | |
// body ends up being red meaning: | |
// a) scope of conditional mixins (guard expressions) is looked up from the calling point, not the declaration point (a good thing), and | |
// b) can't change nonlocal variables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment