less 2.3.3 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +5 -0
- data/less.gemspec +1 -1
- data/lib/less/js/.gitattributes +9 -0
- data/lib/less/js/.gitignore +1 -0
- data/lib/less/js/.npmignore +1 -1
- data/lib/less/js/CHANGELOG.md +68 -0
- data/lib/less/js/CONTRIBUTING.md +33 -34
- data/lib/less/js/Makefile +24 -9
- data/lib/less/js/README.md +2 -2
- data/lib/less/js/bin/lessc +102 -25
- data/lib/less/js/build/amd.js +1 -1
- data/lib/less/js/build/header.js +9 -7
- data/lib/less/js/dist/less-1.3.3.js +2 -2
- data/lib/less/js/dist/less-1.3.3.min.js +2 -2
- data/lib/less/js/dist/less-1.4.0-beta.js +5830 -0
- data/lib/less/js/dist/less-1.4.0-beta.min.js +11 -0
- data/lib/less/js/dist/less-1.4.0.js +5830 -0
- data/lib/less/js/dist/less-1.4.0.min.js +11 -0
- data/lib/less/js/dist/less-1.4.1.js +5837 -0
- data/lib/less/js/dist/less-1.4.1.min.js +11 -0
- data/lib/less/js/dist/less-1.4.2.js +5837 -0
- data/lib/less/js/dist/less-1.4.2.min.js +11 -0
- data/lib/less/js/dist/less-rhino-1.4.0.js +4273 -0
- data/lib/less/js/lib/less/browser.js +131 -101
- data/lib/less/js/lib/less/env.js +105 -0
- data/lib/less/js/lib/less/extend-visitor.js +391 -0
- data/lib/less/js/lib/less/functions.js +174 -19
- data/lib/less/js/lib/less/import-visitor.js +107 -0
- data/lib/less/js/lib/less/index.js +70 -63
- data/lib/less/js/lib/less/join-selector-visitor.js +37 -0
- data/lib/less/js/lib/less/lessc_helper.js +13 -4
- data/lib/less/js/lib/less/parser.js +353 -264
- data/lib/less/js/lib/less/rhino.js +5 -2
- data/lib/less/js/lib/less/tree.js +1 -1
- data/lib/less/js/lib/less/tree/alpha.js +7 -3
- data/lib/less/js/lib/less/tree/anonymous.js +1 -0
- data/lib/less/js/lib/less/tree/assignment.js +4 -0
- data/lib/less/js/lib/less/tree/call.js +14 -8
- data/lib/less/js/lib/less/tree/color.js +50 -5
- data/lib/less/js/lib/less/tree/comment.js +1 -0
- data/lib/less/js/lib/less/tree/condition.js +35 -28
- data/lib/less/js/lib/less/tree/dimension.js +270 -16
- data/lib/less/js/lib/less/tree/directive.js +7 -2
- data/lib/less/js/lib/less/tree/element.js +57 -21
- data/lib/less/js/lib/less/tree/expression.js +29 -4
- data/lib/less/js/lib/less/tree/extend.js +43 -0
- data/lib/less/js/lib/less/tree/import.js +49 -28
- data/lib/less/js/lib/less/tree/javascript.js +1 -0
- data/lib/less/js/lib/less/tree/keyword.js +3 -2
- data/lib/less/js/lib/less/tree/media.js +20 -4
- data/lib/less/js/lib/less/tree/mixin.js +38 -18
- data/lib/less/js/lib/less/tree/negative.js +22 -0
- data/lib/less/js/lib/less/tree/operation.js +32 -17
- data/lib/less/js/lib/less/tree/paren.js +5 -1
- data/lib/less/js/lib/less/tree/quoted.js +5 -3
- data/lib/less/js/lib/less/tree/rule.js +44 -31
- data/lib/less/js/lib/less/tree/ruleset.js +50 -23
- data/lib/less/js/lib/less/tree/selector.js +49 -39
- data/lib/less/js/lib/less/tree/unicode-descriptor.js +1 -0
- data/lib/less/js/lib/less/tree/url.js +9 -5
- data/lib/less/js/lib/less/tree/value.js +4 -1
- data/lib/less/js/lib/less/tree/variable.js +4 -3
- data/lib/less/js/lib/less/visitor.js +54 -0
- data/lib/less/js/package.json +69 -19
- data/lib/less/js/test/browser-test-prepare.js +23 -6
- data/lib/less/js/test/browser/common.js +55 -3
- data/lib/less/js/test/browser/css/urls.css +13 -0
- data/lib/less/js/test/browser/less/relative-urls/urls.less +1 -1
- data/lib/less/js/test/browser/less/urls.less +16 -0
- data/lib/less/js/test/browser/phantom-runner.js +7 -5
- data/lib/less/js/test/browser/runner-browser.js +5 -1
- data/lib/less/js/test/browser/runner-errors.js +5 -0
- data/lib/less/js/test/browser/runner-legacy.js +6 -0
- data/lib/less/js/test/browser/runner-production.js +7 -0
- data/lib/less/js/test/browser/template.htm +6 -6
- data/lib/less/js/test/css/comments.css +1 -0
- data/lib/less/js/test/css/compression/compression.css +2 -0
- data/lib/less/js/test/css/css-3.css +4 -0
- data/lib/less/js/test/css/css.css +9 -3
- data/lib/less/js/test/css/extend-chaining.css +72 -0
- data/lib/less/js/test/css/extend-clearfix.css +19 -0
- data/lib/less/js/test/css/extend-exact.css +37 -0
- data/lib/less/js/test/css/extend-media.css +24 -0
- data/lib/less/js/test/css/extend-nest.css +57 -0
- data/lib/less/js/test/css/extend-selector.css +72 -0
- data/lib/less/js/test/css/extend.css +76 -0
- data/lib/less/js/test/css/functions.css +28 -0
- data/lib/less/js/test/css/import-interpolation.css +6 -0
- data/lib/less/js/test/css/import.css +18 -1
- data/lib/less/js/test/css/legacy/legacy.css +7 -0
- data/lib/less/js/test/css/media.css +9 -1
- data/lib/less/js/test/css/mixins-args.css +18 -0
- data/lib/less/js/test/css/mixins-guards.css +5 -0
- data/lib/less/js/test/css/parens.css +18 -5
- data/lib/less/js/test/css/selectors.css +14 -6
- data/lib/less/js/test/css/urls.css +17 -0
- data/lib/less/js/test/css/variables.css +22 -3
- data/lib/less/js/test/data/data-uri-fail.png +0 -0
- data/lib/less/js/test/data/image.jpg +0 -0
- data/lib/less/js/test/data/page.html +1 -0
- data/lib/less/js/test/less-test.js +41 -9
- data/lib/less/js/test/less/colors.less +4 -4
- data/lib/less/js/test/less/comments.less +2 -2
- data/lib/less/js/test/less/compression/compression.less +16 -0
- data/lib/less/js/test/less/css-3.less +5 -1
- data/lib/less/js/test/less/css.less +9 -3
- data/lib/less/js/test/less/errors/add-mixed-units.less +3 -0
- data/lib/less/js/test/less/errors/add-mixed-units.txt +2 -0
- data/lib/less/js/test/less/errors/add-mixed-units2.less +3 -0
- data/lib/less/js/test/less/errors/add-mixed-units2.txt +2 -0
- data/lib/less/js/test/less/errors/bad-variable-declaration1.txt +1 -1
- data/lib/less/js/test/less/errors/color-operation-error.less +3 -0
- data/lib/less/js/test/less/errors/color-operation-error.txt +2 -0
- data/lib/less/js/test/less/errors/comment-in-selector.txt +1 -1
- data/lib/less/js/test/less/errors/divide-mixed-units.less +3 -0
- data/lib/less/js/test/less/errors/divide-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/extend-no-selector.less +3 -0
- data/lib/less/js/test/less/errors/extend-no-selector.txt +3 -0
- data/lib/less/js/test/less/errors/extend-not-at-end.less +3 -0
- data/lib/less/js/test/less/errors/extend-not-at-end.txt +3 -0
- data/lib/less/js/test/less/errors/import-missing.less +5 -0
- data/lib/less/js/test/less/errors/import-missing.txt +3 -3
- data/lib/less/js/test/less/errors/import-no-semi.txt +1 -1
- data/lib/less/js/test/less/errors/import-subfolder1.txt +1 -1
- data/lib/less/js/test/less/errors/import-subfolder2.txt +1 -1
- data/lib/less/js/test/less/errors/javascript-error.txt +1 -1
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.txt +1 -1
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.txt +1 -1
- data/lib/less/js/test/less/errors/mixin-not-defined.txt +1 -1
- data/lib/less/js/test/less/errors/mixin-not-matched.txt +1 -1
- data/lib/less/js/test/less/errors/mixin-not-matched2.txt +1 -1
- data/lib/less/js/test/less/errors/multiply-mixed-units.less +7 -0
- data/lib/less/js/test/less/errors/multiply-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-1.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-1.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-2.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-2.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-3.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-3.txt +4 -0
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +1 -1
- data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +2 -1
- data/lib/less/js/test/less/errors/parse-error-with-import.txt +1 -1
- data/lib/less/js/test/less/errors/property-ie5-hack.txt +1 -1
- data/lib/less/js/test/less/errors/property-in-root.less +4 -0
- data/lib/less/js/test/less/errors/property-in-root.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root2.less +1 -0
- data/lib/less/js/test/less/errors/property-in-root2.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root3.less +4 -0
- data/lib/less/js/test/less/errors/property-in-root3.txt +3 -0
- data/lib/less/js/test/less/errors/recursive-variable.txt +1 -1
- data/lib/less/js/test/less/extend-chaining.less +79 -0
- data/lib/less/js/test/less/extend-clearfix.less +19 -0
- data/lib/less/js/test/less/extend-exact.less +46 -0
- data/lib/less/js/test/less/extend-media.less +24 -0
- data/lib/less/js/test/less/extend-nest.less +65 -0
- data/lib/less/js/test/less/extend-selector.less +84 -0
- data/lib/less/js/test/less/extend.less +81 -0
- data/lib/less/js/test/less/functions.less +37 -6
- data/lib/less/js/test/less/import-interpolation.less +8 -0
- data/lib/less/js/test/less/import-once.less +4 -4
- data/lib/less/js/test/less/import.less +11 -2
- data/lib/less/js/test/less/import/deeper/import-once-test-a.less +1 -1
- data/lib/less/js/test/less/import/import-interpolation.less +1 -0
- data/lib/less/js/test/less/import/import-interpolation2.less +5 -0
- data/lib/less/js/test/less/javascript.less +1 -1
- data/lib/less/js/test/less/legacy/legacy.less +7 -0
- data/lib/less/js/test/less/media.less +14 -3
- data/lib/less/js/test/less/mixins-args.less +43 -5
- data/lib/less/js/test/less/mixins-guards.less +13 -0
- data/lib/less/js/test/less/mixins-named-args.less +5 -5
- data/lib/less/js/test/less/mixins-nested.less +2 -2
- data/lib/less/js/test/less/mixins-pattern.less +1 -1
- data/lib/less/js/test/less/mixins.less +1 -1
- data/lib/less/js/test/less/operations.less +27 -27
- data/lib/less/js/test/less/parens.less +20 -5
- data/lib/less/js/test/less/selectors.less +14 -7
- data/lib/less/js/test/less/urls.less +24 -0
- data/lib/less/js/test/less/variables.less +42 -12
- data/lib/less/loader.rb +33 -0
- data/lib/less/version.rb +1 -1
- data/spec/less/parser_spec.rb +5 -5
- metadata +76 -6
- data/lib/less/js/build/ecma-5.js +0 -120
- data/lib/less/js/lib/less/tree/ratio.js +0 -13
@@ -13,6 +13,7 @@
|
|
13
13
|
saturate: #203c31;
|
14
14
|
desaturate: #29332f;
|
15
15
|
greyscale: #2e2e2e;
|
16
|
+
hsl-clamp: #ffffff;
|
16
17
|
spin-p: #bf6a40;
|
17
18
|
spin-n: #bf4055;
|
18
19
|
luma-white: 100%;
|
@@ -34,10 +35,15 @@
|
|
34
35
|
contrast-cyan: #000000;
|
35
36
|
contrast-light: #111111;
|
36
37
|
contrast-dark: #eeeeee;
|
38
|
+
contrast-wrongorder: #111111;
|
37
39
|
contrast-light-thresh: #111111;
|
38
40
|
contrast-dark-thresh: #eeeeee;
|
39
41
|
contrast-high-thresh: #eeeeee;
|
40
42
|
contrast-low-thresh: #111111;
|
43
|
+
contrast-light-thresh-per: #111111;
|
44
|
+
contrast-dark-thresh-per: #eeeeee;
|
45
|
+
contrast-high-thresh-per: #eeeeee;
|
46
|
+
contrast-low-thresh-per: #111111;
|
41
47
|
format: "rgb(32, 128, 64)";
|
42
48
|
format-string: "hello world";
|
43
49
|
format-multiple: "hello earth 2";
|
@@ -48,6 +54,9 @@
|
|
48
54
|
hue: 98;
|
49
55
|
saturation: 12%;
|
50
56
|
lightness: 95%;
|
57
|
+
hsvhue: 98;
|
58
|
+
hsvsaturation: 12%;
|
59
|
+
hsvvalue: 95%;
|
51
60
|
red: 255;
|
52
61
|
green: 255;
|
53
62
|
blue: 255;
|
@@ -58,6 +67,19 @@
|
|
58
67
|
rounded-percentage: 10%;
|
59
68
|
ceil: 11px;
|
60
69
|
floor: 12px;
|
70
|
+
sqrt: 5px;
|
71
|
+
pi: 3.141592653589793;
|
72
|
+
mod: 2m;
|
73
|
+
abs: 4%;
|
74
|
+
tan: 0.9004040442978399;
|
75
|
+
sin: 0.17364817766693033;
|
76
|
+
cos: 0.8438539587324921;
|
77
|
+
atan: 0.1rad;
|
78
|
+
atan: 34.00000000000001deg;
|
79
|
+
atan: 45.00000000000001deg;
|
80
|
+
pow: 64px;
|
81
|
+
pow: 64;
|
82
|
+
pow: 27;
|
61
83
|
percentage: 20%;
|
62
84
|
color: #ff0011;
|
63
85
|
tint: #898989;
|
@@ -66,6 +88,8 @@
|
|
66
88
|
shade: #686868;
|
67
89
|
shade-full: #000000;
|
68
90
|
shade-percent: #686868;
|
91
|
+
fade-out: rgba(255, 0, 0, 0.95);
|
92
|
+
fade-in: rgba(255, 0, 0, 0.9500000000000001);
|
69
93
|
hsv: #4d2926;
|
70
94
|
hsva: rgba(77, 40, 38, 0.2);
|
71
95
|
mix: #ff3300;
|
@@ -83,6 +107,7 @@
|
|
83
107
|
pixel: true;
|
84
108
|
percent: true;
|
85
109
|
em: true;
|
110
|
+
cat: true;
|
86
111
|
}
|
87
112
|
#alpha {
|
88
113
|
alpha: rgba(153, 94, 51, 0.6);
|
@@ -98,3 +123,6 @@
|
|
98
123
|
average: #7b007b;
|
99
124
|
negation: #d73131;
|
100
125
|
}
|
126
|
+
#extract {
|
127
|
+
result: 3 2 1 C B A;
|
128
|
+
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
|
2
2
|
|
3
|
-
@import url(something.css) screen and (color) and (max-width: 600px);
|
3
|
+
@import url(/absolute/something.css) screen and (color) and (max-width: 600px);
|
4
|
+
|
5
|
+
@import url("//ha.com/file.css") (min-width: 100px);
|
4
6
|
#import-test {
|
5
7
|
height: 10px;
|
6
8
|
color: #ff0000;
|
@@ -19,3 +21,18 @@
|
|
19
21
|
height: 10px;
|
20
22
|
color: #ff0000;
|
21
23
|
}
|
24
|
+
@media screen and (max-width: 601px) {
|
25
|
+
#css {
|
26
|
+
color: yellow;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
@media screen and (max-width: 602px) {
|
30
|
+
body {
|
31
|
+
width: 100%;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
@media screen and (max-width: 603px) {
|
35
|
+
#css {
|
36
|
+
color: yellow;
|
37
|
+
}
|
38
|
+
}
|
@@ -15,7 +15,7 @@
|
|
15
15
|
max-width: 480;
|
16
16
|
}
|
17
17
|
}
|
18
|
-
@media all and (device-aspect-ratio: 16/9) {
|
18
|
+
@media all and (device-aspect-ratio: 16 / 9) {
|
19
19
|
body {
|
20
20
|
max-width: 800px;
|
21
21
|
}
|
@@ -193,3 +193,11 @@ body {
|
|
193
193
|
background: green;
|
194
194
|
}
|
195
195
|
}
|
196
|
+
@media (max-width: 1200px) {
|
197
|
+
/* a comment */
|
198
|
+
}
|
199
|
+
@media (max-width: 1200px) and (max-width: 900px) {
|
200
|
+
body {
|
201
|
+
font-size: 11px;
|
202
|
+
}
|
203
|
+
}
|
@@ -72,6 +72,11 @@ body {
|
|
72
72
|
border: "{";
|
73
73
|
width: "{";
|
74
74
|
}
|
75
|
+
.slash-vs-math {
|
76
|
+
border-radius: 2px/5px;
|
77
|
+
border-radius: 5px/10px;
|
78
|
+
border-radius: 6px;
|
79
|
+
}
|
75
80
|
.comma-vs-semi-colon {
|
76
81
|
one: a;
|
77
82
|
two: b, c;
|
@@ -93,3 +98,16 @@ body {
|
|
93
98
|
four: a, 11, 12, 13;
|
94
99
|
four: a, 21, 22, 23;
|
95
100
|
}
|
101
|
+
.test-mixin-default-arg {
|
102
|
+
defaults: 1px 1px 1px;
|
103
|
+
defaults: 2px 2px 2px;
|
104
|
+
}
|
105
|
+
.selector {
|
106
|
+
margin: 2, 2, 2, 2;
|
107
|
+
}
|
108
|
+
.selector2 {
|
109
|
+
margin: 2, 2, 2, 2;
|
110
|
+
}
|
111
|
+
.selector3 {
|
112
|
+
margin: 4;
|
113
|
+
}
|
@@ -6,13 +6,26 @@
|
|
6
6
|
}
|
7
7
|
.more-parens {
|
8
8
|
padding: 8 4 4 4px;
|
9
|
-
width: 96;
|
10
|
-
|
11
|
-
|
9
|
+
width-all: 96;
|
10
|
+
width-first: 16 * 6;
|
11
|
+
width-keep: (4 * 4) * 6;
|
12
|
+
height-keep: (7 * 7) + (8 * 8);
|
13
|
+
height-all: 113;
|
14
|
+
height-parts: 49 + 64;
|
15
|
+
margin-keep: (4 * (5 + 5) / 2) - (4 * 2);
|
16
|
+
margin-parts: 20 - 8;
|
17
|
+
margin-all: 12;
|
18
|
+
border-radius-keep: 4px * (1 + 1) / 4 + 3px;
|
19
|
+
border-radius-parts: 8px / 7px;
|
20
|
+
border-radius-all: 5px;
|
21
|
+
}
|
22
|
+
.negative {
|
23
|
+
neg-var: -1;
|
24
|
+
neg-var-paren: -(1);
|
12
25
|
}
|
13
26
|
.nested-parens {
|
14
|
-
width:
|
15
|
-
height:
|
27
|
+
width: 2 * (4 * (2 + (1 + 6))) - 1;
|
28
|
+
height: ((2 + 3) * (2 + 3) / (9 - 4)) + 1;
|
16
29
|
}
|
17
30
|
.mixed-units {
|
18
31
|
margin: 2px 4em 1 5pc;
|
@@ -116,18 +116,26 @@ p a span {
|
|
116
116
|
.blood {
|
117
117
|
color: red;
|
118
118
|
}
|
119
|
-
.blood {
|
120
|
-
color: red;
|
121
|
-
}
|
122
119
|
.bloodred {
|
123
120
|
color: green;
|
124
121
|
}
|
125
122
|
#blood.blood.red.black {
|
126
123
|
color: black;
|
127
124
|
}
|
128
|
-
:nth-child(3)
|
129
|
-
|
125
|
+
:nth-child(3) {
|
126
|
+
selector: interpolated;
|
130
127
|
}
|
131
|
-
.test:nth-child(odd):not(
|
128
|
+
.test:nth-child(odd):not(:nth-child(3)) {
|
132
129
|
color: #ff0000;
|
133
130
|
}
|
131
|
+
[prop],
|
132
|
+
[prop="value3"],
|
133
|
+
[prop*="val3"],
|
134
|
+
[|prop~="val3"],
|
135
|
+
[*|prop$="val3"],
|
136
|
+
[ns|prop^="val3"],
|
137
|
+
[3^="val3"],
|
138
|
+
[3=3],
|
139
|
+
[3] {
|
140
|
+
attributes: yes;
|
141
|
+
}
|
@@ -1,12 +1,16 @@
|
|
1
1
|
@import "import/../css/background.css";
|
2
2
|
|
3
3
|
@import "import/import-test-d.css";
|
4
|
+
|
5
|
+
@import "file.css";
|
4
6
|
@font-face {
|
5
7
|
src: url("/fonts/garamond-pro.ttf");
|
6
8
|
src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg");
|
7
9
|
}
|
8
10
|
#shorthands {
|
9
11
|
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
12
|
+
background: url("img.jpg") center / 100px;
|
13
|
+
background: #ffffff url(image.png) center / 1px 100px repeat-x scroll content-box padding-box;
|
10
14
|
}
|
11
15
|
#misc {
|
12
16
|
background-image: url(images/image.jpg);
|
@@ -40,3 +44,16 @@
|
|
40
44
|
#secret {
|
41
45
|
font-family: xecret, sans-serif;
|
42
46
|
}
|
47
|
+
#data-uri {
|
48
|
+
uri: url('data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==');
|
49
|
+
}
|
50
|
+
#data-uri-guess {
|
51
|
+
uri: url('data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==');
|
52
|
+
}
|
53
|
+
#data-uri-ascii {
|
54
|
+
uri-1: url('data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A');
|
55
|
+
uri-2: url('data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A');
|
56
|
+
}
|
57
|
+
#data-uri-toobig {
|
58
|
+
uri: url('../data/data-uri-fail.png');
|
59
|
+
}
|
@@ -7,10 +7,14 @@
|
|
7
7
|
font-family: "Trebuchet MS", Verdana, sans-serif;
|
8
8
|
quotes: "~" "~";
|
9
9
|
}
|
10
|
-
.
|
10
|
+
.redef {
|
11
|
+
zero: 0;
|
12
|
+
}
|
13
|
+
.redef .inition {
|
11
14
|
three: 3;
|
12
15
|
}
|
13
16
|
.values {
|
17
|
+
minus-one: -1;
|
14
18
|
font-family: 'Trebuchet', 'Trebuchet', 'Trebuchet';
|
15
19
|
color: #888888 !important;
|
16
20
|
multi: something 'A', B, C, 'Trebuchet';
|
@@ -21,6 +25,21 @@
|
|
21
25
|
.alpha {
|
22
26
|
filter: alpha(opacity=42);
|
23
27
|
}
|
24
|
-
|
25
|
-
|
28
|
+
.testPollution {
|
29
|
+
a: 'no-pollution';
|
30
|
+
}
|
31
|
+
.units {
|
32
|
+
width: 1px;
|
33
|
+
same-unit-as-previously: 1px;
|
34
|
+
square-pixel-divided: 1px;
|
35
|
+
odd-unit: 2;
|
36
|
+
percentage: 500%;
|
37
|
+
pixels: 500px;
|
38
|
+
conversion-metric-a: 30mm;
|
39
|
+
conversion-metric-b: 3cm;
|
40
|
+
conversion-imperial: 3in;
|
41
|
+
custom-unit: 420octocats;
|
42
|
+
custom-unit-cancelling: 18dogs;
|
43
|
+
mix-units: 2px;
|
44
|
+
invalid-units: 1px;
|
26
45
|
}
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>This page is 100% Awesome.</h1>
|
@@ -5,6 +5,8 @@ var path = require('path'),
|
|
5
5
|
var less = require('../lib/less');
|
6
6
|
var stylize = require('../lib/less/lessc_helper').stylize;
|
7
7
|
|
8
|
+
var globals = Object.keys(global);
|
9
|
+
|
8
10
|
var oneTestOnly = process.argv[2];
|
9
11
|
|
10
12
|
var totalTests = 0,
|
@@ -23,9 +25,9 @@ less.tree.functions._color = function (str) {
|
|
23
25
|
|
24
26
|
sys.puts("\n" + stylize("LESS", 'underline') + "\n");
|
25
27
|
|
26
|
-
runTestSet({relativeUrls: true});
|
28
|
+
runTestSet({strictMath: true, relativeUrls: true, silent: true});
|
27
29
|
|
28
|
-
runTestSet(
|
30
|
+
runTestSet({strictMath: true, strictUnits: true}, "errors/", function(name, err, compiledLess, doReplacements) {
|
29
31
|
fs.readFile(path.join('test/less/', name) + '.txt', 'utf8', function (e, expectedErr) {
|
30
32
|
sys.print("- " + name + ": ");
|
31
33
|
expectedErr = doReplacements(expectedErr, 'test/less/errors/');
|
@@ -48,22 +50,27 @@ runTestSet(null, "errors/", function(name, err, compiledLess, doReplacements) {
|
|
48
50
|
return input.replace(
|
49
51
|
"{path}", path.join(process.cwd(), "/test/less/errors/"))
|
50
52
|
.replace("{pathrel}", path.join("test", "less", "errors/"))
|
53
|
+
.replace("{pathhref}", "")
|
54
|
+
.replace("{404status}", "")
|
51
55
|
.replace(/\r\n/g, '\n');
|
52
56
|
});
|
53
57
|
|
54
|
-
runTestSet({dumpLineNumbers: 'comments'}, "debug/", null,
|
58
|
+
runTestSet({strictMath: true, dumpLineNumbers: 'comments'}, "debug/", null,
|
55
59
|
function(name) { return name + '-comments'; });
|
56
|
-
runTestSet({dumpLineNumbers: 'mediaquery'}, "debug/", null,
|
60
|
+
runTestSet({strictMath: true, dumpLineNumbers: 'mediaquery'}, "debug/", null,
|
57
61
|
function(name) { return name + '-mediaquery'; });
|
58
|
-
runTestSet({dumpLineNumbers: 'all'}, "debug/", null,
|
62
|
+
runTestSet({strictMath: true, dumpLineNumbers: 'all'}, "debug/", null,
|
59
63
|
function(name) { return name + '-all'; });
|
60
|
-
runTestSet({relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/");
|
64
|
+
runTestSet({strictMath: true, relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/");
|
65
|
+
runTestSet({strictMath: true, compress: true}, "compression/");
|
66
|
+
runTestSet({ }, "legacy/");
|
67
|
+
testNoOptions();
|
61
68
|
|
62
69
|
function globalReplacements(input, directory) {
|
63
70
|
var p = path.join(process.cwd(), directory),
|
64
71
|
pathimport = path.join(process.cwd(), directory + "import/"),
|
65
|
-
pathesc = p.replace(/[
|
66
|
-
pathimportesc = pathimport.replace(/[
|
72
|
+
pathesc = p.replace(/[.:/\\]/g, function(a) { return '\\' + (a=='\\' ? '\/' : a); }),
|
73
|
+
pathimportesc = pathimport.replace(/[.:/\\]/g, function(a) { return '\\' + (a=='\\' ? '\/' : a); });
|
67
74
|
|
68
75
|
return input.replace(/\{path\}/g, p)
|
69
76
|
.replace(/\{pathesc\}/g, pathesc)
|
@@ -72,6 +79,12 @@ function globalReplacements(input, directory) {
|
|
72
79
|
.replace(/\r\n/g, '\n');
|
73
80
|
}
|
74
81
|
|
82
|
+
function checkGlobalLeaks() {
|
83
|
+
return Object.keys(global).filter(function(v) {
|
84
|
+
return globals.indexOf(v) < 0;
|
85
|
+
});
|
86
|
+
}
|
87
|
+
|
75
88
|
function runTestSet(options, foldername, verifyFunction, nameModifier, doReplacements) {
|
76
89
|
foldername = foldername || "";
|
77
90
|
|
@@ -142,6 +155,7 @@ function ok(msg) {
|
|
142
155
|
}
|
143
156
|
|
144
157
|
function endTest() {
|
158
|
+
var leaked = checkGlobalLeaks();
|
145
159
|
if (failedTests + passedTests === totalTests) {
|
146
160
|
sys.puts("");
|
147
161
|
sys.puts("");
|
@@ -153,6 +167,12 @@ function endTest() {
|
|
153
167
|
sys.print(stylize("All Passed ", "green"));
|
154
168
|
sys.print(passedTests + " run");
|
155
169
|
}
|
170
|
+
if (leaked.length > 0) {
|
171
|
+
sys.puts("");
|
172
|
+
sys.puts("");
|
173
|
+
sys.print(stylize("Global leak detected: ", "red") + leaked.join(', '));
|
174
|
+
sys.print("\n");
|
175
|
+
}
|
156
176
|
}
|
157
177
|
}
|
158
178
|
|
@@ -171,7 +191,7 @@ function toCSS(options, path, callback) {
|
|
171
191
|
callback(err);
|
172
192
|
} else {
|
173
193
|
try {
|
174
|
-
css = tree.toCSS();
|
194
|
+
css = tree.toCSS(options);
|
175
195
|
callback(null, css);
|
176
196
|
} catch (e) {
|
177
197
|
callback(e);
|
@@ -180,3 +200,15 @@ function toCSS(options, path, callback) {
|
|
180
200
|
});
|
181
201
|
});
|
182
202
|
}
|
203
|
+
|
204
|
+
function testNoOptions() {
|
205
|
+
totalTests++;
|
206
|
+
try {
|
207
|
+
sys.print("- Integration - creating parser without options: ");
|
208
|
+
new(less.Parser);
|
209
|
+
} catch(e) {
|
210
|
+
fail(stylize("FAIL\n", "red"));
|
211
|
+
return;
|
212
|
+
}
|
213
|
+
ok(stylize("OK\n", "green"));
|
214
|
+
}
|
@@ -33,10 +33,10 @@
|
|
33
33
|
}
|
34
34
|
|
35
35
|
#overflow {
|
36
|
-
.a { color: #111111 - #444444; } // #000000
|
37
|
-
.b { color: #eee + #fff; } // #ffffff
|
38
|
-
.c { color: #aaa * 3; } // #ffffff
|
39
|
-
.d { color: #00ee00 + #009900; } // #00ff00
|
36
|
+
.a { color: (#111111 - #444444); } // #000000
|
37
|
+
.b { color: (#eee + #fff); } // #ffffff
|
38
|
+
.c { color: (#aaa * 3); } // #ffffff
|
39
|
+
.d { color: (#00ee00 + #009900); } // #00ff00
|
40
40
|
}
|
41
41
|
|
42
42
|
#grey {
|