Skip to content
Open
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 @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Canonicalization: don't merge utilities that reference different theme variables set to CSS-wide keywords like `unset` ([#20417](https://github.com/tailwindlabs/tailwindcss/pull/20417))
- Don't generate utilities when a modifier is used that would otherwise be silently ignored (e.g. `rounded-sm/[5]`, `shadow-sm/foo`, `stroke-2/50`) ([#20419](https://github.com/tailwindlabs/tailwindcss/pull/20419))
- Only normalize top-level `and`, `or`, and `not` keywords in `supports-[…]` variants (e.g. `selector(a: not (.foo))` → `selector(a:not(.foo))`) ([#20420](https://github.com/tailwindlabs/tailwindcss/pull/20420))
- Don't generate invalid CSS for `in-*` variants using a relative arbitrary selector (e.g. `in-[>img]`), matching existing behavior for `not-*`, `group-*`, and `peer-*` ([#20424](https://github.com/tailwindlabs/tailwindcss/pull/20424))

## [4.3.3] - 2026-07-16

Expand Down
4 changes: 4 additions & 0 deletions packages/tailwindcss/src/variants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,10 @@ test('in', async () => {
"
`)
expect(await run(['in-p:flex', 'in-foo-bar:flex'])).toEqual('')

// `in-*` is built using `:where(…) &`, which — unlike `:has(…)` — does not
// accept relative selectors, so these must not generate any output.
expect(await run(['in-[>img]:flex', 'in-[+img]:flex', 'in-[~img]:flex'])).toEqual('')
})

test('has', async () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/tailwindcss/src/variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,8 @@ export function createVariants(theme: Theme): Variants {
staticVariant('inert', ['&:is([inert], [inert] *)'])

variants.compound('in', Compounds.StyleRules, (ruleNode, variant) => {
if (variant.variant.kind === 'arbitrary' && variant.variant.relative) return null

if (variant.modifier) return null

let didApply = false
Expand Down