Skip to content

Commit

Permalink
reduce specificity of * and ** variants
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Nov 8, 2024
1 parent 54ddbb1 commit beb1234
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/tailwindcss/src/variants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('force', async () => {

test('*', async () => {
expect(await run(['*:flex'])).toMatchInlineSnapshot(`
":where(.\\*\\:flex > *) {
":is(.\\*\\:flex > *) {
display: flex;
}"
`)
Expand All @@ -26,7 +26,7 @@ test('*', async () => {

test('**', async () => {
expect(await run(['**:flex'])).toMatchInlineSnapshot(`
":where(.\\*\\*\\:flex *) {
":is(.\\*\\*\\:flex *) {
display: flex;
}"
`)
Expand Down
4 changes: 2 additions & 2 deletions packages/tailwindcss/src/variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit beb1234

Please sign in to comment.