From beb123461e7c34c6b5f4e53b5b28ccd5ecb68bfc Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Fri, 8 Nov 2024 15:56:46 +0100 Subject: [PATCH] reduce specificity of `*` and `**` variants --- packages/tailwindcss/src/variants.test.ts | 4 ++-- packages/tailwindcss/src/variants.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/tailwindcss/src/variants.test.ts b/packages/tailwindcss/src/variants.test.ts index fc0c9856f546..54cbe2dbf5d0 100644 --- a/packages/tailwindcss/src/variants.test.ts +++ b/packages/tailwindcss/src/variants.test.ts @@ -17,7 +17,7 @@ test('force', async () => { test('*', async () => { expect(await run(['*:flex'])).toMatchInlineSnapshot(` - ":where(.\\*\\:flex > *) { + ":is(.\\*\\:flex > *) { display: flex; }" `) @@ -26,7 +26,7 @@ test('*', async () => { test('**', async () => { expect(await run(['**:flex'])).toMatchInlineSnapshot(` - ":where(.\\*\\*\\:flex *) { + ":is(.\\*\\*\\:flex *) { display: flex; }" `) diff --git a/packages/tailwindcss/src/variants.ts b/packages/tailwindcss/src/variants.ts index 81be83326141..7174323eb92a 100644 --- a/packages/tailwindcss/src/variants.ts +++ b/packages/tailwindcss/src/variants.ts @@ -363,8 +363,8 @@ export function createVariants(theme: Theme): Variants { } variants.static('force', () => {}, { compounds: Compounds.Never }) - staticVariant('*', [':where(& > *)'], { compounds: Compounds.Never }) - staticVariant('**', [':where(& *)'], { compounds: Compounds.Never }) + staticVariant('*', [':is(& > *)'], { compounds: Compounds.Never }) + staticVariant('**', [':is(& *)'], { compounds: Compounds.Never }) function negateConditions(ruleName: string, conditions: string[]) { return conditions.map((condition) => {