Skip to content

Commit 9c06159

Browse files
authored
Migrate Less to use valid CSS (#4357)
1 parent 9d345ff commit 9c06159

25 files changed

+54
-58
lines changed

packages/less/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"node": ">=14"
3636
},
3737
"scripts": {
38+
"quicktest": "grunt quicktest",
3839
"test": "grunt test",
3940
"grunt": "grunt",
4041
"lint": "eslint '**/*.{ts,js}'",

packages/test-data/css/_main/comments.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@
7878
/* } */
7979
/*by block */
8080
#output-block {
81-
comment: /* // Not commented out // */;
81+
--comment: /* // Not commented out // */;
8282
}
8383
/*comment on last line*/

packages/test-data/css/_main/container.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@
204204
font-size: 1rem;
205205
}
206206
@media (hover: hover) {
207-
font-size: 1.75rem;
207+
.foo {
208+
font-size: 1.75rem;
209+
}
208210
}
209211
}
210212
.media-2 {
@@ -220,9 +222,13 @@
220222
font-size: 1rem;
221223
}
222224
@media (hover: hover) {
223-
font-size: 1.75rem;
225+
.foo {
226+
font-size: 1.75rem;
227+
}
224228
@media not all and (hover: hover) {
225-
color: limegreen;
229+
.foo {
230+
color: limegreen;
231+
}
226232
}
227233
.media-3 {
228234
padding: 0.5rem;
@@ -235,7 +241,9 @@
235241
}
236242
@container (min-width: 768px) {
237243
@media only screen and (min-width: 768px) {
238-
color: aliceblue;
244+
.foo {
245+
color: aliceblue;
246+
}
239247
}
240248
.container-1 {
241249
color: purple;

packages/test-data/css/_main/css-3.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@namespace foo url(http://www.example.com);
12
.comma-delimited {
23
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
34
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, 0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
@@ -17,10 +18,10 @@
1718
p:not([class*="lead"]) {
1819
color: black;
1920
}
20-
input[type="text"].class#id[attr=32]:not(1) {
21+
input[type="text"].class#id[attr=i32]:not(.one) {
2122
color: inherit;
2223
}
23-
div#id.class[a=1][b=2].class:not(1) {
24+
div#id.class[a=one][b=two].class:not(.one) {
2425
color: inherit;
2526
}
2627
ul.comma > li:not(:only-child)::after {
@@ -88,7 +89,6 @@ p::before {
8889
@viewport {
8990
font-size: 10px;
9091
}
91-
@namespace foo url(http://www.example.com);
9292
foo|h1 {
9393
color: blue;
9494
}
@@ -109,15 +109,15 @@ h1 {
109109
display: block;
110110
}
111111
}
112-
::distributed(input::placeholder) {
112+
:not(input::placeholder) {
113113
color: #b3b3b3;
114114
}
115115
.shadow > .dom,
116116
body > .shadow {
117117
display: done;
118118
}
119-
:host(.sel .a),
120-
:host-context(.sel .b),
119+
:host(.sel.a),
120+
:host-context(.sel.b),
121121
.sel > .b,
122122
::content .sel {
123123
type: shadow-dom;

packages/test-data/css/_main/css-escapes.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ ng\:form {
2828
textarea {
2929
font-family: 'helvetica neue', 'wenquanyi micro hei', \5FAE\8F6F\96C5\9ED1, \5B8B\4F53, sans-serif;
3030
}
31-
anything to unquote
31+
/* anything to unquote */

packages/test-data/css/_main/extract-and-length.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
number-value: 12345678;
1616
color-value: blue;
1717
rgba-value: rgba(80, 160, 240, 0.67);
18-
empty-value: ;
18+
--empty-value: ;
1919
name-length: 1;
2020
string-length: 1;
2121
number-length: 1;

packages/test-data/css/_main/functions.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ html {
229229
a: 1;
230230
b: 2;
231231
c: 3;
232-
e: ;
232+
--e: ;
233233
f: 6;
234234
g: 3;
235235
h: 5;

packages/test-data/css/_main/import-reference.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
input[type="text"].class#id[attr=32]:not(1) {
1+
input[type="text"].class#id[attr=i32]:not(.one) {
22
color: inherit;
33
}
4-
div#id.class[a=1][b=2].class:not(1) {
4+
div#id.class[a=one][b=two].class:not(.one) {
55
color: inherit;
66
}
77
@media print {

packages/test-data/css/_main/javascript.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
multiline: 2;
99
}
1010
.scope {
11-
empty: ;
11+
--empty: ;
1212
var: 42;
1313
escaped: 7px;
1414
}

packages/test-data/css/_main/media.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,6 @@
241241
background: green;
242242
}
243243
}
244-
@media (example, all), speech {
245-
body {
246-
background: green;
247-
}
248-
}
249244
@media (min-orientation: portrait) {
250245
body {
251246
background: green;

0 commit comments

Comments
 (0)