Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
reduce specificity of * and ** variants
  • Loading branch information
RobinMalfait authored and adamwathan committed Nov 8, 2024
commit c5300a2f7142bf3b77586eea579a137164a116c0
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