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 @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Suppress Lightning CSS warnings about `:deep`, `:slotted`, and `:global` ([#19094](https://github.com/tailwindlabs/tailwindcss/pull/19094))
- Fix resolving theme keys when starting with the name of another theme key in JS configs and plugins ([#19097](https://github.com/tailwindlabs/tailwindcss/pull/19097))
- Allow named groups in combination with `not-*`, `has-*`, and `in-*` ([#19100](https://github.com/tailwindlabs/tailwindcss/pull/19100))
- Prevent important utilities from affecting other utilities ([#19110](https://github.com/tailwindlabs/tailwindcss/pull/19110))
- Upgrade: Canonicalize utilities containing `0` values ([#19095](https://github.com/tailwindlabs/tailwindcss/pull/19095))

## [4.1.14] - 2025-10-01
Expand Down
44 changes: 44 additions & 0 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,50 @@ describe('@apply', () => {
`)
})

it('@apply does not cache important state', async () => {
expect(
await compileCss(css`
.c1 {
@apply leading-none;
}
.c2 {
@apply leading-none!;
}
.c3 {
@apply leading-none;
}
`),
).toMatchInlineSnapshot(`
"@layer properties {
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
*, :before, :after, ::backdrop {
--tw-leading: initial;
}
}
}

.c1 {
--tw-leading: 1;
line-height: 1;
}

.c2 {
--tw-leading: 1 !important;
line-height: 1 !important;
}

.c3 {
--tw-leading: 1;
line-height: 1;
}

@property --tw-leading {
syntax: "*";
inherits: false
}"
`)
})

it('should error when using @apply with a utility that does not exist', async () => {
await expect(
compile(css`
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export function createUtilities(theme: Theme) {

if (value === null && !negative && desc.staticValues && !candidate.modifier) {
let fallback = desc.staticValues[candidate.value.value]
if (fallback) return fallback
if (fallback) return fallback.map(cloneAstNode)
}
}

Expand Down