less 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/inspectionProfiles/Project_Default.xml +1 -0
- package/.idea/jsLinters/jscs.xml +4 -0
- package/.idea/jsLinters/jshint.xml +58 -4
- package/.idea/workspace.xml +427 -892
- package/.jscsrc +34 -2
- package/.jshintrc +0 -1
- package/CHANGELOG.md +7 -0
- package/bin/lessc +8 -3
- package/bower.json +1 -1
- package/dist/less.js +362 -245
- package/dist/less.min.js +5 -5
- package/lib/less/data/unit-conversions.js +3 -3
- package/lib/less/environment/abstract-file-manager.js +4 -4
- package/lib/less/functions/color-blending.js +3 -3
- package/lib/less/functions/color.js +7 -7
- package/lib/less/functions/data-uri.js +3 -2
- package/lib/less/functions/string.js +3 -1
- package/lib/less/functions/svg.js +6 -3
- package/lib/less/functions/types.js +3 -1
- package/lib/less/import-manager.js +4 -1
- package/lib/less/index.js +1 -1
- package/lib/less/parser/parser.js +12 -7
- package/lib/less/source-map-output.js +3 -3
- package/lib/less/transform-tree.js +1 -1
- package/lib/less/tree/condition.js +1 -1
- package/lib/less/tree/debug-info.js +6 -2
- package/lib/less/tree/dimension.js +1 -1
- package/lib/less/tree/directive.js +15 -3
- package/lib/less/tree/import.js +1 -1
- package/lib/less/tree/media.js +3 -2
- package/lib/less/tree/mixin-call.js +3 -4
- package/lib/less/tree/mixin-definition.js +4 -3
- package/lib/less/tree/quoted.js +1 -1
- package/lib/less/tree/rule.js +2 -3
- package/lib/less/tree/ruleset.js +223 -149
- package/lib/less/tree/selector.js +2 -1
- package/lib/less/tree/url.js +1 -1
- package/lib/less/tree/value.js +1 -1
- package/lib/less/tree/variable.js +1 -1
- package/lib/less/visitors/extend-visitor.js +30 -22
- package/lib/less/visitors/import-visitor.js +2 -1
- package/lib/less/visitors/to-css-visitor.js +5 -4
- package/lib/less-browser/utils.js +5 -5
- package/lib/less-node/file-manager.js +8 -4
- package/lib/less-node/url-file-manager.js +2 -2
- package/lib/less-rhino/index.js +2 -2
- package/package.json +3 -3
- package/test/browser/common.js +3 -3
- package/test/browser/jasmine-jsreporter.js +2 -2
- package/test/browser/less.js +29 -0
- package/test/copy-bom.js +14 -8
- package/test/css/selectors.css +9 -0
- package/test/index.js +1 -1
- package/test/less/selectors.less +18 -3
- package/test/less-bom/charsets.less +3 -0
- package/test/less-bom/colors.less +98 -0
- package/test/less-bom/comments.less +102 -0
- package/test/less-bom/comments2.less +20 -0
- package/test/less-bom/compression/compression.less +36 -0
- package/test/less-bom/css-3.less +154 -0
- package/test/less-bom/css-escapes.less +33 -0
- package/test/less-bom/css-guards.less +103 -0
- package/test/less-bom/css.less +108 -0
- package/test/less-bom/debug/import/test.less +25 -0
- package/test/less-bom/debug/linenumbers.less +33 -0
- package/test/less-bom/detached-rulesets.less +103 -0
- package/test/less-bom/empty.less +1 -0
- package/test/less-bom/errors/add-mixed-units.less +3 -0
- package/test/less-bom/errors/add-mixed-units.txt +4 -0
- package/test/less-bom/errors/add-mixed-units2.less +3 -0
- package/test/less-bom/errors/add-mixed-units2.txt +4 -0
- package/test/less-bom/errors/at-rules-undefined-var.less +4 -0
- package/test/less-bom/errors/at-rules-undefined-var.txt +4 -0
- package/test/less-bom/errors/bad-variable-declaration1.less +1 -0
- package/test/less-bom/errors/bad-variable-declaration1.txt +2 -0
- package/test/less-bom/errors/color-func-invalid-color.less +3 -0
- package/test/less-bom/errors/color-func-invalid-color.txt +4 -0
- package/test/less-bom/errors/color-invalid-hex-code.less +3 -0
- package/test/less-bom/errors/color-invalid-hex-code.txt +4 -0
- package/test/less-bom/errors/color-invalid-hex-code2.less +3 -0
- package/test/less-bom/errors/color-invalid-hex-code2.txt +4 -0
- package/test/less-bom/errors/css-guard-default-func.less +4 -0
- package/test/less-bom/errors/css-guard-default-func.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-1.less +6 -0
- package/test/less-bom/errors/detached-ruleset-1.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-2.less +6 -0
- package/test/less-bom/errors/detached-ruleset-2.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-3.less +4 -0
- package/test/less-bom/errors/detached-ruleset-3.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-4.less +5 -0
- package/test/less-bom/errors/detached-ruleset-4.txt +4 -0
- package/test/less-bom/errors/detached-ruleset-5.less +4 -0
- package/test/less-bom/errors/detached-ruleset-5.txt +3 -0
- package/test/less-bom/errors/detached-ruleset-6.less +5 -0
- package/test/less-bom/errors/detached-ruleset-6.txt +4 -0
- package/test/less-bom/errors/divide-mixed-units.less +3 -0
- package/test/less-bom/errors/divide-mixed-units.txt +4 -0
- package/test/less-bom/errors/extend-no-selector.less +3 -0
- package/test/less-bom/errors/extend-no-selector.txt +3 -0
- package/test/less-bom/errors/extend-not-at-end.less +3 -0
- package/test/less-bom/errors/extend-not-at-end.txt +3 -0
- package/test/less-bom/errors/import-malformed.less +1 -0
- package/test/less-bom/errors/import-malformed.txt +3 -0
- package/test/less-bom/errors/import-missing.less +6 -0
- package/test/less-bom/errors/import-missing.txt +3 -0
- package/test/less-bom/errors/import-no-semi.less +1 -0
- package/test/less-bom/errors/import-no-semi.txt +2 -0
- package/test/less-bom/errors/import-subfolder1.less +1 -0
- package/test/less-bom/errors/import-subfolder1.txt +3 -0
- package/test/less-bom/errors/import-subfolder2.less +1 -0
- package/test/less-bom/errors/import-subfolder2.txt +4 -0
- package/test/less-bom/errors/imports/import-subfolder1.less +1 -0
- package/test/less-bom/errors/imports/import-subfolder2.less +1 -0
- package/test/less-bom/errors/imports/import-test.less +4 -0
- package/test/less-bom/errors/imports/subfolder/mixin-not-defined.less +1 -0
- package/test/less-bom/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
- package/test/less-bom/errors/javascript-error.less +3 -0
- package/test/less-bom/errors/javascript-error.txt +4 -0
- package/test/less-bom/errors/javascript-undefined-var.less +3 -0
- package/test/less-bom/errors/javascript-undefined-var.txt +4 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-1.less +6 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-1.txt +4 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-2.less +6 -0
- package/test/less-bom/errors/mixed-mixin-definition-args-2.txt +4 -0
- package/test/less-bom/errors/mixin-not-defined.less +11 -0
- package/test/less-bom/errors/mixin-not-defined.txt +3 -0
- package/test/less-bom/errors/mixin-not-matched.less +6 -0
- package/test/less-bom/errors/mixin-not-matched.txt +3 -0
- package/test/less-bom/errors/mixin-not-matched2.less +6 -0
- package/test/less-bom/errors/mixin-not-matched2.txt +3 -0
- package/test/less-bom/errors/mixin-not-visible-in-scope-1.less +9 -0
- package/test/less-bom/errors/mixin-not-visible-in-scope-1.txt +4 -0
- package/test/less-bom/errors/mixins-guards-default-func-1.less +9 -0
- package/test/less-bom/errors/mixins-guards-default-func-1.txt +4 -0
- package/test/less-bom/errors/mixins-guards-default-func-2.less +9 -0
- package/test/less-bom/errors/mixins-guards-default-func-2.txt +4 -0
- package/test/less-bom/errors/mixins-guards-default-func-3.less +9 -0
- package/test/less-bom/errors/mixins-guards-default-func-3.txt +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors.less +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors.txt +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors2.less +4 -0
- package/test/less-bom/errors/multiple-guards-on-css-selectors2.txt +4 -0
- package/test/less-bom/errors/multiply-mixed-units.less +7 -0
- package/test/less-bom/errors/multiply-mixed-units.txt +4 -0
- package/test/less-bom/errors/parens-error-1.less +3 -0
- package/test/less-bom/errors/parens-error-1.txt +4 -0
- package/test/less-bom/errors/parens-error-2.less +3 -0
- package/test/less-bom/errors/parens-error-2.txt +4 -0
- package/test/less-bom/errors/parens-error-3.less +3 -0
- package/test/less-bom/errors/parens-error-3.txt +4 -0
- package/test/less-bom/errors/parse-error-curly-bracket.less +4 -0
- package/test/less-bom/errors/parse-error-curly-bracket.txt +4 -0
- package/test/less-bom/errors/parse-error-extra-parens.less +5 -0
- package/test/less-bom/errors/parse-error-extra-parens.txt +3 -0
- package/test/less-bom/errors/parse-error-missing-bracket.less +2 -0
- package/test/less-bom/errors/parse-error-missing-bracket.txt +3 -0
- package/test/less-bom/errors/parse-error-missing-parens.less +5 -0
- package/test/less-bom/errors/parse-error-missing-parens.txt +3 -0
- package/test/less-bom/errors/parse-error-with-import.less +13 -0
- package/test/less-bom/errors/parse-error-with-import.txt +4 -0
- package/test/less-bom/errors/percentage-missing-space.less +3 -0
- package/test/less-bom/errors/percentage-missing-space.txt +4 -0
- package/test/less-bom/errors/property-asterisk-only-name.less +3 -0
- package/test/less-bom/errors/property-asterisk-only-name.txt +4 -0
- package/test/less-bom/errors/property-ie5-hack.less +3 -0
- package/test/less-bom/errors/property-ie5-hack.txt +3 -0
- package/test/less-bom/errors/property-in-root.less +4 -0
- package/test/less-bom/errors/property-in-root.txt +4 -0
- package/test/less-bom/errors/property-in-root2.less +1 -0
- package/test/less-bom/errors/property-in-root2.txt +4 -0
- package/test/less-bom/errors/property-in-root3.less +4 -0
- package/test/less-bom/errors/property-in-root3.txt +3 -0
- package/test/less-bom/errors/property-interp-not-defined.less +1 -0
- package/test/less-bom/errors/property-interp-not-defined.txt +2 -0
- package/test/less-bom/errors/recursive-variable.less +1 -0
- package/test/less-bom/errors/recursive-variable.txt +2 -0
- package/test/less-bom/errors/single-character.less +1 -0
- package/test/less-bom/errors/single-character.txt +2 -0
- package/test/less-bom/errors/svg-gradient1.less +3 -0
- package/test/less-bom/errors/svg-gradient1.txt +4 -0
- package/test/less-bom/errors/svg-gradient2.less +3 -0
- package/test/less-bom/errors/svg-gradient2.txt +4 -0
- package/test/less-bom/errors/svg-gradient3.less +3 -0
- package/test/less-bom/errors/svg-gradient3.txt +4 -0
- package/test/less-bom/errors/unit-function.less +3 -0
- package/test/less-bom/errors/unit-function.txt +4 -0
- package/test/less-bom/extend-chaining.less +91 -0
- package/test/less-bom/extend-clearfix.less +19 -0
- package/test/less-bom/extend-exact.less +46 -0
- package/test/less-bom/extend-media.less +24 -0
- package/test/less-bom/extend-nest.less +65 -0
- package/test/less-bom/extend-selector.less +99 -0
- package/test/less-bom/extend.less +81 -0
- package/test/less-bom/extract-and-length.less +133 -0
- package/test/less-bom/functions.less +201 -0
- package/test/less-bom/globalVars/extended.json +5 -0
- package/test/less-bom/globalVars/extended.less +10 -0
- package/test/less-bom/globalVars/simple.json +3 -0
- package/test/less-bom/globalVars/simple.less +3 -0
- package/test/less-bom/ie-filters.less +15 -0
- package/test/less-bom/import/deeper/deeper-2/url-import-2.less +3 -0
- package/test/less-bom/import/deeper/deeper-2/url-import.less +1 -0
- package/test/less-bom/import/deeper/import-once-test-a.less +1 -0
- package/test/less-bom/import/deeper/url-import.less +1 -0
- package/test/less-bom/import/import-and-relative-paths-test.less +17 -0
- package/test/less-bom/import/import-charset-test.less +1 -0
- package/test/less-bom/import/import-interpolation.less +2 -0
- package/test/less-bom/import/import-interpolation2.less +5 -0
- package/test/less-bom/import/import-once-test-c.less +6 -0
- package/test/less-bom/import/import-reference.less +89 -0
- package/test/less-bom/import/import-test-a.less +4 -0
- package/test/less-bom/import/import-test-b.less +8 -0
- package/test/less-bom/import/import-test-c.less +6 -0
- package/test/less-bom/import/import-test-d.css +1 -0
- package/test/less-bom/import/import-test-e.less +2 -0
- package/test/less-bom/import/import-test-f.less +5 -0
- package/test/less-bom/import/imports/font.less +8 -0
- package/test/less-bom/import/imports/logo.less +5 -0
- package/test/less-bom/import/interpolation-vars.less +6 -0
- package/test/less-bom/import/invalid-css.less +1 -0
- package/test/less-bom/import/urls.less +1 -0
- package/test/less-bom/import-inline.less +3 -0
- package/test/less-bom/import-interpolation.less +8 -0
- package/test/less-bom/import-once.less +6 -0
- package/test/less-bom/import-reference.less +23 -0
- package/test/less-bom/import.less +30 -0
- package/test/less-bom/include-path/include-path.less +6 -0
- package/test/less-bom/javascript.less +38 -0
- package/test/less-bom/lazy-eval.less +6 -0
- package/test/less-bom/legacy/legacy.less +7 -0
- package/test/less-bom/media.less +234 -0
- package/test/less-bom/merge.less +78 -0
- package/test/less-bom/mixins-args.less +215 -0
- package/test/less-bom/mixins-closure.less +26 -0
- package/test/less-bom/mixins-guards-default-func.less +195 -0
- package/test/less-bom/mixins-guards.less +271 -0
- package/test/less-bom/mixins-important.less +37 -0
- package/test/less-bom/mixins-interpolated.less +75 -0
- package/test/less-bom/mixins-named-args.less +36 -0
- package/test/less-bom/mixins-nested.less +22 -0
- package/test/less-bom/mixins-pattern.less +102 -0
- package/test/less-bom/mixins.less +145 -0
- package/test/less-bom/modifyVars/extended.json +5 -0
- package/test/less-bom/modifyVars/extended.less +11 -0
- package/test/less-bom/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
- package/test/less-bom/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
- package/test/less-bom/no-js-errors/no-js-errors.less +3 -0
- package/test/less-bom/no-js-errors/no-js-errors.txt +4 -0
- package/test/less-bom/no-output.less +2 -0
- package/test/less-bom/operations.less +62 -0
- package/test/less-bom/parens.less +45 -0
- package/test/less-bom/property-name-interp.less +56 -0
- package/test/less-bom/rulesets.less +30 -0
- package/test/less-bom/scope.less +104 -0
- package/test/less-bom/selectors.less +174 -0
- package/test/less-bom/sourcemaps/basic.json +3 -0
- package/test/less-bom/sourcemaps/basic.less +27 -0
- package/test/less-bom/sourcemaps/imported.css +7 -0
- package/test/less-bom/static-urls/urls.less +33 -0
- package/test/less-bom/strict-units/strict-units.less +4 -0
- package/test/less-bom/strings.less +73 -0
- package/test/less-bom/url-args/urls.less +63 -0
- package/test/less-bom/urls.less +94 -0
- package/test/less-bom/variables-in-at-rules.less +20 -0
- package/test/less-bom/variables.less +119 -0
- package/test/less-bom/whitespace.less +44 -0
- package/test/less-test.js +2 -2
- package/test/modify-vars.js +6 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a {outline-@{color}: green}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@bodyColor: darken(@bodyColor, 30%);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
x
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
ArgumentError: error evaluating function `svg-gradient`: svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center' in {path}svg-gradient1.less on line 2, column 6:
|
|
2
|
+
1 .a {
|
|
3
|
+
2 a: svg-gradient(horizontal, black, white);
|
|
4
|
+
3 }
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
ArgumentError: error evaluating function `svg-gradient`: svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] in {path}svg-gradient2.less on line 2, column 6:
|
|
2
|
+
1 .a {
|
|
3
|
+
2 a: svg-gradient(to bottom, black, orange, 45%, white);
|
|
4
|
+
3 }
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//very simple chaining
|
|
2
|
+
.a {
|
|
3
|
+
color: black;
|
|
4
|
+
}
|
|
5
|
+
.b:extend(.a) {}
|
|
6
|
+
.c:extend(.b) {}
|
|
7
|
+
|
|
8
|
+
//very simple chaining, ordering not important
|
|
9
|
+
|
|
10
|
+
.d:extend(.e) {}
|
|
11
|
+
.e:extend(.f) {}
|
|
12
|
+
.f {
|
|
13
|
+
color: black;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//extend with all
|
|
17
|
+
|
|
18
|
+
.g.h {
|
|
19
|
+
color: black;
|
|
20
|
+
}
|
|
21
|
+
.i.j:extend(.g all) {
|
|
22
|
+
color: white;
|
|
23
|
+
}
|
|
24
|
+
.k:extend(.i all) {}
|
|
25
|
+
|
|
26
|
+
//extend multi-chaining
|
|
27
|
+
|
|
28
|
+
.l {
|
|
29
|
+
color: black;
|
|
30
|
+
}
|
|
31
|
+
.m:extend(.l){}
|
|
32
|
+
.n:extend(.m){}
|
|
33
|
+
.o:extend(.n){}
|
|
34
|
+
.p:extend(.o){}
|
|
35
|
+
.q:extend(.p){}
|
|
36
|
+
.r:extend(.q){}
|
|
37
|
+
.s:extend(.r){}
|
|
38
|
+
.t:extend(.s){}
|
|
39
|
+
|
|
40
|
+
// self referencing is ignored
|
|
41
|
+
|
|
42
|
+
.u {color: black;}
|
|
43
|
+
.v.u.v:extend(.u all){}
|
|
44
|
+
|
|
45
|
+
// circular reference because the new extend product will match the existing extend
|
|
46
|
+
|
|
47
|
+
.w:extend(.w) {color: black;}
|
|
48
|
+
.v.w.v:extend(.w all){}
|
|
49
|
+
|
|
50
|
+
// classic circular references
|
|
51
|
+
|
|
52
|
+
.x:extend(.z) {
|
|
53
|
+
color: x;
|
|
54
|
+
}
|
|
55
|
+
.y:extend(.x) {
|
|
56
|
+
color: y;
|
|
57
|
+
}
|
|
58
|
+
.z:extend(.y) {
|
|
59
|
+
color: z;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//very simple chaining, but with the extend inside the ruleset
|
|
63
|
+
.va {
|
|
64
|
+
color: black;
|
|
65
|
+
}
|
|
66
|
+
.vb {
|
|
67
|
+
&:extend(.va);
|
|
68
|
+
color: white;
|
|
69
|
+
}
|
|
70
|
+
.vc {
|
|
71
|
+
&:extend(.vb);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// media queries - dont extend outside, do extend inside
|
|
75
|
+
|
|
76
|
+
@media tv {
|
|
77
|
+
.ma:extend(.a,.b,.c,.d,.e,.f,.g,.h,.i,.j,.k,.l,.m,.n,.o,.p,.q,.r,.s,.t,.u,.v,.w,.x,.y,.z,.md) {
|
|
78
|
+
color: black;
|
|
79
|
+
}
|
|
80
|
+
.md {
|
|
81
|
+
color: white;
|
|
82
|
+
}
|
|
83
|
+
@media plasma {
|
|
84
|
+
.me, .mf {
|
|
85
|
+
&:extend(.mb,.md);
|
|
86
|
+
background: red;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.mb:extend(.ma) {};
|
|
91
|
+
.mc:extend(.mb) {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.replace.replace,
|
|
2
|
+
.c.replace + .replace {
|
|
3
|
+
.replace,
|
|
4
|
+
.c {
|
|
5
|
+
prop: copy-paste-replace;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
.rep_ace:extend(.replace.replace .replace) {}
|
|
9
|
+
|
|
10
|
+
.a .b .c {
|
|
11
|
+
prop: not_effected;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.a {
|
|
15
|
+
prop: is_effected;
|
|
16
|
+
.b {
|
|
17
|
+
prop: not_effected;
|
|
18
|
+
}
|
|
19
|
+
.b.c {
|
|
20
|
+
prop: not_effected;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.c, .a {
|
|
25
|
+
.b, .a {
|
|
26
|
+
.a, .c {
|
|
27
|
+
prop: not_effected;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.effected {
|
|
33
|
+
&:extend(.a);
|
|
34
|
+
&:extend(.b);
|
|
35
|
+
&:extend(.c);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.e {
|
|
39
|
+
&& {
|
|
40
|
+
prop: extend-double;
|
|
41
|
+
&:hover {
|
|
42
|
+
hover: not-extended;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.dbl:extend(.e.e) {}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.ext1 .ext2 {
|
|
2
|
+
background: black;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@media tv {
|
|
6
|
+
.ext1 .ext3 {
|
|
7
|
+
color: white;
|
|
8
|
+
}
|
|
9
|
+
.tv-lowres :extend(.ext1 all) {
|
|
10
|
+
background: blue;
|
|
11
|
+
}
|
|
12
|
+
@media hires {
|
|
13
|
+
.ext1 .ext4 {
|
|
14
|
+
color: green;
|
|
15
|
+
}
|
|
16
|
+
.tv-hires :extend(.ext1 all) {
|
|
17
|
+
background: red;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.all:extend(.ext1 all) {
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.sidebar {
|
|
2
|
+
width: 300px;
|
|
3
|
+
background: red;
|
|
4
|
+
|
|
5
|
+
.box {
|
|
6
|
+
background: #FFF;
|
|
7
|
+
border: 1px solid #000;
|
|
8
|
+
margin: 10px 0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sidebar2 {
|
|
13
|
+
&:extend(.sidebar all);
|
|
14
|
+
background: blue;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.type1 {
|
|
18
|
+
.sidebar3 {
|
|
19
|
+
&:extend(.sidebar all);
|
|
20
|
+
background: green;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.type2 {
|
|
25
|
+
&.sidebar4 {
|
|
26
|
+
&:extend(.sidebar all);
|
|
27
|
+
background: red;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.button {
|
|
32
|
+
color: black;
|
|
33
|
+
&:hover {
|
|
34
|
+
color: white;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.submit {
|
|
38
|
+
&:extend(.button);
|
|
39
|
+
&:hover:extend(.button:hover) {}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.nomatch {
|
|
43
|
+
&:hover:extend(.button :hover) {}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.button2 {
|
|
47
|
+
:hover {
|
|
48
|
+
nested: white;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.button2 :hover {
|
|
52
|
+
notnested: black;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.nomatch :extend(.button2:hover) {}
|
|
56
|
+
|
|
57
|
+
.amp-test-a,
|
|
58
|
+
.amp-test-b {
|
|
59
|
+
.amp-test-c &.amp-test-d&.amp-test-e {
|
|
60
|
+
.amp-test-f&+&.amp-test-g:extend(.amp-test-h) {}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
.amp-test-h {
|
|
64
|
+
test: extended by masses of selectors;
|
|
65
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.error {
|
|
2
|
+
border: 1px #f00;
|
|
3
|
+
background: #fdd;
|
|
4
|
+
}
|
|
5
|
+
.error.intrusion {
|
|
6
|
+
font-size: 1.3em;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
}
|
|
9
|
+
.intrusion .error {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
.badError:extend(.error all) {
|
|
13
|
+
border-width: 3px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.foo .bar, .foo .baz {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ext1 .ext2
|
|
21
|
+
:extend(.foo all) {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ext3:extend(.foo all),
|
|
25
|
+
.ext4:extend(.foo all) {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
div.ext5,
|
|
29
|
+
.ext6 > .ext5 {
|
|
30
|
+
width: 100px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.should-not-exist-in-output,
|
|
34
|
+
.ext7:extend(.ext5 all) {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ext {
|
|
38
|
+
test: 1;
|
|
39
|
+
}
|
|
40
|
+
// same as
|
|
41
|
+
// .a .c:extend(.ext all)
|
|
42
|
+
// .b .c:extend(.ext all)
|
|
43
|
+
// .a .c .d
|
|
44
|
+
// .b .c .d
|
|
45
|
+
.a, .b {
|
|
46
|
+
test: 2;
|
|
47
|
+
.c:extend(.ext all) {
|
|
48
|
+
test: 3;
|
|
49
|
+
.d {
|
|
50
|
+
test: 4;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.replace.replace,
|
|
56
|
+
.c.replace + .replace {
|
|
57
|
+
.replace,
|
|
58
|
+
.c {
|
|
59
|
+
prop: copy-paste-replace;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.rep_ace:extend(.replace all) {}
|
|
63
|
+
|
|
64
|
+
.attributes {
|
|
65
|
+
[data="test"] {
|
|
66
|
+
extend: attributes;
|
|
67
|
+
}
|
|
68
|
+
.attribute-test {
|
|
69
|
+
&:extend([data="test"] all);
|
|
70
|
+
}
|
|
71
|
+
[data] {
|
|
72
|
+
extend: attributes2;
|
|
73
|
+
}
|
|
74
|
+
.attribute-test2 {
|
|
75
|
+
&:extend([data] all); //you could argue it should match [data="test"]... not for now though...
|
|
76
|
+
}
|
|
77
|
+
@attr-data: "test3";
|
|
78
|
+
[data=@{attr-data}] {
|
|
79
|
+
extend: attributes2;
|
|
80
|
+
}
|
|
81
|
+
.attribute-test {
|
|
82
|
+
&:extend([data="test3"] all);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.header {
|
|
87
|
+
.header-nav {
|
|
88
|
+
background: red;
|
|
89
|
+
&:before {
|
|
90
|
+
background: blue;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.footer {
|
|
96
|
+
.footer-nav {
|
|
97
|
+
&:extend( .header .header-nav all );
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.error {
|
|
2
|
+
border: 1px #f00;
|
|
3
|
+
background: #fdd;
|
|
4
|
+
}
|
|
5
|
+
.error.intrusion {
|
|
6
|
+
font-size: 1.3em;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
}
|
|
9
|
+
.intrusion .error {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
.badError {
|
|
13
|
+
&:extend(.error all);
|
|
14
|
+
border-width: 3px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.foo .bar, .foo .baz {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ext1 .ext2 {
|
|
22
|
+
&:extend(.foo all);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ext3,
|
|
26
|
+
.ext4 {
|
|
27
|
+
&:extend(.foo all);
|
|
28
|
+
&:extend(.bar all);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
div.ext5,
|
|
32
|
+
.ext6 > .ext5 {
|
|
33
|
+
width: 100px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ext7 {
|
|
37
|
+
&:extend(.ext5 all);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ext8.ext9 {
|
|
41
|
+
result: add-foo;
|
|
42
|
+
}
|
|
43
|
+
.ext8 .ext9,
|
|
44
|
+
.ext8 + .ext9,
|
|
45
|
+
.ext8 > .ext9 {
|
|
46
|
+
result: bar-matched;
|
|
47
|
+
}
|
|
48
|
+
.ext8.nomatch {
|
|
49
|
+
result: none;
|
|
50
|
+
}
|
|
51
|
+
.ext8 {
|
|
52
|
+
.ext9 {
|
|
53
|
+
result: match-nested-bar;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
.ext8 {
|
|
57
|
+
&.ext9 {
|
|
58
|
+
result: match-nested-foo;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.fuu:extend(.ext8.ext9 all) {}
|
|
63
|
+
.buu:extend(.ext8 .ext9 all) {}
|
|
64
|
+
.zap:extend(.ext8 + .ext9 all) {}
|
|
65
|
+
.zoo:extend(.ext8 > .ext9 all) {}
|
|
66
|
+
|
|
67
|
+
.aa {
|
|
68
|
+
color: black;
|
|
69
|
+
.dd {
|
|
70
|
+
background: red;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
.bb {
|
|
74
|
+
background: red;
|
|
75
|
+
.bb {
|
|
76
|
+
color: black;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.cc:extend(.aa,.bb) {}
|
|
80
|
+
.ee:extend(.dd all,.bb) {}
|
|
81
|
+
.ff:extend(.dd,.bb all) {}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
|
|
2
|
+
// simple array/list:
|
|
3
|
+
|
|
4
|
+
.multiunit {
|
|
5
|
+
@v: abc "abc" 1 1px 1% #123;
|
|
6
|
+
length: length(@v);
|
|
7
|
+
extract: extract(@v, 1) extract(@v, 2) extract(@v, 3) extract(@v, 4) extract(@v, 5) extract(@v, 6);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.incorrect-index {
|
|
11
|
+
@v1: a b c;
|
|
12
|
+
@v2: a, b, c;
|
|
13
|
+
v1: extract(@v1, 5);
|
|
14
|
+
v2: extract(@v2, -2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.scalar {
|
|
18
|
+
@var: variable;
|
|
19
|
+
var-value: extract(@var, 1);
|
|
20
|
+
var-length: length(@var);
|
|
21
|
+
ill-index: extract(@var, 2);
|
|
22
|
+
|
|
23
|
+
name-value: extract(name, 1);
|
|
24
|
+
string-value: extract("string", 1);
|
|
25
|
+
number-value: extract(12345678, 1);
|
|
26
|
+
color-value: extract(blue, 1);
|
|
27
|
+
rgba-value: extract(rgba(80, 160, 240, 0.67), 1);
|
|
28
|
+
empty-value: extract(~'', 1);
|
|
29
|
+
|
|
30
|
+
name-length: length(name);
|
|
31
|
+
string-length: length("string");
|
|
32
|
+
number-length: length(12345678);
|
|
33
|
+
color-length: length(blue);
|
|
34
|
+
rgba-length: length(rgba(80, 160, 240, 0.67));
|
|
35
|
+
empty-length: length(~'');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.mixin-arguments {
|
|
39
|
+
.mixin-args(a b c d);
|
|
40
|
+
.mixin-args(a, b, c, d);
|
|
41
|
+
.mixin-args(1; 2; 3; 4);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.mixin-args(@value) {
|
|
45
|
+
&-1 {
|
|
46
|
+
length: length(@value);
|
|
47
|
+
extract: extract(@value, 3) ~"|" extract(@value, 2) ~"|" extract(@value, 1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.mixin-args(...) {
|
|
52
|
+
&-2 {
|
|
53
|
+
length: length(@arguments);
|
|
54
|
+
extract: extract(@arguments, 3) ~"|" extract(@arguments, 2) ~"|" extract(@arguments, 1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.mixin-args(@values...) {
|
|
59
|
+
&-3 {
|
|
60
|
+
length: length(@values);
|
|
61
|
+
extract: extract(@values, 3) ~"|" extract(@values, 2) ~"|" extract(@values, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.mixin-args(@head, @tail...) {
|
|
66
|
+
&-4 {
|
|
67
|
+
length: length(@tail);
|
|
68
|
+
extract: extract(@tail, 2) ~"|" extract(@tail, 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// "multidimensional" array/list
|
|
73
|
+
|
|
74
|
+
.md-space-comma {
|
|
75
|
+
@v: a b c, 1 2 3, "x" "y" "z";
|
|
76
|
+
length-1: length(@v);
|
|
77
|
+
extract-1: extract(@v, 2);
|
|
78
|
+
length-2: length(extract(@v, 2));
|
|
79
|
+
extract-2: extract(extract(@v, 2), 2);
|
|
80
|
+
|
|
81
|
+
&-as-args {.mixin-args(a b c, 1 2 3, "x" "y" "z")}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.md-cat-space-comma {
|
|
85
|
+
@a: a b c;
|
|
86
|
+
@b: 1 2 3;
|
|
87
|
+
@c: "x" "y" "z";
|
|
88
|
+
@v: @a, @b, @c;
|
|
89
|
+
length-1: length(@v);
|
|
90
|
+
extract-1: extract(@v, 2);
|
|
91
|
+
length-2: length(extract(@v, 2));
|
|
92
|
+
extract-2: extract(extract(@v, 2), 2);
|
|
93
|
+
|
|
94
|
+
&-as-args {.mixin-args(@a, @b, @c)}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.md-cat-comma-space {
|
|
98
|
+
@a: a, b, c;
|
|
99
|
+
@b: 1, 2, 3;
|
|
100
|
+
@c: "x", "y", "z";
|
|
101
|
+
@v: @a @b @c;
|
|
102
|
+
length-1: length(@v);
|
|
103
|
+
extract-1: extract(@v, 2);
|
|
104
|
+
length-2: length(extract(@v, 2));
|
|
105
|
+
extract-2: extract(extract(@v, 2), 2);
|
|
106
|
+
|
|
107
|
+
&-as-args {.mixin-args(@a @b @c)}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.md-3D {
|
|
111
|
+
@a: a b c d, 1 2 3 4;
|
|
112
|
+
@b: 5 6 7 8, e f g h;
|
|
113
|
+
.3D(@a, @b);
|
|
114
|
+
|
|
115
|
+
.3D(...) {
|
|
116
|
+
|
|
117
|
+
@v1: @arguments;
|
|
118
|
+
length-1: length(@v1);
|
|
119
|
+
extract-1: extract(@v1, 1);
|
|
120
|
+
|
|
121
|
+
@v2: extract(@v1, 2);
|
|
122
|
+
length-2: length(@v2);
|
|
123
|
+
extract-2: extract(@v2, 1);
|
|
124
|
+
|
|
125
|
+
@v3: extract(@v2, 1);
|
|
126
|
+
length-3: length(@v3);
|
|
127
|
+
extract-3: extract(@v3, 3);
|
|
128
|
+
|
|
129
|
+
@v4: extract(@v3, 4);
|
|
130
|
+
length-4: length(@v4);
|
|
131
|
+
extract-4: extract(@v4, 1);
|
|
132
|
+
}
|
|
133
|
+
}
|