Ignore unknown at-rule warnings for @position-try (#20277)
This PR ignores Lightning CSS warnings for the unknow at-rule `@position-try`. This is a temporary fix/workaround until support for `@position-try` lands in Lightning CSS: https://github.com/parcel-bundler/lightningcss/pull/1238 Fixes: #20275 ## Test plan Ran a test based on the issue: Before: ```shellsession ❯ tw -i x.css -o out.css --optimize ≈ tailwindcss v4.3.1 Found 1 warning while optimizing generated CSS: │ position-try-fallbacks: --flip-above; │ } │ @position-try --flip-above { ┆ ^-- Unknown at rule: @position-try ┆ │ top: auto; │ bottom: 0; Done in 29ms ``` After: ```shellsession ❯ tw -i x.css -o out.css --optimize ≈ tailwindcss v4.3.1 Done in 14ms ```
This commit is contained in:
parent
bb6a10937c
commit
7ff413bad4
1 changed files with 7 additions and 0 deletions
|
|
@ -68,6 +68,13 @@ export function optimize(
|
|||
return false
|
||||
}
|
||||
|
||||
// Ignore warnings about unknown at-rules.
|
||||
//
|
||||
// TODO: drop `@position-try` once https://github.com/parcel-bundler/lightningcss/pull/1238 lands
|
||||
if (/Unknown at rule: @position-try/.test(warning.message)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue