Experimental support for "property name interpolation".

This commit is contained in:
seven-phases-max
2013-12-18 07:09:14 +04:00
parent 3818727bf7
commit 4fd9704266
6 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
test {
border: 0;
ufo-width: 50%;
*-z-border: 1px dashed blue;
-www-border-top: 2px;
radius-is-not-a-border: true;
border-top-left-radius: 2em;
border-top-red-radius-: 3pt;
global-local-mixer-property: strong;
}
test-merge {
pre-property-ish: high, middle, low, base;
pre-property-ish+: nice try dude;
}

View File

@@ -0,0 +1,3 @@
a {
* : 1;
}

View File

@@ -0,0 +1,4 @@
ParseError: Unrecognised input in {path}property-asterisk-only-name.less on line 2, column 5:
1 a {
2 * : 1;
3 }

View File

@@ -0,0 +1 @@
a {outline-@{color}: green}

View File

@@ -0,0 +1,2 @@
NameError: variable @color is undefined in {path}property-interp-not-defined.less on line 1, column 12:
1 a {outline-@{color}: green}

View File

@@ -0,0 +1,41 @@
test {
@prefix: ufo-;
@a: border;
@bb: top;
@c_c: left;
@d-d4: radius;
@-: -;
@{a}: 0;
@{prefix}width: 50%;
*-z-@{a} :1px dashed blue;
-www-@{a}-@{bb}: 2px;
@{d-d4}-is-not-a-@{a}:true;
@{a}-@{bb}-@{c_c}-@{d-d4} : 2em;
@{a}@{-}@{bb}@{-}red@{-}@{d-d4}-: 3pt;
.mixin(mixer);
.merge(ish, base);
}
@global: global;
.mixin(@arg) {
@local: local;
@{global}-@{local}-@{arg}-property: strong;
}
.merge(@p, @v) {
&-merge {
@prefix: pre;
@suffix: ish;
@{prefix}-property-ish+ :high;
pre-property-@{suffix} +: middle;
@{prefix}-property-@{suffix}+: low;
@{prefix}-property-@{p} + : @v;
@subterfuge: ~'+';
pre-property-ish@{subterfuge}: nice try dude;
}
}