Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Vite: Don't crash when importing a virtual module in JavaScript that ends in `.css` ([#16780](https://github.com/tailwindlabs/tailwindcss/pull/16780))
- Ensure `@reference "…"` does not emit CSS variables ([#16774](https://github.com/tailwindlabs/tailwindcss/pull/16774))
- Fix an issue where `@reference "…"` would sometimes omit keyframe animations ([#16774](https://github.com/tailwindlabs/tailwindcss/pull/16774))
- Ensure `z-*!` utilities are property marked as `!important` ([#16795](https://github.com/tailwindlabs/tailwindcss/pull/16795))

## [4.0.8] - 2025-02-21

Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function applyImportant(ast: AstNode[]): void {
continue
}

if (node.kind === 'declaration' && node.property[0] !== '-' && node.property[1] !== '-') {
if (node.kind === 'declaration' && !(node.property[0] === '-' && node.property[1] === '-')) {
node.important = true
} else if (node.kind === 'rule' || node.kind === 'at-rule') {
applyImportant(node.nodes)
Expand Down
6 changes: 5 additions & 1 deletion packages/tailwindcss/src/important.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,17 @@ test('variables in utilities should not be marked as important', async () => {
}
@tailwind utilities;
`,
['ease-out!'],
['ease-out!', 'z-10!'],
),
).toMatchInlineSnapshot(`
":root, :host {
--ease-out: cubic-bezier(0, 0, .2, 1);
}

.z-10\\! {
z-index: 10 !important;
}

.ease-out\\! {
--tw-ease: var(--ease-out);
transition-timing-function: var(--ease-out) !important;
Expand Down