Skip to content

Commit 0bbcd09

Browse files
Still needs a layer and fix supports query
1 parent 0ad7aad commit 0bbcd09

File tree

1 file changed

+4
-3
lines changed
  • packages/tailwindcss/src

1 file changed

+4
-3
lines changed

packages/tailwindcss/src/ast.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,16 +569,17 @@ export function optimizeAst(
569569
}
570570

571571
if (fallbackAst.length > 0) {
572-
let firstNonCommentIndex = newAst.findIndex((item) => item.kind !== 'comment') ?? 0
572+
let firstNonCommentIndex = newAst.findIndex((item) => item.kind !== 'comment')
573+
if (firstNonCommentIndex === -1) firstNonCommentIndex = 0
573574
newAst.splice(
574575
firstNonCommentIndex,
575576
0,
576577
atRule(
577578
'@supports',
578579
// We can't write a supports query for `@property` directly so we have to test for
579580
// features that are added around the same time in Mozilla and Safari.
580-
'((-webkit-hyphens: none) and (not (margin-trim: 1lh))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))',
581-
fallbackAst,
581+
'((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))',
582+
[rule('@layer base', fallbackAst)],
582583
),
583584
)
584585
}

0 commit comments

Comments
 (0)