less 2.1.2 → 2.4.0
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 +499 -760
- package/.jscsrc +73 -0
- package/.jshintrc +0 -2
- package/.travis.yml +1 -0
- package/CHANGELOG.md +59 -0
- package/Gruntfile.js +37 -3
- package/appveyor.yml +5 -0
- package/bin/lessc +383 -316
- package/bower.json +1 -1
- package/dist/less.js +1638 -1244
- package/dist/less.min.js +7 -7
- package/lib/less/contexts.js +3 -3
- package/lib/less/data/unit-conversions.js +3 -3
- package/lib/less/environment/abstract-file-manager.js +8 -8
- package/lib/less/environment/environment.js +2 -2
- package/lib/less/functions/color-blending.js +3 -3
- package/lib/less/functions/color.js +20 -12
- package/lib/less/functions/data-uri.js +26 -18
- package/lib/less/functions/math.js +1 -1
- package/lib/less/functions/number.js +2 -2
- package/lib/less/functions/string.js +3 -1
- package/lib/less/functions/svg.js +12 -15
- package/lib/less/functions/types.js +33 -10
- package/lib/less/import-manager.js +14 -9
- package/lib/less/index.js +2 -1
- package/lib/less/less-error.js +1 -1
- package/lib/less/logger.js +2 -2
- package/lib/less/parse-tree.js +48 -42
- package/lib/less/parse.js +68 -0
- package/lib/less/parser/parser-input.js +6 -5
- package/lib/less/parser/parser.js +76 -29
- package/lib/less/plugin-manager.js +30 -3
- package/lib/less/render.js +11 -37
- package/lib/less/source-map-builder.js +4 -0
- package/lib/less/source-map-output.js +6 -6
- package/lib/less/transform-tree.js +4 -4
- package/lib/less/tree/anonymous.js +1 -1
- package/lib/less/tree/assignment.js +0 -1
- package/lib/less/tree/call.js +1 -1
- package/lib/less/tree/color.js +6 -6
- package/lib/less/tree/condition.js +9 -5
- package/lib/less/tree/debug-info.js +6 -2
- package/lib/less/tree/dimension.js +5 -5
- package/lib/less/tree/directive.js +25 -6
- package/lib/less/tree/element.js +1 -1
- package/lib/less/tree/expression.js +2 -2
- package/lib/less/tree/extend.js +3 -3
- package/lib/less/tree/import.js +2 -2
- package/lib/less/tree/index.js +1 -0
- package/lib/less/tree/javascript.js +2 -2
- package/lib/less/tree/media.js +20 -19
- package/lib/less/tree/mixin-call.js +5 -6
- package/lib/less/tree/mixin-definition.js +33 -11
- package/lib/less/tree/quoted.js +3 -3
- package/lib/less/tree/rule.js +3 -4
- package/lib/less/tree/ruleset.js +290 -177
- package/lib/less/tree/selector.js +3 -2
- package/lib/less/tree/unit.js +2 -0
- package/lib/less/tree/url.js +5 -2
- package/lib/less/tree/value.js +2 -2
- package/lib/less/tree/variable.js +1 -1
- package/lib/less/visitors/extend-visitor.js +72 -36
- package/lib/less/visitors/import-sequencer.js +20 -14
- package/lib/less/visitors/import-visitor.js +15 -12
- package/lib/less/visitors/to-css-visitor.js +41 -9
- package/lib/less-browser/add-default-options.js +5 -1
- package/lib/less-browser/bootstrap.js +10 -8
- package/lib/less-browser/cache.js +3 -3
- package/lib/less-browser/file-manager.js +96 -96
- package/lib/less-browser/index.js +206 -205
- package/lib/less-browser/log-listener.js +2 -2
- package/lib/less-browser/utils.js +6 -6
- package/lib/less-node/file-manager.js +58 -30
- package/lib/less-node/image-size.js +34 -0
- package/lib/less-node/index.js +6 -3
- package/lib/less-node/lessc-helper.js +3 -2
- package/lib/less-node/plugin-loader.js +3 -3
- package/lib/less-node/url-file-manager.js +6 -3
- package/lib/less-rhino/index.js +15 -13
- package/lib/source-map/source-map-0.1.31.js +1 -1
- package/package.json +10 -7
- package/test/browser/common.js +13 -11
- package/test/browser/css/relative-urls/urls.css +1 -0
- package/test/browser/css/urls.css +6 -3
- package/test/browser/jasmine-jsreporter.js +2 -3
- package/test/browser/less/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
- package/test/browser/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
- package/test/browser/less/relative-urls/urls.less +1 -0
- package/test/browser/less/urls.less +1 -0
- package/test/browser/runner-browser-options.js +23 -23
- package/test/browser/runner-errors-options.js +0 -1
- package/test/browser/runner-errors-spec.js +1 -2
- package/test/browser/runner-global-vars-spec.js +1 -1
- package/test/browser/runner-legacy-options.js +0 -1
- package/test/browser/runner-main-options.js +5 -5
- package/test/browser/runner-main-spec.js +1 -1
- package/test/browser/runner-no-js-errors-spec.js +0 -1
- package/test/browser/runner-production-options.js +0 -1
- package/test/browser/runner-relative-urls-options.js +0 -1
- package/test/browser/runner-rootpath-options.js +0 -1
- package/test/browser/runner-rootpath-relative-options.js +0 -1
- package/test/browser/runner-strict-units-options.js +0 -1
- package/test/copy-bom.js +72 -0
- package/test/css/comments.css +1 -0
- package/test/css/css-3.css +2 -0
- package/test/css/functions.css +10 -0
- package/test/css/import-interpolation.css +7 -0
- package/test/css/import-reference.css +25 -0
- package/test/css/include-path/include-path.css +6 -0
- package/test/css/mixins-important.css +12 -0
- package/test/css/selectors.css +15 -1
- package/test/css/static-urls/urls.css +1 -0
- package/test/css/url-args/urls.css +3 -3
- package/test/css/urls.css +13 -4
- package/test/css/variables.css +7 -1
- package/test/data/image.svg +3 -0
- package/test/index.js +15 -10
- package/test/less/comments.less +1 -0
- package/test/less/css-3.less +3 -0
- package/test/less/css-guards.less +2 -1
- package/test/less/errors/detached-ruleset-2.txt +1 -1
- package/test/less/errors/import-missing.txt +1 -1
- package/test/less/errors/parens-error-1.txt +1 -1
- package/test/less/errors/parens-error-2.txt +1 -1
- package/test/less/errors/parens-error-3.txt +1 -1
- package/test/less/errors/single-character.less +1 -0
- package/test/less/errors/single-character.txt +2 -0
- package/test/less/functions.less +18 -0
- package/test/less/import/import-interpolation.less +1 -0
- package/test/less/import/import-reference.less +38 -0
- package/test/less/import/imports/logo.less +1 -0
- package/test/less/import-reference.less +3 -1
- package/test/less/import.less +2 -0
- package/test/less/include-path/include-path.less +6 -0
- package/test/less/mixins-important.less +28 -0
- package/test/less/nested-gradient-with-svg-gradient/mixin-consumer.less +5 -0
- package/test/less/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +15 -0
- package/test/less/selectors.less +29 -4
- package/test/less/sourcemaps-empty/empty.less +0 -0
- package/test/less/sourcemaps-empty/var-defs.less +1 -0
- package/test/less/urls.less +10 -1
- package/test/less/variables.less +17 -3
- package/test/less-test.js +133 -52
- package/test/modify-vars.js +14 -12
- package/test/browser/less.js +0 -9473
package/test/css/comments.css
CHANGED
package/test/css/css-3.css
CHANGED
package/test/css/functions.css
CHANGED
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
mixt: rgba(255, 0, 0, 0.5);
|
|
128
128
|
}
|
|
129
129
|
#built-in .is-a {
|
|
130
|
+
ruleset: true;
|
|
130
131
|
color: true;
|
|
131
132
|
color1: true;
|
|
132
133
|
color2: true;
|
|
@@ -138,6 +139,7 @@
|
|
|
138
139
|
percent: true;
|
|
139
140
|
em: true;
|
|
140
141
|
cat: true;
|
|
142
|
+
no-unit-is-empty: true;
|
|
141
143
|
case-insensitive-1: true;
|
|
142
144
|
case-insensitive-2: true;
|
|
143
145
|
}
|
|
@@ -173,3 +175,11 @@
|
|
|
173
175
|
format-keyword: hello;
|
|
174
176
|
format-anonymous: hello anonymous world;
|
|
175
177
|
}
|
|
178
|
+
#list-details {
|
|
179
|
+
length: 2;
|
|
180
|
+
one: a 1;
|
|
181
|
+
two: b 2;
|
|
182
|
+
two-length: 2;
|
|
183
|
+
two-one: b;
|
|
184
|
+
two-two: 2;
|
|
185
|
+
}
|
|
@@ -34,6 +34,14 @@ div#id.class[a=1][b=2].class:not(1) {
|
|
|
34
34
|
.visible + .visible .sub {
|
|
35
35
|
color: green;
|
|
36
36
|
}
|
|
37
|
+
@supports (something: else) {
|
|
38
|
+
.class {
|
|
39
|
+
something: else;
|
|
40
|
+
}
|
|
41
|
+
.nestedToo .class {
|
|
42
|
+
something: else;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
37
45
|
.b {
|
|
38
46
|
color: red;
|
|
39
47
|
color: green;
|
|
@@ -66,3 +74,20 @@ div#id.class[a=1][b=2].class:not(1) {
|
|
|
66
74
|
color: red;
|
|
67
75
|
}
|
|
68
76
|
}
|
|
77
|
+
.test {
|
|
78
|
+
color: red;
|
|
79
|
+
}
|
|
80
|
+
.test:first-child {
|
|
81
|
+
color: blue;
|
|
82
|
+
}
|
|
83
|
+
@keyframes some-name {
|
|
84
|
+
property: value;
|
|
85
|
+
}
|
|
86
|
+
@supports (animation-name: test) {
|
|
87
|
+
@keyframes some-name {
|
|
88
|
+
property: value;
|
|
89
|
+
}
|
|
90
|
+
.selector {
|
|
91
|
+
color: red;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
body {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
data-uri {
|
|
5
|
+
property: url("data:image/svg+xml,%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E");
|
|
6
|
+
}
|
|
@@ -43,3 +43,15 @@
|
|
|
43
43
|
.class .inner {
|
|
44
44
|
test: 9;
|
|
45
45
|
}
|
|
46
|
+
.when-calling-nested-issue-2394 {
|
|
47
|
+
width: auto !important;
|
|
48
|
+
}
|
|
49
|
+
.when-calling-nested-with-param-issue-2394 {
|
|
50
|
+
width: 10px !important;
|
|
51
|
+
}
|
|
52
|
+
.class1-2421 {
|
|
53
|
+
margin: 5px !important;
|
|
54
|
+
}
|
|
55
|
+
.class2-2421 {
|
|
56
|
+
margin: 5px;
|
|
57
|
+
}
|
package/test/css/selectors.css
CHANGED
|
@@ -119,7 +119,7 @@ p a span {
|
|
|
119
119
|
.bloodred {
|
|
120
120
|
color: green;
|
|
121
121
|
}
|
|
122
|
-
#blood.blood.red.black {
|
|
122
|
+
#blood.blood.red.black:blood {
|
|
123
123
|
color: black;
|
|
124
124
|
}
|
|
125
125
|
:nth-child(3) {
|
|
@@ -154,3 +154,17 @@ blank blank blank blank blank blank blank blank blank blank blank blank blank bl
|
|
|
154
154
|
.blood {
|
|
155
155
|
color: red;
|
|
156
156
|
}
|
|
157
|
+
.foo:not(.tst.only-nested .level2:hover) {
|
|
158
|
+
test: only-nested;
|
|
159
|
+
}
|
|
160
|
+
.foo.nestend-and-non-nested:not(.tst.nestend-and-non-nested:hover) {
|
|
161
|
+
test: nestend-and-non-nested;
|
|
162
|
+
}
|
|
163
|
+
.selector:not(:hover) {
|
|
164
|
+
test: global scope;
|
|
165
|
+
}
|
|
166
|
+
.extend-this,
|
|
167
|
+
.active.first-level .second-level,
|
|
168
|
+
.first-level .second-level.active2 {
|
|
169
|
+
content: '\2661';
|
|
170
|
+
}
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
uri-2: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
|
|
47
47
|
}
|
|
48
48
|
#svg-functions {
|
|
49
|
-
background-image: url('data:image/svg+xml
|
|
50
|
-
background-image: url('data:image/svg+xml
|
|
51
|
-
background-image: url('data:image/svg+xml
|
|
49
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
50
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
51
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%221%25%22%20stop-color%3D%22%23c4c4c4%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%225%25%22%20stop-color%3D%22%23008000%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
52
52
|
}
|
|
53
53
|
#data-uri-with-spaces {
|
|
54
54
|
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
|
package/test/css/urls.css
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
@import "css/background.css";
|
|
2
2
|
@import "import/import-test-d.css";
|
|
3
3
|
@import "file.css";
|
|
4
|
+
.gray-gradient {
|
|
5
|
+
background: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%2260%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.05%22%2F%3E%3Cstop%20offset%3D%2270%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.1%22%2F%3E%3Cstop%20offset%3D%2273%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.15%22%2F%3E%3Cstop%20offset%3D%2275%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.2%22%2F%3E%3Cstop%20offset%3D%2280%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.25%22%2F%3E%3Cstop%20offset%3D%2285%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.3%22%2F%3E%3Cstop%20offset%3D%2288%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.35%22%2F%3E%3Cstop%20offset%3D%2290%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.4%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.45%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.5%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
6
|
+
}
|
|
4
7
|
@font-face {
|
|
5
8
|
src: url("/fonts/garamond-pro.ttf");
|
|
6
9
|
src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg");
|
|
@@ -36,6 +39,7 @@
|
|
|
36
39
|
width: 100px;
|
|
37
40
|
height: 100px;
|
|
38
41
|
background: url('import/assets/logo.png');
|
|
42
|
+
background: url("#inline-svg");
|
|
39
43
|
}
|
|
40
44
|
@font-face {
|
|
41
45
|
font-family: xecret;
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
}
|
|
55
59
|
#data-uri {
|
|
56
60
|
uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
|
|
61
|
+
background-image: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="), url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
|
|
57
62
|
uri-fragment: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==#fragment");
|
|
58
63
|
}
|
|
59
64
|
#data-uri-guess {
|
|
@@ -63,13 +68,17 @@
|
|
|
63
68
|
uri-1: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
|
|
64
69
|
uri-2: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
|
|
65
70
|
}
|
|
66
|
-
#
|
|
71
|
+
#file-functions {
|
|
67
72
|
uri: url('../data/data-uri-fail.png');
|
|
73
|
+
svg-not-base-64: url("data:image/svg+xml,%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E");
|
|
74
|
+
size: 640px 430px;
|
|
75
|
+
width: 640px;
|
|
76
|
+
height: 430px;
|
|
68
77
|
}
|
|
69
78
|
#svg-functions {
|
|
70
|
-
background-image: url('data:image/svg+xml
|
|
71
|
-
background-image: url('data:image/svg+xml
|
|
72
|
-
background-image: url('data:image/svg+xml
|
|
79
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
80
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
81
|
+
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%221%25%22%20stop-color%3D%22%23c4c4c4%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%225%25%22%20stop-color%3D%22%23008000%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
|
|
73
82
|
}
|
|
74
83
|
@font-face {
|
|
75
84
|
font-family: 'MyWebFont';
|
package/test/css/variables.css
CHANGED
|
@@ -22,7 +22,13 @@
|
|
|
22
22
|
multi-important: #888888 #888888, 'Trebuchet' !important;
|
|
23
23
|
multi: something 'A', B, C, 'Trebuchet';
|
|
24
24
|
}
|
|
25
|
-
.variable-names {
|
|
25
|
+
.variable-names .quoted {
|
|
26
|
+
name: 'hello';
|
|
27
|
+
}
|
|
28
|
+
.variable-names .unquoted {
|
|
29
|
+
name: 'hello';
|
|
30
|
+
}
|
|
31
|
+
.variable-names .color-keyword {
|
|
26
32
|
name: 'hello';
|
|
27
33
|
}
|
|
28
34
|
.alpha {
|
package/test/index.js
CHANGED
|
@@ -4,17 +4,19 @@ var lessTest = require("./less-test"),
|
|
|
4
4
|
stylize = require('../lib/less-node/lessc-helper').stylize;
|
|
5
5
|
|
|
6
6
|
function getErrorPathReplacementFunction(dir) {
|
|
7
|
-
return function(input) {
|
|
8
|
-
return input.replace(
|
|
9
|
-
|
|
10
|
-
.replace(
|
|
11
|
-
.replace(
|
|
12
|
-
.replace(
|
|
7
|
+
return function(input, baseDir) {
|
|
8
|
+
return input.replace(/\{path\}/g, path.join(process.cwd(), baseDir, dir + "/"))
|
|
9
|
+
.replace(/\{node\}/g, "")
|
|
10
|
+
.replace(/\{\/node\}/g, "")
|
|
11
|
+
.replace(/\{pathrel\}/g, path.join(baseDir, dir + "/"))
|
|
12
|
+
.replace(/\{pathhref\}/g, "")
|
|
13
|
+
.replace(/\{404status\}/g, "")
|
|
13
14
|
.replace(/\r\n/g, '\n');
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
console.log("\n" + stylize("Less", 'underline') + "\n");
|
|
19
|
+
lessTester.prepBomTest();
|
|
18
20
|
lessTester.runTestSet({strictMath: true, relativeUrls: true, silent: true});
|
|
19
21
|
lessTester.runTestSet({strictMath: true, strictUnits: true}, "errors/",
|
|
20
22
|
lessTester.testErrors, null, getErrorPathReplacementFunction("errors"));
|
|
@@ -32,17 +34,20 @@ lessTester.runTestSet({strictMath: true, strictUnits: true}, "strict-units/");
|
|
|
32
34
|
lessTester.runTestSet({}, "legacy/");
|
|
33
35
|
lessTester.runTestSet({strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/",
|
|
34
36
|
lessTester.testSourcemap, null, null,
|
|
35
|
-
function(filename, type) {
|
|
37
|
+
function(filename, type, baseFolder) {
|
|
36
38
|
if (type === "vars") {
|
|
37
|
-
return path.join(
|
|
39
|
+
return path.join(baseFolder, filename) + '.json';
|
|
38
40
|
}
|
|
39
41
|
return path.join('test/sourcemaps', filename) + '.json';
|
|
40
42
|
});
|
|
43
|
+
lessTester.runTestSet({strictMath: true, strictUnits: true, sourceMap: {sourceMapFileInline: true}}, "sourcemaps-empty/", lessTester.testEmptySourcemap);
|
|
41
44
|
lessTester.runTestSet({globalVars: true, banner: "/**\n * Test\n */\n"}, "globalVars/",
|
|
42
|
-
null, null, null, function(name) { return path.join(
|
|
45
|
+
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; });
|
|
43
46
|
lessTester.runTestSet({modifyVars: true}, "modifyVars/",
|
|
44
|
-
null, null, null, function(name) { return path.join(
|
|
47
|
+
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; });
|
|
45
48
|
lessTester.runTestSet({urlArgs: '424242'}, "url-args/");
|
|
49
|
+
lessTester.runTestSet({paths: ['test/data/', 'test/less/import/']}, "include-path/");
|
|
46
50
|
lessTester.testSyncronous({syncImport: true}, "import");
|
|
47
51
|
lessTester.testSyncronous({syncImport: true}, "css");
|
|
48
52
|
lessTester.testNoOptions();
|
|
53
|
+
lessTester.finished();
|
package/test/less/comments.less
CHANGED
package/test/less/css-3.less
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status} in {path}import-missing.less on line 6, column 1:
|
|
1
|
+
FileError: '{pathhref}file-does-not-exist.less' wasn't found{404status}{node}. Tried - {path}file-does-not-exist.less,{pathrel}file-does-not-exist.less,file-does-not-exist.less{/node} in {path}import-missing.less on line 6, column 1:
|
|
2
2
|
5
|
|
3
3
|
6 @import "file-does-not-exist.less";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
x
|
package/test/less/functions.less
CHANGED
|
@@ -137,6 +137,10 @@
|
|
|
137
137
|
mixt: mix(#ff0000, transparent);
|
|
138
138
|
|
|
139
139
|
.is-a {
|
|
140
|
+
@rules: {
|
|
141
|
+
color: red;
|
|
142
|
+
};
|
|
143
|
+
ruleset: isruleset(@rules);
|
|
140
144
|
color: iscolor(#ddd);
|
|
141
145
|
color1: iscolor(red);
|
|
142
146
|
color2: iscolor(rgb(0, 0, 0));
|
|
@@ -148,6 +152,7 @@
|
|
|
148
152
|
percent: ispercentage(32%);
|
|
149
153
|
em: isem(32em);
|
|
150
154
|
cat: isunit(32cat, cat);
|
|
155
|
+
no-unit-is-empty: isunit(32, '');
|
|
151
156
|
case-insensitive-1: isunit(32CAT, cat);
|
|
152
157
|
case-insensitive-2: isunit(32px, PX);
|
|
153
158
|
}
|
|
@@ -194,3 +199,16 @@
|
|
|
194
199
|
}
|
|
195
200
|
}
|
|
196
201
|
|
|
202
|
+
#list-details {
|
|
203
|
+
@list:
|
|
204
|
+
a 1, // Some comment
|
|
205
|
+
b 2;
|
|
206
|
+
|
|
207
|
+
length: length(@list);
|
|
208
|
+
one: extract(@list, 1);
|
|
209
|
+
@two: extract(@list, 2);
|
|
210
|
+
two: @two;
|
|
211
|
+
two-length: length(@two);
|
|
212
|
+
two-one: extract(@two, 1);
|
|
213
|
+
two-two: extract(@two, 2);
|
|
214
|
+
}
|
|
@@ -48,4 +48,42 @@
|
|
|
48
48
|
@media (max-size: @max-size) {
|
|
49
49
|
color: red;
|
|
50
50
|
}
|
|
51
|
+
}
|
|
52
|
+
//https://github.com/less/less.js/issues/2359
|
|
53
|
+
@supports (something: else) {
|
|
54
|
+
.class {
|
|
55
|
+
something: else;
|
|
56
|
+
}
|
|
57
|
+
.nestedToo {
|
|
58
|
+
.class {
|
|
59
|
+
something: else;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.invisible {
|
|
63
|
+
something: else;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//https://github.com/less/less.js/issues/1979
|
|
67
|
+
.mixin-with-nested-selectors() {
|
|
68
|
+
.test {
|
|
69
|
+
color: red;
|
|
70
|
+
&:first-child {
|
|
71
|
+
color: blue;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.mixin-with-directives(@keyframeName) {
|
|
76
|
+
@keyframes @keyframeName {
|
|
77
|
+
@rules1();
|
|
78
|
+
}
|
|
79
|
+
@supports (animation-name: test) {
|
|
80
|
+
@keyframes @keyframeName {
|
|
81
|
+
@rules2();
|
|
82
|
+
}
|
|
83
|
+
.selector {
|
|
84
|
+
color: red;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
@rules1: {property: value;};
|
|
88
|
+
@rules2: {property: value;};
|
|
51
89
|
}
|
package/test/less/import.less
CHANGED
|
@@ -23,3 +23,31 @@
|
|
|
23
23
|
.mixin !important;
|
|
24
24
|
.mixin(9);
|
|
25
25
|
}
|
|
26
|
+
.size(@aaa: auto) {
|
|
27
|
+
.set-width(@aaa) {
|
|
28
|
+
width: @aaa;
|
|
29
|
+
}
|
|
30
|
+
.set-width(@aaa);
|
|
31
|
+
}
|
|
32
|
+
.when-calling-nested-issue-2394 {
|
|
33
|
+
.size() !important;
|
|
34
|
+
}
|
|
35
|
+
.when-calling-nested-with-param-issue-2394 {
|
|
36
|
+
.size(10px) !important;
|
|
37
|
+
}
|
|
38
|
+
.testMixin-2421 () {
|
|
39
|
+
.topCheck-2421 () {
|
|
40
|
+
.nestedCheck-2421() {
|
|
41
|
+
margin: 5px;
|
|
42
|
+
}
|
|
43
|
+
.nestedCheck-2421();
|
|
44
|
+
}
|
|
45
|
+
.topCheck-2421();
|
|
46
|
+
}
|
|
47
|
+
.class1-2421 {
|
|
48
|
+
.testMixin-2421() !important;
|
|
49
|
+
}
|
|
50
|
+
.class2-2421 {
|
|
51
|
+
.testMixin-2421();
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.gradient-mixin(@color) {
|
|
2
|
+
background: svg-gradient(to bottom,
|
|
3
|
+
fade(@color, 0%) 0%,
|
|
4
|
+
fade(@color, 5%) 60%,
|
|
5
|
+
fade(@color, 10%) 70%,
|
|
6
|
+
fade(@color, 15%) 73%,
|
|
7
|
+
fade(@color, 20%) 75%,
|
|
8
|
+
fade(@color, 25%) 80%,
|
|
9
|
+
fade(@color, 30%) 85%,
|
|
10
|
+
fade(@color, 35%) 88%,
|
|
11
|
+
fade(@color, 40%) 90%,
|
|
12
|
+
fade(@color, 45%) 95%,
|
|
13
|
+
fade(@color, 50%) 100%
|
|
14
|
+
);
|
|
15
|
+
}
|
package/test/less/selectors.less
CHANGED
|
@@ -117,13 +117,13 @@ a {
|
|
|
117
117
|
color: green;
|
|
118
118
|
}
|
|
119
119
|
.red {
|
|
120
|
-
#@{theme}.@{theme}&.black {
|
|
120
|
+
#@{theme}.@{theme}&.black:@{theme} {
|
|
121
121
|
color:black;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
@num: 3;
|
|
125
125
|
:nth-child(@{num}) {
|
|
126
|
-
|
|
126
|
+
selector: interpolated;
|
|
127
127
|
}
|
|
128
128
|
.test {
|
|
129
129
|
&:nth-child(@{num}) {
|
|
@@ -132,7 +132,7 @@ a {
|
|
|
132
132
|
&:nth-child(odd):not(:nth-child(3)) {
|
|
133
133
|
color: #ff0000;
|
|
134
134
|
}
|
|
135
|
-
}
|
|
135
|
+
}
|
|
136
136
|
[prop],
|
|
137
137
|
[prop=10%],
|
|
138
138
|
[prop="value@{num}"],
|
|
@@ -156,4 +156,29 @@ blank blank blank blank blank blank blank blank blank blank blank blank blank bl
|
|
|
156
156
|
*/
|
|
157
157
|
@{selector} {
|
|
158
158
|
color: red;
|
|
159
|
-
}
|
|
159
|
+
}
|
|
160
|
+
.only-nested {
|
|
161
|
+
.level2 {
|
|
162
|
+
.foo:not(.tst&:hover) {
|
|
163
|
+
test: only-nested;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
.nestend-and-non-nested {
|
|
168
|
+
.foo&:not(.tst&:hover) {
|
|
169
|
+
test: nestend-and-non-nested;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
.selector:not(&:hover) {
|
|
173
|
+
test: global scope;
|
|
174
|
+
}
|
|
175
|
+
// https://github.com/less/less.js/issues/2206
|
|
176
|
+
.extend-this {
|
|
177
|
+
content: '\2661';
|
|
178
|
+
}
|
|
179
|
+
.first-level {
|
|
180
|
+
.second-level {
|
|
181
|
+
.active&:extend(.extend-this) { }
|
|
182
|
+
&.active2:extend(.extend-this) { }
|
|
183
|
+
}
|
|
184
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@test-var: 'something';
|
package/test/less/urls.less
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "nested-gradient-with-svg-gradient/mixin-consumer.less";
|
|
2
|
+
|
|
1
3
|
@font-face {
|
|
2
4
|
src: url("/fonts/garamond-pro.ttf");
|
|
3
5
|
src: local(Futura-Medium),
|
|
@@ -43,6 +45,9 @@
|
|
|
43
45
|
|
|
44
46
|
#data-uri {
|
|
45
47
|
uri: data-uri('image/jpeg;base64', '../data/image.jpg');
|
|
48
|
+
@var: replace('../data/replace.jpg', "replace", "image");
|
|
49
|
+
background-image: data-uri(@var), data-uri(replace('../data/image.filext', "filext", "jpg"));
|
|
50
|
+
|
|
46
51
|
uri-fragment: data-uri('image/jpeg;base64', '../data/image.jpg#fragment');
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -55,8 +60,12 @@
|
|
|
55
60
|
uri-2: data-uri('../data/page.html');
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
#
|
|
63
|
+
#file-functions {
|
|
59
64
|
uri: data-uri('../data/data-uri-fail.png');
|
|
65
|
+
svg-not-base-64: data-uri('../data/image.svg');
|
|
66
|
+
size: image-size('../data/data-uri-fail.png');
|
|
67
|
+
width: image-width('../data/data-uri-fail.png');
|
|
68
|
+
height: image-height('../data/data-uri-fail.png');
|
|
60
69
|
}
|
|
61
70
|
.add_an_import(@file_to_import) {
|
|
62
71
|
@import "@{file_to_import}";
|
package/test/less/variables.less
CHANGED
|
@@ -51,9 +51,23 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.variable-names {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
.quoted {
|
|
55
|
+
@var: 'hello';
|
|
56
|
+
@name: 'var';
|
|
57
|
+
name: @@name;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.unquoted {
|
|
61
|
+
@var: 'hello';
|
|
62
|
+
@name: var;
|
|
63
|
+
name: @@name;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.color-keyword {
|
|
67
|
+
@red: 'hello';
|
|
68
|
+
@name: red;
|
|
69
|
+
name: @@name;
|
|
70
|
+
}
|
|
57
71
|
}
|
|
58
72
|
|
|
59
73
|
.alpha {
|