Merge branch 'namespaces-guards-1418' of github.com:SomMeri/less-rhino.js into SomMeri-namespaces-guards-1418

This commit is contained in:
Luke Page
2014-09-06 02:09:51 +01:00
4 changed files with 115 additions and 30 deletions

View File

@@ -91,3 +91,11 @@
.mixin-generated-class {
a: 1;
}
#guarded-caller {
guarded: namespace;
silent: namespace;
guarded: with default;
}
#guarded-deeper {
should: match 1;
}

View File

@@ -171,3 +171,58 @@
}
#ns > .mixin-for-root-usage(1);
@namespaceGuard: 1;
#guarded when (@namespaceGuard>0) {
#deeper {
.mixin() {
guarded: namespace;
}
}
}
#guarded() when (@namespaceGuard>0) {
#deeper {
.mixin() {
silent: namespace;
}
}
}
#guarded(@variable) when (@namespaceGuard>0) {
#deeper {
.mixin() {
should: not match because namespace argument;
}
}
}
#guarded(@variable: default) when (@namespaceGuard>0) {
#deeper {
.mixin() {
guarded: with default;
}
}
}
#guarded when (@namespaceGuard<0) {
#deeper {
.mixin() {
should: not match because namespace guard;
}
}
}
#guarded-caller {
#guarded > #deeper > .mixin();
}
#top {
#deeper when (@namespaceGuard<0) {
.mixin(@a) {
should: not match because namespace guard;
}
}
#deeper() when (@namespaceGuard>0) {
.mixin(@a) {
should: match @a;
}
}
}
#guarded-deeper {
#top > #deeper > .mixin(1);
}