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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Show suggestions for known `matchVariant` values ([#18798](https://github.com/tailwindlabs/tailwindcss/pull/18798))
- Replace deprecated `clip` with `clip-path` in `sr-only` ([#18769](https://github.com/tailwindlabs/tailwindcss/pull/18769))
- Hide internal fields from completions in `matchUtilities` ([#18820](https://github.com/tailwindlabs/tailwindcss/pull/18820))
- Ignore `.vercel` folders by default (can be overridden by `@source …` rules) ([#18855](https://github.com/tailwindlabs/tailwindcss/pull/18855))
- Consider variants starting with `@-` to be invalid (e.g. `@-2xl:flex`) ([#18869](https://github.com/tailwindlabs/tailwindcss/pull/18869))
- Upgrade: Migrate `aria` theme keys to `@custom-variant` ([#18815](https://github.com/tailwindlabs/tailwindcss/pull/18815))
- Upgrade: Migrate `data` theme keys to `@custom-variant` ([#18816](https://github.com/tailwindlabs/tailwindcss/pull/18816))
- Upgrade: Migrate `supports` theme keys to `@custom-variant` ([#18817](https://github.com/tailwindlabs/tailwindcss/pull/18817))
- Ignore `.vercel` folders by default (can be overridden by `@source …` rules) ([#18855](https://github.com/tailwindlabs/tailwindcss/pull/18855))

## [4.1.12] - 2025-08-13

Expand Down
5 changes: 5 additions & 0 deletions packages/tailwindcss/src/candidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,11 @@ function* findRoots(input: string, exists: (input: string) => boolean): Iterable
// can skip any further parsing.
if (root[1] === '') break

// Edge case: `@-…` is not valid as a variant or a utility so we want to
// skip if an `@` is followed by a `-`. Otherwise `@-2xl:flex` and
// `@-2xl:flex` would be considered the same.
if (root[0] === '@' && exists('@') && input[idx] === '-') break

yield root
}

Expand Down
33 changes: 33 additions & 0 deletions packages/tailwindcss/src/variants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,39 @@ test('container queries', async () => {
}
}"
`)
expect(
await compileCss(
css`
@theme {
--container-lg: 1024px;
--container-foo-bar: 1440px;
}
@tailwind utilities;
`,
[
'@-lg:flex',
'@-lg/name:flex',
'@-[123px]:flex',
'@-[456px]/name:flex',
'@-foo-bar:flex',
'@-foo-bar/name:flex',

'@-min-lg:flex',
'@-min-lg/name:flex',
'@-min-[123px]:flex',
'@-min-[456px]/name:flex',
'@-min-foo-bar:flex',
'@-min-foo-bar/name:flex',

'@-max-lg:flex',
'@-max-lg/name:flex',
'@-max-[123px]:flex',
'@-max-[456px]/name:flex',
'@-max-foo-bar:flex',
'@-max-foo-bar/name:flex',
],
),
).toEqual('')
})

test('variant order', async () => {
Expand Down