Skip to content

Commit 0e26859

Browse files
authored
Examples contain more valid CSS, to test with a new parser (#3550)
* Make Less tests contain more valid CSS
1 parent 76132ef commit 0e26859

20 files changed

+75
-78
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
#grey {
4444
color: #c8c8c8;
4545
}
46-
#333333 {
47-
color: #333333;
46+
#aa3333 {
47+
color: #aa3333;
4848
}
49-
#808080 {
50-
color: hsl(0, 0%, 50%);
49+
#bb8080 {
50+
color: hsl(0, 30%, 62%);
5151
}
52-
#00ff00 {
53-
color: hsl(120, 100%, 50%);
52+
#ccff00 {
53+
color: hsl(72, 100%, 50%);
5454
}
5555
.lightenblue {
5656
color: #3333ff;

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

+5-8
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ foo|h1 {
9595
foo|* {
9696
color: yellow;
9797
}
98-
|h1 {
99-
color: red;
100-
}
10198
*|h1 {
10299
color: green;
103100
}
@@ -115,20 +112,20 @@ h1 {
115112
::distributed(input::placeholder) {
116113
color: #b3b3b3;
117114
}
118-
.shadow ^ .dom,
119-
body ^^ .shadow {
115+
.shadow > .dom,
116+
body > .shadow {
120117
display: done;
121118
}
122119
:host(.sel .a),
123120
:host-context(.sel .b),
124-
.sel /deep/ .b,
121+
.sel > .b,
125122
::content .sel {
126123
type: shadow-dom;
127124
}
128-
/deep/ b {
125+
* b {
129126
c: 'd';
130127
}
131-
/deep/ b[e] {
128+
* b[e] {
132129
f: 'g';
133130
}
134131
#issue2066 {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
color: red;
2525
height: 1px;
2626
}
27-
+ .dont-split-me-up {
27+
* .dont-split-me-up {
2828
sibling: true;
2929
}
3030
.scope-check {

packages/test-data/css/_main/detached-rulesets.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ html.lt-ie9 header {
4646
.without-mixins {
4747
b: 1;
4848
}
49-
@media (orientation: portrait) and tv {
49+
@media (orientation: portrait) and (tv) {
5050
.my-selector {
5151
background-color: black;
5252
}
5353
}
54-
@media (orientation: portrait) and widescreen and print and tv {
54+
@media (orientation: portrait) and (widescreen) and (print) and (tv) {
5555
.triple-wrapped-mq {
5656
triple: true;
5757
}
5858
}
59-
@media (orientation: portrait) and widescreen and tv {
59+
@media (orientation: portrait) and (widescreen) and (tv) {
6060
.triple-wrapped-mq {
6161
triple: true;
6262
}
6363
}
64-
@media (orientation: portrait) and tv {
64+
@media (orientation: portrait) and (tv) {
6565
.triple-wrapped-mq {
6666
triple: true;
6767
}

packages/test-data/css/_main/extend-chaining.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
.vc {
6161
color: inherit;
6262
}
63-
@media tv {
63+
@media (tv) {
6464
.ma,
6565
.mb,
6666
.mc {
@@ -73,7 +73,7 @@
7373
color: inherit;
7474
}
7575
}
76-
@media tv and plasma {
76+
@media (tv) and (plasma) {
7777
.me,
7878
.mf {
7979
background: red;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.all .ext2 {
33
background: black;
44
}
5-
@media tv {
5+
@media (tv) {
66
.ext1 .ext3,
77
.tv-lowres .ext3,
88
.all .ext3 {
@@ -12,7 +12,7 @@
1212
background: blue;
1313
}
1414
}
15-
@media tv and hires {
15+
@media (tv) and (hires) {
1616
.ext1 .ext4,
1717
.tv-hires .ext4,
1818
.all .ext4 {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
ary1: "1, 2, 3";
2424
}
2525
.test-rule-tran {
26-
1: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
27-
2: [opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear];
28-
3: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
26+
one: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
27+
two: [opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear];
28+
three: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
2929
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@
5353
width: 500px;
5454
}
5555
}
56-
@media a and b {
56+
@media a and (b) {
5757
.first .second .third {
5858
width: 300px;
5959
}
6060
.first .second .fourth {
6161
width: 3;
6262
}
6363
}
64-
@media a and b and c {
64+
@media a and (b) and (c) {
6565
.first .second .third {
6666
width: 500px;
6767
}
6868
}
69-
@media a, b and c {
69+
@media a, (b) and (c) {
7070
.body {
7171
width: 95%;
7272
}
7373
}
74-
@media a and x, b and c and x, a and y, b and c and y {
74+
@media a and (x), (b) and (c) and (x), a and (y), (b) and (c) and (y) {
7575
.body {
7676
width: 100%;
7777
}
@@ -211,7 +211,7 @@
211211
display: table-cell;
212212
}
213213
}
214-
@media all and tv {
214+
@media all and (tv) {
215215
.all-and-tv-variables {
216216
var: all-and-tv;
217217
}

packages/test-data/css/_main/mixins-guards-default-func.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@ guard-default-multi-4 {
112112
always: 2;
113113
case: 2;
114114
}
115-
guard-default-not-ambiguos-2 {
115+
guard-default-not-ambiguous-2 {
116116
case: 1;
117117
not-default: 2;
118118
}
119-
guard-default-not-ambiguos-3 {
119+
guard-default-not-ambiguous-3 {
120120
case: 1;
121121
not-default-1: 2;
122122
not-default-2: 2;
123123
}
124124
guard-default-scopes-3 {
125-
3: when default;
125+
three: when default;
126126
}
127127
guard-default-scopes-1 {
128-
1: no condition;
128+
one: no condition;
129129
}

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ p a span {
133133
}
134134
[prop],
135135
[prop=10%],
136-
[prop="value3"],
136+
[prop|="value3"],
137137
[prop*="val3"],
138138
[|prop~="val3"],
139139
[*|prop$="val3"],
140140
[ns|prop^="val3"],
141-
[3^="val3"],
142-
[3=3],
143-
[3] {
141+
[p^="val3"],
142+
[p=3],
143+
[p] {
144144
attributes: yes;
145145
}
146146
/*

packages/test-data/less/_main/colors.less

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@
4444
color: rgb(200, 200, 200);
4545
}
4646

47-
#333333 {
48-
color: rgb(20%, 20%, 20%);
47+
#aa3333 {
48+
color: rgb(66.66%, 20%, 20%);
4949
}
5050

51-
#808080 {
52-
color: hsl(50, 0%, 50%);
51+
#bb8080 {
52+
color: hsl(0deg, 30%, 62%);
5353
}
5454

55-
#00ff00 {
56-
color: hsl(120, 100%, 50%);
55+
#ccff00 {
56+
color: hsl(72deg, 100%, 50%);
5757
}
5858

5959
.lightenblue {

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

+5-6
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ p::before {
100100

101101
foo|h1 { color: blue; }
102102
foo|* { color: yellow; }
103-
|h1 { color: red; }
104103
*|h1 { color: green; }
105104
h1 { color: green; }
106105
.upper-test {
@@ -114,18 +113,18 @@ h1 { color: green; }
114113
::distributed(input::placeholder) {
115114
color: #b3b3b3;
116115
}
117-
.shadow ^ .dom,
118-
body ^^ .shadow {
116+
.shadow > .dom,
117+
body > .shadow {
119118
display: done;
120119
}
121120

122121
:host(.sel .a),
123122
:host-context(.sel .b),
124-
.sel /deep/ .b,
123+
.sel > .b,
125124
::content .sel {
126125
type: shadow-dom;
127126
}
128-
/deep/ b {
127+
* b {
129128
c: 'd';
130129
&[e]{
131130
f: 'g';
@@ -147,7 +146,7 @@ body ^^ .shadow {
147146
}
148147

149148
@unknown foo 42 (bar) {
150-
x {y: z}
149+
x {y: z}
151150
}
152151

153152
@unknown foo 43;

packages/test-data/less/_main/css-guards.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
& when (@c = 3) {
8181
height: 1px;
8282
}
83-
+ & when (@c = 3) { // creates invalid css but tests that we don't fold it in
83+
* & when (@c = 3) {
8484
sibling: true;
8585
}
8686
}

packages/test-data/less/_main/detached-rulesets.less

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,24 @@ header {
6767
}
6868
@my-ruleset: {
6969
.my-selector {
70-
@media tv {
70+
@media (tv) {
7171
background-color: black;
7272
}
7373
}
7474
};
7575
@media (orientation:portrait) {
7676
@my-ruleset();
7777
.wrap-media-mixin({
78-
@media tv {
78+
@media (tv) {
7979
.triple-wrapped-mq {
8080
triple: true;
8181
}
8282
}
8383
});
8484
}
8585
.wrap-media-mixin(@ruleset) {
86-
@media widescreen {
87-
@media print {
86+
@media (widescreen) {
87+
@media (print) {
8888
@ruleset();
8989
}
9090
@ruleset();

packages/test-data/less/_main/extend-chaining.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@
7373

7474
// media queries - don't extend outside, do extend inside
7575

76-
@media tv {
76+
@media (tv) {
7777
.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) {
7878
color: black;
7979
}
8080
.md {
8181
color: inherit;
8282
}
83-
@media plasma {
83+
@media (plasma) {
8484
.me, .mf {
8585
&:extend(.mb,.md);
8686
background: red;

packages/test-data/less/_main/extend-media.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
background: black;
33
}
44

5-
@media tv {
5+
@media (tv) {
66
.ext1 .ext3 {
77
color: inherit;
88
}
99
.tv-lowres :extend(.ext1 all) {
1010
background: blue;
1111
}
12-
@media hires {
12+
@media (hires) {
1313
.ext1 .ext4 {
1414
color: green;
1515
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
}
3131
.transitions(...) {
3232
@arg: ~`"@{arguments}".replace(/[\[\]]*/g, '')`;
33-
1: @arg; // rounded to integers
34-
2: ~`"@{arguments}"`; // rounded to integers
35-
3: @arguments; // OK
33+
one: @arg; // rounded to integers
34+
two: ~`"@{arguments}"`; // rounded to integers
35+
three: @arguments; // OK
3636
}
3737
.test-rule-tran {
3838
.transitions(opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;);

0 commit comments

Comments
 (0)