Skip to content

Commit b6b3f07

Browse files
authored
Use cssnano lite preset when saving CSS snapshots (#1042)
1 parent 6bfc2d9 commit b6b3f07

File tree

37 files changed

+421
-347
lines changed

37 files changed

+421
-347
lines changed

pnpm-lock.yaml

Lines changed: 140 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-helpers/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"@vanilla-extract/webpack-plugin": "*",
2525
"babel-loader": "^8.2.2",
2626
"css-loader": "^5.2.4",
27-
"cssnano": "^5.0.8",
27+
"cssnano": "^5.1.15",
28+
"cssnano-preset-lite": "^2.1.3",
2829
"esbuild": "0.17.6",
2930
"got": "^11.8.2",
3031
"html-webpack-plugin": "^5.3.1",

test-helpers/src/getStylesheet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import postcss from 'postcss';
22
import prettier from 'prettier';
3-
// @ts-expect-error
3+
import litePreset from 'cssnano-preset-lite';
44
import cssnano from 'cssnano';
55
import got from 'got';
66

77
export const stylesheetName = 'main.css';
88

99
export async function getStylesheet(url: string, stylesheetName = 'main.css') {
1010
const response = await got(`${url}/${stylesheetName}`);
11-
const { css } = await postcss([cssnano({ preset: 'default' })]).process(
11+
const { css } = await postcss([cssnano({ preset: litePreset() })]).process(
1212
response.body,
1313
{
1414
from: undefined,

tests/e2e/features.playwright.ts-snapshots/features-esbuild--development.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
display: block;
77
}
88
.features_styleWithComposition__1o6ek501 {
9-
background-color: #b0e0e6;
9+
background-color: powderblue;
1010
}
1111
.features_styleWithComposition__1o6ek501:hover {
12-
background-color: #708090;
12+
background-color: slategray;
1313
}
1414
.features_styleVariantsWithComposition_variant__1o6ek502 {
15-
background-color: #b0e0e6;
15+
background-color: powderblue;
1616
}
1717
.features_styleVariantsWithComposition_variant__1o6ek502:hover {
18-
background-color: #708090;
18+
background-color: slategray;
1919
}
2020
.features_styleVariantsWithMappedComposition_variant__1o6ek503 {
21-
background-color: #b0e0e6;
21+
background-color: powderblue;
2222
}
2323
.features_styleVariantsWithMappedComposition_variant__1o6ek503:hover {
24-
background-color: #708090;
24+
background-color: slategray;
2525
}
2626
.features_styleCompositionInSelector__1o6ek505 {
27-
color: #fff;
27+
color: white;
2828
}
2929
.features_styleCompositionInSelector__1o6ek506 {
30-
background-color: #000;
30+
background-color: black;
3131
}
3232
body .features_styleCompositionInSelector__1o6ek507 {
3333
font-size: 24px;
3434
}
3535
.features_styleVariantsCompositionInSelector_variant__1o6ek508 {
36-
color: #fff;
36+
color: white;
3737
}
3838
.features_styleVariantsCompositionInSelector_variant__1o6ek509 {
39-
background-color: #000;
39+
background-color: black;
4040
}
4141
body .features_styleVariantsCompositionInSelector_variant__1o6ek50a {
4242
font-size: 24px;

tests/e2e/features.playwright.ts-snapshots/features-esbuild-next--development.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
display: block;
77
}
88
.features_styleWithComposition__1o6ek501 {
9-
background-color: #b0e0e6;
9+
background-color: powderblue;
1010
}
1111
.features_styleWithComposition__1o6ek501:hover {
12-
background-color: #708090;
12+
background-color: slategray;
1313
}
1414
.features_styleVariantsWithComposition_variant__1o6ek502 {
15-
background-color: #b0e0e6;
15+
background-color: powderblue;
1616
}
1717
.features_styleVariantsWithComposition_variant__1o6ek502:hover {
18-
background-color: #708090;
18+
background-color: slategray;
1919
}
2020
.features_styleVariantsWithMappedComposition_variant__1o6ek503 {
21-
background-color: #b0e0e6;
21+
background-color: powderblue;
2222
}
2323
.features_styleVariantsWithMappedComposition_variant__1o6ek503:hover {
24-
background-color: #708090;
24+
background-color: slategray;
2525
}
2626
.features_styleCompositionInSelector__1o6ek505 {
27-
color: #fff;
27+
color: white;
2828
}
2929
.features_styleCompositionInSelector__1o6ek506 {
30-
background-color: #000;
30+
background-color: black;
3131
}
3232
body .features_styleCompositionInSelector__1o6ek507 {
3333
font-size: 24px;
3434
}
3535
.features_styleVariantsCompositionInSelector_variant__1o6ek508 {
36-
color: #fff;
36+
color: white;
3737
}
3838
.features_styleVariantsCompositionInSelector_variant__1o6ek509 {
39-
background-color: #000;
39+
background-color: black;
4040
}
4141
body .features_styleVariantsCompositionInSelector_variant__1o6ek50a {
4242
font-size: 24px;

tests/e2e/features.playwright.ts-snapshots/features-mini-css-extract--development.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
display: block;
77
}
88
.features_styleWithComposition__87f2ru1 {
9-
background-color: #b0e0e6;
9+
background-color: powderblue;
1010
}
1111
.features_styleWithComposition__87f2ru1:hover {
12-
background-color: #708090;
12+
background-color: slategray;
1313
}
1414
.features_styleVariantsWithComposition_variant__87f2ru2 {
15-
background-color: #b0e0e6;
15+
background-color: powderblue;
1616
}
1717
.features_styleVariantsWithComposition_variant__87f2ru2:hover {
18-
background-color: #708090;
18+
background-color: slategray;
1919
}
2020
.features_styleVariantsWithMappedComposition_variant__87f2ru3 {
21-
background-color: #b0e0e6;
21+
background-color: powderblue;
2222
}
2323
.features_styleVariantsWithMappedComposition_variant__87f2ru3:hover {
24-
background-color: #708090;
24+
background-color: slategray;
2525
}
2626
.features_styleCompositionInSelector__87f2ru5 {
27-
color: #fff;
27+
color: white;
2828
}
2929
.features_styleCompositionInSelector__87f2ru6 {
30-
background-color: #000;
30+
background-color: black;
3131
}
3232
body .features_styleCompositionInSelector__87f2ru7 {
3333
font-size: 24px;
3434
}
3535
.features_styleVariantsCompositionInSelector_variant__87f2ru8 {
36-
color: #fff;
36+
color: white;
3737
}
3838
.features_styleVariantsCompositionInSelector_variant__87f2ru9 {
39-
background-color: #000;
39+
background-color: black;
4040
}
4141
body .features_styleVariantsCompositionInSelector_variant__87f2rua {
4242
font-size: 24px;

tests/e2e/features.playwright.ts-snapshots/features-mini-css-extract--production.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
display: block;
77
}
88
._87f2ru1 {
9-
background-color: #b0e0e6;
9+
background-color: powderblue;
1010
}
1111
._87f2ru1:hover {
12-
background-color: #708090;
12+
background-color: slategray;
1313
}
1414
._87f2ru2 {
15-
background-color: #b0e0e6;
15+
background-color: powderblue;
1616
}
1717
._87f2ru2:hover {
18-
background-color: #708090;
18+
background-color: slategray;
1919
}
2020
._87f2ru3 {
21-
background-color: #b0e0e6;
21+
background-color: powderblue;
2222
}
2323
._87f2ru3:hover {
24-
background-color: #708090;
24+
background-color: slategray;
2525
}
2626
._87f2ru5 {
27-
color: #fff;
27+
color: white;
2828
}
2929
._87f2ru6 {
30-
background-color: #000;
30+
background-color: black;
3131
}
3232
body ._87f2ru7 {
3333
font-size: 24px;
3434
}
3535
._87f2ru8 {
36-
color: #fff;
36+
color: white;
3737
}
3838
._87f2ru9 {
39-
background-color: #000;
39+
background-color: black;
4040
}
4141
body ._87f2rua {
4242
font-size: 24px;

tests/e2e/low-level.playwright.ts-snapshots/low-level-esbuild--development.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@media screen and (min-width: 200px) {
1212
@container styles_my-container__1amv5mo1 (min-width: 400px) {
1313
.styles_block__1amv5mo3 {
14-
color: #fff;
14+
color: white;
1515
}
1616
}
1717
}

tests/e2e/low-level.playwright.ts-snapshots/low-level-esbuild-next--development.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@media screen and (min-width: 200px) {
1212
@container styles_my-container__1amv5mo1 (min-width: 400px) {
1313
.styles_block__1amv5mo3 {
14-
color: #fff;
14+
color: white;
1515
}
1616
}
1717
}

tests/e2e/low-level.playwright.ts-snapshots/low-level-mini-css-extract--development.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@media screen and (min-width: 200px) {
1212
@container styles_my-container__cj5d031 (min-width: 400px) {
1313
.styles_block__cj5d033 {
14-
color: #fff;
14+
color: white;
1515
}
1616
}
1717
}

0 commit comments

Comments
 (0)