Skip to content

feat(css_parser): add vueScopedCss option for Vue SFC scoped CSS selectors#9037

Closed
kiroushi wants to merge 1 commit intobiomejs:mainfrom
kiroushi:feat/vue-scoped-css-parser
Closed

feat(css_parser): add vueScopedCss option for Vue SFC scoped CSS selectors#9037
kiroushi wants to merge 1 commit intobiomejs:mainfrom
kiroushi:feat/vue-scoped-css-parser

Conversation

@kiroushi
Copy link
Contributor

AI disclosure: This PR was developed with AI assistance (Claude Code). All changes were reviewed manually.

Summary

Fixes #7923.

Adds a new css.parser.vueScopedCss configuration option that enables parsing of Vue SFC scoped CSS selectors (:deep(), :slotted()). This follows the same pattern as the existing css.parser.cssModules option for :local()/:global().

When disabled (the default), the parser emits a helpful diagnostic with a hint to enable the option:

`:deep` and `:slotted` are Vue SFC scoped CSS selectors, not standard CSS features.
  You can enable Vue SFC scoped CSS parsing by setting the `css.parser.vueScopedCss`
  option to `true` in your configuration file.

Usage in biome.json:

{
  "css": {
    "parser": {
      "vueScopedCss": true
    }
  }
}

Note: :global() is already handled by the cssModules option and is not part of this change.

Test Plan

  • OK test: :deep(.b) and :slotted(.b) parse successfully with vueScopedCss: true.
  • Error/disabled test: Without the option, both selectors produce a diagnostic with the hint.
  • Error/enabled test: Malformed syntax (missing selector, empty parens, missing closing paren, etc.) produces proper error recovery, mirroring the existing CSS Modules error tests.
  • All 203 CSS parser tests pass.

Docs

A documentation PR will be submitted to the next branch of the website to document the new css.parser.vueScopedCss option alongside the existing cssModules and tailwindDirectives options.

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 8ad946a

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-Project Area: project A-Parser Area: parser A-Tooling Area: internal tools L-CSS Language: CSS labels Feb 11, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

This PR adds support for parsing Vue SFC scoped CSS selectors (:deep() and :slotted()). It introduces a new configuration option css.parser.vueScopedCss that can be enabled via --css-parse-vue-scoped-css CLI flag. The implementation adds lexer tokens for the new keywords, updates pseudo-class function selector parsing to recognise these Vue-specific selectors alongside CSS Modules syntax, and propagates the setting through the configuration and service layers. Error handling is included to report when Vue scoped CSS is encountered with the feature disabled.

Possibly related PRs

Suggested labels

A-Parser, L-CSS, A-Tooling

Suggested reviewers

  • dyc3
  • ematipico
  • arendjr
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new vueScopedCss configuration option for parsing Vue SFC scoped CSS selectors, which is the primary objective of this PR.
Description check ✅ Passed The description is well-detailed and directly related to the changeset. It explains the feature, configuration usage, test coverage, and references the linked issue #7923.
Linked Issues check ✅ Passed All code changes successfully implement the requirements from #7923: the PR adds support for parsing Vue SFC scoped CSS selectors (:deep() and :slotted()) with proper configuration options, error handling, and test coverage.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing Vue SFC scoped CSS selector support. No unrelated modifications detected; all alterations serve the stated objective.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

@dyc3
Copy link
Contributor

dyc3 commented Feb 11, 2026

This has already been implemented on next and will be available in 2.4

@dyc3 dyc3 closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools L-CSS Language: CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 CSS parse error on Vue-specific pseudo-classes

2 participants