Skip to content

Commit

Permalink
Bump to latest cssnano v6 (#14105)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thecrypticace authored Aug 2, 2024
1 parent 28bd90e commit 1f23c2e
Show file tree
Hide file tree
Showing 5 changed files with 479 additions and 404 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
39 changes: 39 additions & 0 deletions integrations/tailwindcss-cli/tests/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>`)

Expand Down
Loading

0 comments on commit 1f23c2e

Please sign in to comment.