Skip to content

Enable lightningcss scroll navigation drafts so :target-current parses - #20515

Open
aceeyz wants to merge 1 commit into
tailwindlabs:mainfrom
aceeyz:fix/target-current-pseudo-class
Open

aceeyz wants to merge 1 commit into
tailwindlabs:mainfrom
aceeyz:fix/target-current-pseudo-class

Conversation

@aceeyz

@aceeyz aceeyz commented Sep 25, 2026 •

Copy link
Copy Markdown

lightningcss 1.33.0 (parcel-bundler/lightningcss#1185) parses :target-current, :target-before and :target-after only when drafts.scrollNavigationControls is set. optimize.ts sets only customMedia, so any stylesheet using these CSS Overflow 5 selectors prints "'target-current' is not recognized as a valid pseudo-class" on every build. The rule is kept only because errorRecovery is on. This turns the draft on.

@aceeyz
aceeyz requested a review from a team as a code owner September 25, 2026 19:17
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Enables CSS parser support for scroll navigation pseudo-classes.

The PR appears safe to merge, with a non-blocking gap in regression coverage for the new warning behavior.

Reviews (1) · Last reviewed commit: "Enable lightningcss scroll navigation dr..."

inputSourceMap: map,
drafts: {
customMedia: true,
scrollNavigationControls: true,

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.

P2 Warning behavior lacks test coverage
The new option is intended to stop warnings for :target-current, :target-before, and :target-after, but the optimizer has no direct test of its warning output. A later change could bring those warnings back without being caught. Please test the warning behavior with both minified and non-minified output.

Knowledge Base Used: Node API and compilation services

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ecb00069-e9f3-4f6e-82c7-a2506d7171c0

📥 Commits

Reviewing files that changed from the base of the PR and between 9798a8a and ae5f069.

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

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The CSS optimization transform now enables Lightning CSS’s scrollNavigationControls draft feature. The Unreleased changelog states that optimization no longer warns about :target-current, :target-before, and :target-after.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to ae5f0

The optimizer can now handle the three scroll-navigation pseudo-classes without the reported warnings. No concrete merge-blocking risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to ae5f0

The change affects 2 systems.

Changed systems: packages/@tailwindcss-node, CHANGELOG.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/@tailwindcss-node (library) was modified; 1 changed file maps to changed impact.
  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: The Unreleased “Fixed” list adds an entry for suppressing CSS optimization warnings about :target-current, :target-before, and :target-after.
  • observed — Modified behavior in packages/@tailwindcss-node/src/optimize.ts: Enables Lightning CSS’s scrollNavigationControls draft feature in the transform options.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so the description does not explain the changeset. Add a brief description that explains enabling scrollNavigationControls in Lightning CSS and preventing warnings for the related target pseudo-classes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling the Lightning CSS scroll navigation draft feature so :target-current parses.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant