Skip to content

Commit 0e09053

Browse files
authored
Reduce the amount of generated fallback css (batch 3) (#845)
* postcss-lab-function * postcss-logical-viewport-units * postcss-nested-calc * postcss-pseudo-class-any-link * postcss-scope-pseudo-class
1 parent f9f6ad7 commit 0e09053

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1108
-83
lines changed

plugins/postcss-lab-function/.tape.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { postcssTape } from '../../packages/postcss-tape/dist/index.mjs';
1+
import { postcssTape, ruleClonerPlugin } from '../../packages/postcss-tape/dist/index.mjs';
22
import plugin from 'postcss-lab-function';
33

44
postcssTape(plugin)({
@@ -30,6 +30,16 @@ postcssTape(plugin)({
3030
preserve: true
3131
}
3232
},
33+
'basic:with-cloned-rules': {
34+
message: 'doesn\'t cause duplicate CSS',
35+
warnings: 9,
36+
plugins: [
37+
ruleClonerPlugin,
38+
plugin({
39+
preserve: true
40+
})
41+
]
42+
},
3343
'variables': {
3444
message: 'supports variables',
3545
},

plugins/postcss-lab-function/test/basic.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,12 @@
178178
lch-007: lch(55% 60 270);
179179
lch-008: lch(86.6146% 148.1135 136.0089);
180180
}
181+
182+
.manual_fallback {
183+
color: red;
184+
color: lab(40% 56.6 39);
185+
}
186+
187+
to-clone {
188+
color: lab(40% 56.6 39);
189+
}

plugins/postcss-lab-function/test/basic.display-p3-false.expect.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,12 @@
178178
lch-007: rgb(33, 135, 237);
179179
lch-008: rgb(0, 251, 41);
180180
}
181+
182+
.manual_fallback {
183+
color: red;
184+
color: lab(40% 56.6 39);
185+
}
186+
187+
to-clone {
188+
color: rgb(179, 35, 35);
189+
}

plugins/postcss-lab-function/test/basic.display-p3-false.preserve-true.expect.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,13 @@
261261
lch-008: rgb(0, 251, 41);
262262
lch-008: lch(86.6146% 148.1135 136.0089);
263263
}
264+
265+
.manual_fallback {
266+
color: red;
267+
color: lab(40% 56.6 39);
268+
}
269+
270+
to-clone {
271+
color: rgb(179, 35, 35);
272+
color: lab(40% 56.6 39);
273+
}

plugins/postcss-lab-function/test/basic.expect.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,13 @@
261261
lch-008: rgb(0, 251, 41);
262262
lch-008: color(display-p3 0.00000 1.00000 0.00000);
263263
}
264+
265+
.manual_fallback {
266+
color: red;
267+
color: lab(40% 56.6 39);
268+
}
269+
270+
to-clone {
271+
color: rgb(179, 35, 35);
272+
color: color(display-p3 0.64331 0.19245 0.16771);
273+
}

plugins/postcss-lab-function/test/basic.preserve-true.expect.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,14 @@
344344
lch-008: color(display-p3 0.00000 1.00000 0.00000);
345345
lch-008: lch(86.6146% 148.1135 136.0089);
346346
}
347+
348+
.manual_fallback {
349+
color: red;
350+
color: lab(40% 56.6 39);
351+
}
352+
353+
to-clone {
354+
color: rgb(179, 35, 35);
355+
color: color(display-p3 0.64331 0.19245 0.16771);
356+
color: lab(40% 56.6 39);
357+
}

0 commit comments

Comments
 (0)