Skip to content

Ignore unknown at-rule warnings for @position-try#20277

Merged
RobinMalfait merged 1 commit into
mainfrom
fix/issue-20275
Jun 25, 2026
Merged

Ignore unknown at-rule warnings for @position-try#20277
RobinMalfait merged 1 commit into
mainfrom
fix/issue-20275

Conversation

@RobinMalfait

@RobinMalfait RobinMalfait commented Jun 25, 2026

Copy link
Copy Markdown
Member

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: parcel-bundler/lightningcss#1238

Fixes: #20275

Test plan

Ran a test based on the issue:

Before:

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:

tw -i x.css -o out.css --optimize
≈ tailwindcss v4.3.1

Done in 14ms

@RobinMalfait RobinMalfait requested a review from a team as a code owner June 25, 2026 10:58
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (2): Last reviewed commit: "temporarily ignore unknown at-rule `@pos..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f97a4fdf-df82-4040-9385-2aeb1406ac98

📥 Commits

Reviewing files that changed from the base of the PR and between bebc9eb and f7615bc.

📒 Files selected for processing (1)
  • packages/@tailwindcss-node/src/optimize.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/@tailwindcss-node/src/optimize.ts

Walkthrough

The change adds a special-case warning filter in packages/@tailwindcss-node/src/optimize.ts that excludes the Lightning CSS warning Unknown at rule: \@position-try``.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: suppressing unknown @position-try warnings.
Description check ✅ Passed The description directly matches the code change and linked issue by explaining the @position-try warning workaround.
Linked Issues check ✅ Passed The change satisfies #20275 by filtering the @position-try warning while preserving the optimizer behavior.
Out of Scope Changes check ✅ Passed No unrelated changes are present; the patch only adds the targeted warning exception and a TODO note.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/`@tailwindcss-node/src/optimize.ts:
- Around line 71-77: The warning filter in optimize.ts is ordered incorrectly,
so the `@position-try` exclusion is unreachable after the pseudo-class guard.
Update the warning-handling logic in optimize() to check for the Unknown at
rule: `@position-try` case before the pseudo-class regex branch, and keep the
existing return false behavior for that warning while preserving the rest of the
filtering flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 609fa3e4-9eba-4f10-80c3-7c894d3b6651

📥 Commits

Reviewing files that changed from the base of the PR and between d5ca0ae and bebc9eb.

📒 Files selected for processing (1)
  • packages/@tailwindcss-node/src/optimize.ts

Comment thread packages/@tailwindcss-node/src/optimize.ts
@RobinMalfait RobinMalfait merged commit 7ff413b into main Jun 25, 2026
9 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-20275 branch June 25, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimizer warns on valid @position-try at-rule

1 participant