Skip to content

fix(parse/css): parse tailwind @utility with slash in the name#9043

Open
dyc3 wants to merge 1 commit intomainfrom
dyc3/tw-slash-utility-name
Open

fix(parse/css): parse tailwind @utility with slash in the name#9043
dyc3 wants to merge 1 commit intomainfrom
dyc3/tw-slash-utility-name

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Feb 12, 2026

Summary

Allows the css parser to parse @utility a/b {}.

fixes #8897

Test Plan

snapshots

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 12f0722

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Parser Area: parser L-CSS Language: CSS labels Feb 12, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 187 skipped benchmarks1


Comparing dyc3/tw-slash-utility-name (12f0722) with main (2cebc11)

Open in CodSpeed

Footnotes

  1. 187 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3 dyc3 force-pushed the dyc3/tw-slash-utility-name branch from 1bfb213 to 12f0722 Compare February 22, 2026 17:00
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This PR addresses parsing errors when Tailwind @utility directives contain forward slashes in their names (e.g., @utility a/b). A new TailwindUtilityName lexical context was introduced to the CSS lexer, enabling it to recognise slashed identifiers in Tailwind utility contexts. The lexer's identifier consumption logic was generalised with an allow_slash parameter to permit slashes when parsing utility names. Test cases cover both valid and invalid scenarios.

Possibly related PRs

Suggested labels

L-Tailwind

Suggested reviewers

  • ematipico
  • siketyan
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: enabling the CSS parser to handle Tailwind @utility directives with slashes in the name.
Description check ✅ Passed The description clearly explains the motivation (parsing @utility a/b {}) and links to issue #8897, demonstrating relevance to the changeset.
Linked Issues check ✅ Passed The PR directly addresses issue #8897 by implementing lexer changes to allow forward slashes in Tailwind utility names, with corresponding test cases validating the fix.
Out of Scope Changes check ✅ Passed All changes are focused on supporting slash-containing Tailwind utility names: lexer modifications, parser updates, and test cases—nothing extraneous is present.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/tw-slash-utility-name

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser L-CSS Language: CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📝 parser error with forward slash in tailwind directive

3 participants