Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(biome_css_analyzer): update known pseudo elements #5118

Merged
merged 9 commits into from
Feb 21, 2025
Merged
5 changes: 5 additions & 0 deletions .changeset/smart-seals-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
---

[noUnknownPseudoElement](https://biomejs.dev/linter/rules/no-unknown-pseudo-element/) add support for `::slotted` ([#5116](https://github.com/biomejs/biome/issues/5116)).
4 changes: 2 additions & 2 deletions crates/biome_css_analyze/src/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ pub const FUNCTION_KEYWORDS: [&str; 685] = [
];

// These are the ones that can have single-colon notation
pub const LEVEL_ONE_AND_TWO_PSEUDO_ELEMENTS: [&str; 4] =
["after", "before", "first-letter", "first-line"];
pub const LEVEL_ONE_AND_TWO_PSEUDO_ELEMENTS: [&str; 5] =
["after", "before", "first-letter", "first-line", "slotted"];

pub const VENDOR_SPECIFIC_PSEUDO_ELEMENTS: [&str; 66] = [
"-moz-focus-inner",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/biome_css_analyze/tests/spec_tests.rs
expression: invalid.css
snapshot_kind: text
---
# Input
```css
Expand Down Expand Up @@ -189,23 +188,6 @@ invalid.css:11:2 lint/nursery/noUnknownPseudoClass ━━━━━━━━━
i See MDN web docs for more details.


```

```
invalid.css:12:2 lint/nursery/noUnknownPseudoClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Unexpected unknown pseudo-class slotted

10 │ ::-webkit-scrollbar-button:horizontal:unknown {}
11 │ :first { }
> 12 │ :slotted {}
│ ^^^^^^^
13 │ :placeholder {}
14 │ @page :blank:unknown { }

i See MDN web docs for more details.


```

```
Expand Down
Loading