Skip to content

feat(css): add support for modern CSS properties, pseudo-classes, and pseudo-elements#9490

Merged
ematipico merged 6 commits intobiomejs:mainfrom
willfarrell:feature/modern-css
Mar 16, 2026
Merged

feat(css): add support for modern CSS properties, pseudo-classes, and pseudo-elements#9490
ematipico merged 6 commits intobiomejs:mainfrom
willfarrell:feature/modern-css

Conversation

@willfarrell
Copy link
Contributor

Summary

Added modern CSS keywords to the noUnknownProperty, noUnknownPseudoClass, and noUnknownPseudoElement lint rules so they no longer produce false positives for recently standardized or in-progress CSS features.

New known properties: dynamic-range-limit, overlay, reading-flow, reading-order, scroll-marker-group, scroll-target-group.
New pseudo-elements: ::checkmark, ::column, ::picker, ::picker-icon, ::scroll-button, ::scroll-marker, ::scroll-marker-group.
New pseudo-classes: :active-view-transition-type, :has-slotted, :target-after, :target-before, :target-current.

This PR was written with the assistance of Claude Code.

Test Plan

  • Added valid test cases for each new property, pseudo-class, and pseudo-element.
  • Updated snapshots with cargo insta accept.

Docs

No external documentation changes needed, the keywords are internal to the existing lint rules.

Refs

New pseudo-elements

Name Spec MDN
::checkmark open-ui/selectlist MDN
::column css-multicol-2 MDN
::picker() open-ui/selectlist MDN
::picker-icon open-ui/selectlist MDN
::scroll-button() css-overflow-5 MDN
::scroll-marker css-overflow-5 MDN
::scroll-marker-group css-overflow-5 MDN

New pseudo-classes

Name Spec MDN
:active-view-transition-type() css-view-transitions-2 MDN
:has-slotted css-scoping-2 MDN
:target-current css-overflow-5 MDN
:target-before css-overflow-5 MDN
:target-after css-overflow-5 MDN

New properties

Name Spec MDN
dynamic-range-limit css-color-hdr MDN
overlay css-position-4 MDN
reading-flow css-display-4 MDN
reading-order css-display-4 MDN
scroll-marker-group css-overflow-5 MDN
scroll-target-group css-overflow-5 MDN

willfarrell and others added 2 commits March 15, 2026 10:32
…udo elements

Signed-off-by: will Farrell <willfarrell@proton.me>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2026

🦋 Changeset detected

Latest commit: 264a0e5

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-Linter Area: linter L-CSS Language: CSS and super languages labels Mar 15, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2667584f-ec8e-479d-b8ca-51cc4019af91

📥 Commits

Reviewing files that changed from the base of the PR and between fe9ff6b and 6a1fed4.

⛔ Files ignored due to path filters (3)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/valid.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoElement/valid.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (5)
  • .changeset/modern-css-keywords.md
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.css
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/valid.css
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoElement/valid.css

Walkthrough

This PR extends CSS language support by introducing modern CSS keywords across properties, pseudo-elements, and pseudo-classes. It adds six new known properties (dynamic-range-limit, overlay, reading-flow, reading-order, scroll-marker-group, scroll-target-group), seven new pseudo-elements (including ::checkmark, ::picker, ::scroll-marker variants), and five new pseudo-classes (:has-slotted, :target-before, :target-after, :target-current, :active-view-transition-type). The keywords registry is updated alongside corresponding test files to validate these constructs.

Possibly related PRs

Suggested reviewers

  • ematipico
  • siketyan
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: adding support for modern CSS properties, pseudo-classes, and pseudo-elements to the codebase.
Description check ✅ Passed The description is directly related to the changeset, providing clear details about which CSS keywords were added and why, along with comprehensive references to specifications and MDN documentation.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Lovely, thank you!

@ematipico
Copy link
Member

It seems that not all tests were run. @willfarrell can you please look after it? CI is failing

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 16, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 187 skipped benchmarks1


Comparing willfarrell:feature/modern-css (264a0e5) with main (c311974)2

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.

  2. No successful run was found on main (9315453) during the generation of this report, so c311974 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Signed-off-by: will Farrell <willfarrell@proton.me>
@willfarrell
Copy link
Contributor Author

Pushed an update, will watch for pass

@willfarrell
Copy link
Contributor Author

We're all good :)

@ematipico ematipico merged commit 60cf024 into biomejs:main Mar 16, 2026
18 checks passed
@willfarrell willfarrell deleted the feature/modern-css branch March 16, 2026 18:43
@github-actions github-actions bot mentioned this pull request Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-CSS Language: CSS and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants