@less/test-data 4.8.1 → 4.9.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/package.json +1 -1
- package/tests-config/js-type-errors/js-type-error.txt +1 -1
- package/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.css +8 -0
- package/tests-config/rootpath-escape-interpolation/rootpath-escape-interpolation.less +24 -0
- package/tests-config/rootpath-escape-interpolation/styles.config.cjs +8 -0
- package/tests-config/sourcemaps/styles.config.cjs +1 -1
- package/tests-config/sourcemaps/url-interpolation/styles.config.cjs +9 -0
- package/tests-config/sourcemaps/url-interpolation/url-interpolation.css +13 -0
- package/tests-config/sourcemaps/url-interpolation/url-interpolation.less +24 -0
- package/tests-config/sourcemaps-variable-selector/styles.config.cjs +1 -1
- package/tests-error/eval/property-undefined.txt +0 -1
- package/tests-error/eval/recursive-property.txt +0 -1
- package/tests-error/parse/property-interpolation-lookup.less +8 -0
- package/tests-error/parse/property-interpolation-lookup.txt +4 -0
- package/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.css +38 -0
- package/tests-unit/at-rule-variable-deprecated/at-rule-variable-deprecated.less +70 -0
- package/tests-unit/functions/functions.css +2 -0
- package/tests-unit/functions/functions.less +3 -0
- package/tests-unit/lookup-interpolation/lookup-interpolation.css +60 -0
- package/tests-unit/lookup-interpolation/lookup-interpolation.less +127 -0
- package/tests-unit/media-nested-type/media-nested-type.css +40 -0
- package/tests-unit/media-nested-type/media-nested-type.less +51 -0
- package/tests-config/js-type-errors/js-type-error-2.txt +0 -4
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read
|
|
1
|
+
SyntaxError: JavaScript evaluation error: 'TypeError: Cannot read properties of undefined (reading 'toJS')' in {path}js-type-error.less on line 2, column 8:
|
|
2
2
|
1 .scope {
|
|
3
3
|
2 var: `this.foo.toJS`;
|
|
4
4
|
3 }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#rootpath-escape-interpolation {
|
|
2
|
+
plain-unquoted: url(http://example.com/a\(b\)\ c/relative/path);
|
|
3
|
+
interp-unquoted: url(http://example.com/a\(b\)\ c/images/path);
|
|
4
|
+
lookup-unquoted: url(http://example.com/a\(b\)\ c/images/path);
|
|
5
|
+
plain-quoted: url("http://example.com/a(b) c/relative/path");
|
|
6
|
+
interp-quoted: url("http://example.com/a(b) c/images/path");
|
|
7
|
+
lookup-quoted: url("http://example.com/a(b) c/images/path");
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// A rewritten rootpath is escaped only for *unquoted* url() values, so the node
|
|
2
|
+
// produced for an interpolated unquoted body must not read as quoted. Giving it a
|
|
3
|
+
// real quote character suppressed the escaping and emitted the parentheses and
|
|
4
|
+
// space raw, producing a malformed url().
|
|
5
|
+
//
|
|
6
|
+
// The rootpath here deliberately contains `(`, `)` and a space — the characters
|
|
7
|
+
// `escapePath` handles — so quoted and unquoted forms cannot look alike.
|
|
8
|
+
|
|
9
|
+
@dir: images;
|
|
10
|
+
@paths: {
|
|
11
|
+
dir: images;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
#rootpath-escape-interpolation {
|
|
15
|
+
// unquoted: rootpath must be escaped
|
|
16
|
+
plain-unquoted: url(relative/path);
|
|
17
|
+
interp-unquoted: url(@{dir}/path);
|
|
18
|
+
lookup-unquoted: url(@{paths[dir]}/path);
|
|
19
|
+
|
|
20
|
+
// quoted: rootpath must not be escaped
|
|
21
|
+
plain-quoted: url("relative/path");
|
|
22
|
+
interp-quoted: url("@{dir}/path");
|
|
23
|
+
lookup-quoted: url("@{paths[dir]}/path");
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.literal {
|
|
2
|
+
background: url(literal/one.png);
|
|
3
|
+
}
|
|
4
|
+
.interpolated {
|
|
5
|
+
background: url(images/two.png);
|
|
6
|
+
}
|
|
7
|
+
.interpolated-lookup {
|
|
8
|
+
background: url(assets/three.png);
|
|
9
|
+
}
|
|
10
|
+
.quoted-interpolated {
|
|
11
|
+
background: url("images/four.png");
|
|
12
|
+
}
|
|
13
|
+
/*# sourceMappingURL=url-interpolation.css.map */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Interpolated unquoted url() bodies are parsed into an escaped Quoted rather
|
|
2
|
+
// than the Anonymous node used for literal ones, so this pins that the swap does
|
|
3
|
+
// not change how url() values are mapped. All three spellings should keep the
|
|
4
|
+
// same mapping structure as each other.
|
|
5
|
+
@dir: images;
|
|
6
|
+
@paths: {
|
|
7
|
+
dir: assets;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
.literal {
|
|
11
|
+
background: url(literal/one.png);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.interpolated {
|
|
15
|
+
background: url(@{dir}/two.png);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.interpolated-lookup {
|
|
19
|
+
background: url(@{paths[dir]}/three.png);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.quoted-interpolated {
|
|
23
|
+
background: url("@{dir}/four.png");
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Properties have no lookup grammar: `entities.property` parses `$name` with no
|
|
2
|
+
// chaining, and nothing can hold a ruleset to look into. `${name[key]}` must
|
|
3
|
+
// therefore be rejected rather than reaching the property resolver, where it
|
|
4
|
+
// produced a misleading undefined-property error for undefined syntax.
|
|
5
|
+
.a {
|
|
6
|
+
color: red;
|
|
7
|
+
${color[k]}: value;
|
|
8
|
+
}
|
|
@@ -43,3 +43,41 @@
|
|
|
43
43
|
color: red;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
@media only screen and (max-width: 300px) {
|
|
47
|
+
.lookup-media {
|
|
48
|
+
width: 240px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@keyframes shrinker {
|
|
52
|
+
from {
|
|
53
|
+
font-size: 15px;
|
|
54
|
+
}
|
|
55
|
+
to {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
@supports (display: grid) {
|
|
60
|
+
.lookup-supports {
|
|
61
|
+
display: grid;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@layer overrides {
|
|
65
|
+
.lookup-layered {
|
|
66
|
+
color: blue;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
@media (min-width: 900px) {
|
|
70
|
+
.lookup-chained {
|
|
71
|
+
width: 900px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
@supports (width: 500px) {
|
|
75
|
+
.lookup-value-position {
|
|
76
|
+
width: 500px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
@supports (width: 900px) {
|
|
80
|
+
.lookup-value-position-chained {
|
|
81
|
+
width: 900px;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -74,3 +74,73 @@
|
|
|
74
74
|
color: red;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
// --- bare `[...]` lookups in the same structural positions ---
|
|
79
|
+
// A lookup parses into a NamespaceValue rather than a Variable. These were
|
|
80
|
+
// silently exempt from the deprecation until the node-type test was widened,
|
|
81
|
+
// so every position is covered explicitly here.
|
|
82
|
+
@lookup: {
|
|
83
|
+
query: ~"only screen and (max-width: 300px)";
|
|
84
|
+
anim: shrinker;
|
|
85
|
+
supported: ~"(display: grid)";
|
|
86
|
+
layer-name: overrides;
|
|
87
|
+
@deep: {
|
|
88
|
+
query: ~"(min-width: 900px)";
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
@media @lookup[query] {
|
|
93
|
+
.lookup-media {
|
|
94
|
+
width: 240px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes @lookup[anim] {
|
|
99
|
+
from { font-size: 15px; }
|
|
100
|
+
to { font-size: 12px; }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@supports @lookup[supported] {
|
|
104
|
+
.lookup-supports {
|
|
105
|
+
display: grid;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@layer @lookup[layer-name] {
|
|
110
|
+
.lookup-layered {
|
|
111
|
+
color: blue;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// chained lookup — still one deprecation, not one per segment
|
|
116
|
+
@media @lookup[@deep][query] {
|
|
117
|
+
.lookup-chained {
|
|
118
|
+
width: 900px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// A lookup in a declaration value inside `(...)` stays a value position and is
|
|
123
|
+
// not deprecated, mirroring the `@disp` case above.
|
|
124
|
+
//
|
|
125
|
+
// `@supports` scans its prelude as text, so a bare lookup reaches the permissive
|
|
126
|
+
// regex rather than being parsed structurally. Matching only `@values` used to
|
|
127
|
+
// resolve it to the whole ruleset and leave `[size]` behind, rendering
|
|
128
|
+
// `(width: [size])`. Both the flat and chained forms are covered here.
|
|
129
|
+
@values: {
|
|
130
|
+
size: 500px;
|
|
131
|
+
@deep: {
|
|
132
|
+
size: 900px;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
@supports (width: @values[size]) {
|
|
137
|
+
.lookup-value-position {
|
|
138
|
+
width: 500px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@supports (width: @values[@deep][size]) {
|
|
143
|
+
.lookup-value-position-chained {
|
|
144
|
+
width: 900px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
}
|
|
9
9
|
#built-in {
|
|
10
10
|
escaped: -Some::weird(#thing, y);
|
|
11
|
+
escaped-direct: a%20b%28c%29%3Dd%3Ae%23f%3Bg;
|
|
12
|
+
escaped-svg-literal: url("data:image/svg+xml,%3Csvg%20fill%3D%22red%22%3E%3C/svg%3E");
|
|
11
13
|
lighten: #ffcccc;
|
|
12
14
|
lighten-relative: #ff6666;
|
|
13
15
|
darken: #330000;
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
#built-in {
|
|
13
13
|
@r: 32;
|
|
14
|
+
@escaped-svg-literal: escape('<svg fill="red"></svg>');
|
|
14
15
|
escaped: e("-Some::weird(#thing, y)");
|
|
16
|
+
escaped-direct: escape('a b(c)=d:e#f;g');
|
|
17
|
+
escaped-svg-literal: url("data:image/svg+xml,@{escaped-svg-literal}");
|
|
15
18
|
lighten: lighten(#ff0000, 40%);
|
|
16
19
|
lighten-relative: lighten(#ff0000, 40%, relative);
|
|
17
20
|
darken: darken(#ff0000, 40%);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.quoted {
|
|
2
|
+
single: "card";
|
|
3
|
+
chained: "inner";
|
|
4
|
+
quoted-value: "deep";
|
|
5
|
+
indirect-key: "indirect-hit";
|
|
6
|
+
empty-key: "tail";
|
|
7
|
+
chained-empty-key: "nested-tail";
|
|
8
|
+
surrounded: "a-card-b";
|
|
9
|
+
twice: "card/blue";
|
|
10
|
+
}
|
|
11
|
+
.url {
|
|
12
|
+
quoted: url("/assets/img/hero.png");
|
|
13
|
+
unquoted: url(/assets/img/plain.png);
|
|
14
|
+
unquoted-plain: url(/plain/no-lookup.png);
|
|
15
|
+
untouched: url(/static/literal.png);
|
|
16
|
+
untouched-quoted: url("/static/literal.png");
|
|
17
|
+
data-uri: url(data:image/svg+xml;base64,AAAA);
|
|
18
|
+
}
|
|
19
|
+
.property-interpolation {
|
|
20
|
+
color: red;
|
|
21
|
+
from-property: "red";
|
|
22
|
+
surrounded: "a-red-b";
|
|
23
|
+
bare: red;
|
|
24
|
+
}
|
|
25
|
+
.card {
|
|
26
|
+
a: b;
|
|
27
|
+
}
|
|
28
|
+
.inner {
|
|
29
|
+
c: d;
|
|
30
|
+
}
|
|
31
|
+
.property {
|
|
32
|
+
card: from-lookup;
|
|
33
|
+
inner: from-chained-lookup;
|
|
34
|
+
}
|
|
35
|
+
@keyframes card {
|
|
36
|
+
from {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
to {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
@media (min-width: 768px) {
|
|
44
|
+
.responsive {
|
|
45
|
+
e: f;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.custom-property {
|
|
49
|
+
--from-lookup: /assets/img;
|
|
50
|
+
--from-chained: inner;
|
|
51
|
+
}
|
|
52
|
+
.recursive {
|
|
53
|
+
g: "card";
|
|
54
|
+
}
|
|
55
|
+
.plain {
|
|
56
|
+
h: "name";
|
|
57
|
+
}
|
|
58
|
+
.name {
|
|
59
|
+
i: j;
|
|
60
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// `[...]` lookups inside `@{...}` interpolation, backported from Less 5.x.
|
|
2
|
+
//
|
|
3
|
+
// Before the backport the parser accepted only `@{name}`, so every form below
|
|
4
|
+
// either failed to parse or — in string and url positions — silently emitted the
|
|
5
|
+
// interpolation verbatim into the output. The url/quoted cases in particular are
|
|
6
|
+
// regression coverage for that silent pass-through: a wrong-output bug that
|
|
7
|
+
// produced no error and no warning.
|
|
8
|
+
//
|
|
9
|
+
// The bare `@map[key]` spelling is covered by at-rule-variable-deprecated.less,
|
|
10
|
+
// where it is deprecated in structural positions.
|
|
11
|
+
|
|
12
|
+
@sizes: {
|
|
13
|
+
tablet: 768px;
|
|
14
|
+
name: card;
|
|
15
|
+
@name: indirect-hit;
|
|
16
|
+
last-entry: tail;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
@theme: {
|
|
20
|
+
color: blue;
|
|
21
|
+
@nested: {
|
|
22
|
+
name: inner;
|
|
23
|
+
label: "deep";
|
|
24
|
+
last-entry: nested-tail;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
@paths: {
|
|
29
|
+
img: "/assets/img";
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
@which: name;
|
|
33
|
+
|
|
34
|
+
// --- quoted strings ---
|
|
35
|
+
.quoted {
|
|
36
|
+
single: "@{sizes[name]}";
|
|
37
|
+
chained: "@{theme[@nested][name]}";
|
|
38
|
+
quoted-value: "@{theme[@nested][label]}";
|
|
39
|
+
indirect-key: "@{sizes[@@which]}";
|
|
40
|
+
empty-key: "@{sizes[]}";
|
|
41
|
+
chained-empty-key: "@{theme[@nested][]}";
|
|
42
|
+
surrounded: "a-@{sizes[name]}-b";
|
|
43
|
+
twice: "@{sizes[name]}/@{theme[color]}";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// --- url() — the silent pass-through regression ---
|
|
47
|
+
// An unquoted url() body was raw text in an Anonymous node, so neither the plain
|
|
48
|
+
// nor the lookup interpolation resolved there while the quoted form did. Both
|
|
49
|
+
// spellings are covered so the two cannot diverge again.
|
|
50
|
+
@plain-path: "/plain";
|
|
51
|
+
|
|
52
|
+
.url {
|
|
53
|
+
quoted: url("@{paths[img]}/hero.png");
|
|
54
|
+
unquoted: url(@{paths[img]}/plain.png);
|
|
55
|
+
unquoted-plain: url(@{plain-path}/no-lookup.png);
|
|
56
|
+
untouched: url(/static/literal.png);
|
|
57
|
+
untouched-quoted: url("/static/literal.png");
|
|
58
|
+
data-uri: url(data:image/svg+xml;base64,AAAA);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- ${...} property interpolation ---
|
|
62
|
+
// Properties have no lookup grammar: `$name[key]` is a property reference followed
|
|
63
|
+
// by literal `[key]`, and `prop: { … }` is a parse error in every scope, so nothing
|
|
64
|
+
// can hold a ruleset to look into. `${...}` therefore stays narrow while `@{...}`
|
|
65
|
+
// carries lookups, and the plain form must keep working unchanged.
|
|
66
|
+
.property-interpolation {
|
|
67
|
+
color: red;
|
|
68
|
+
from-property: "${color}";
|
|
69
|
+
surrounded: "a-${color}-b";
|
|
70
|
+
bare: $color;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// --- selector interpolation ---
|
|
74
|
+
.@{sizes[name]} {
|
|
75
|
+
a: b;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.@{theme[@nested][name]} {
|
|
79
|
+
c: d;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// --- property name interpolation ---
|
|
83
|
+
.property {
|
|
84
|
+
@{sizes[name]}: from-lookup;
|
|
85
|
+
@{theme[@nested][name]}: from-chained-lookup;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// --- at-rule name and prelude ---
|
|
89
|
+
@keyframes @{sizes[name]} {
|
|
90
|
+
from { opacity: 0; }
|
|
91
|
+
to { opacity: 1; }
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@queries: {
|
|
95
|
+
tablet: ~"(min-width: 768px)";
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
@media @{queries[tablet]} {
|
|
99
|
+
.responsive {
|
|
100
|
+
e: f;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// --- custom property values ---
|
|
105
|
+
.custom-property {
|
|
106
|
+
--from-lookup: @{paths[img]};
|
|
107
|
+
--from-chained: @{theme[@nested][name]};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// --- interpolation still resolves to a fixpoint ---
|
|
111
|
+
// The inner `@{...}` arrives from a variable's value at eval time, so it is not
|
|
112
|
+
// present in the source text of the outer reference.
|
|
113
|
+
@inner: card;
|
|
114
|
+
@outer: ~"@{inner}";
|
|
115
|
+
|
|
116
|
+
.recursive {
|
|
117
|
+
g: "@{outer}";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// --- plain interpolation is unaffected by the lookup support ---
|
|
121
|
+
.plain {
|
|
122
|
+
h: "@{which}";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.@{which} {
|
|
126
|
+
i: j;
|
|
127
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@media screen and (max-width: 500px) {
|
|
2
|
+
.a {
|
|
3
|
+
color: red;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
@media only screen and (min-width: 100px) {
|
|
7
|
+
.b {
|
|
8
|
+
color: blue;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
@media all and (max-width: 9px) {
|
|
12
|
+
.c {
|
|
13
|
+
color: green;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
@media print and (color) and (min-width: 1px) {
|
|
17
|
+
.d {
|
|
18
|
+
color: black;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
@media screen and (max-width: 500px) {
|
|
22
|
+
.e {
|
|
23
|
+
color: red;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
@media (max-width: 500px) and (min-width: 100px) {
|
|
27
|
+
.f {
|
|
28
|
+
color: red;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@media tester and (max-width: 500px) {
|
|
32
|
+
.g {
|
|
33
|
+
color: red;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
@media screen and (max-width: 500px) {
|
|
37
|
+
.h {
|
|
38
|
+
color: red;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// A media type nested inside conditions must lead the flattened query,
|
|
2
|
+
// otherwise the result is invalid CSS (issue #3694, #3764).
|
|
3
|
+
@media (max-width: 500px) {
|
|
4
|
+
@media screen {
|
|
5
|
+
.a { color: red; }
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
@media (min-width: 100px) {
|
|
9
|
+
@media only screen {
|
|
10
|
+
.b { color: blue; }
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
@media (max-width: 9px) {
|
|
14
|
+
@media all {
|
|
15
|
+
.c { color: green; }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
@media (min-width: 1px) {
|
|
19
|
+
@media print and (color) {
|
|
20
|
+
.d { color: black; }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Already-correct ordering is preserved.
|
|
25
|
+
@media screen {
|
|
26
|
+
@media (max-width: 500px) {
|
|
27
|
+
.e { color: red; }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Queries without a media type are left untouched.
|
|
32
|
+
@media (max-width: 500px) {
|
|
33
|
+
@media (min-width: 100px) {
|
|
34
|
+
.f { color: red; }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Unknown media types are valid CSS non-matches, so they reorder too.
|
|
39
|
+
@media (max-width: 500px) {
|
|
40
|
+
@media tester {
|
|
41
|
+
.g { color: red; }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// An escaped-string feature condition (Anonymous) must not be mistaken for a media type.
|
|
46
|
+
@fc: ~"(max-width: 500px)";
|
|
47
|
+
@media @fc {
|
|
48
|
+
@media screen {
|
|
49
|
+
.h { color: red; }
|
|
50
|
+
}
|
|
51
|
+
}
|