Bump to latest cssnano v6 (#14105)

We bundle cssnano in our CLI and it's on an older version that does not
handle nested CSS correctly. This PR updates it to the latest version of
v6.x

Fixes #14092
This commit is contained in:
Jordan Pittman 2024-08-02 08:57:14 -04:00 • committed by GitHub
parent 28bd90eefb
commit 1f23c2e842
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 475 additions and 400 deletions

View file

@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing yet!
- Fix minification when using nested CSS ([#14105](https://github.com/tailwindlabs/tailwindcss/pull/14105))
## [3.4.7] - 2024-07-25

View file

@ -96,6 +96,45 @@ describe('Build command', () => {
expect(withoutMinify.length).toBeGreaterThan(withMinify.length)
})
test('--minify does not break nested CSS', async () => {
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
await writeInputFile(
'input.css',
css`
.parent {
& .child {
color: red;
}
& .child {
&:not([href]) {
color: green;
}
}
}
`
)
await $(`${EXECUTABLE} --input ./src/input.css --output ./dist/main.css --minify`)
let withMinify = await readOutputFile('main.css')
// Verify that we got the expected output. Note: `.toIncludeCss` formats
// `actual` & `expected`
expect(withMinify).toIncludeCss(
css`
.parent {
& .child {
color: red;
}
& .child {
&:not([href]) {
color: green;
}
}
}
`
)
})
test('--no-autoprefixer', async () => {
await writeInputFile('index.html', html`<div class="select-none"></div>`)

826
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -50,7 +50,7 @@
"autoprefixer": "^10.4.14",
"browserslist": "^4.21.5",
"concurrently": "^8.0.1",
"cssnano": "^6.0.0",
"cssnano": "^6.1.2",
"esbuild": "^0.20.2",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",

View file

@ -25,7 +25,7 @@
},
"..": {
"name": "tailwindcss",
"version": "3.4.6",
"version": "3.4.7",
"dev": true,
"license": "MIT",
"dependencies": {
@ -64,7 +64,7 @@
"autoprefixer": "^10.4.14",
"browserslist": "^4.21.5",
"concurrently": "^8.0.1",
"cssnano": "^6.0.0",
"cssnano": "^6.1.2",
"esbuild": "^0.20.2",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
@ -9607,7 +9607,7 @@
"browserslist": "^4.21.5",
"chokidar": "^3.5.3",
"concurrently": "^8.0.1",
"cssnano": "^6.0.0",
"cssnano": "^6.1.2",
"didyoumean": "^1.2.2",
"dlv": "^1.1.3",
"esbuild": "^0.20.2",