Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/modern-css-keywords.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@biomejs/biome": patch
---

Added support for modern CSS properties, pseudo-classes, and pseudo-elements.

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`.
22 changes: 20 additions & 2 deletions crates/biome_css_analyze/src/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,17 +851,24 @@ pub const VENDOR_SPECIFIC_PSEUDO_ELEMENTS: [&str; 66] = [

pub const SHADOW_TREE_PSEUDO_ELEMENTS: [&str; 1] = ["part"];

pub const OTHER_PSEUDO_ELEMENTS: [&str; 22] = [
pub const OTHER_PSEUDO_ELEMENTS: [&str; 29] = [
"backdrop",
"checkmark",
"column",
"content",
"cue",
"details-content",
"file-selector-button",
"grammar-error",
"highlight",
"marker",
"picker",
"picker-icon",
"placeholder",
"prefix",
"scroll-button",
"scroll-marker",
"scroll-marker-group",
"search-text",
"selection",
"shadow",
Expand Down Expand Up @@ -930,9 +937,10 @@ pub const RESOURCE_STATE_PSEUDO_CLASSES: [&str; 7] = [
"volume-locked",
];

pub const OTHER_PSEUDO_CLASSES: [&str; 52] = [
pub const OTHER_PSEUDO_CLASSES: [&str; 57] = [
"active",
"active-view-transition",
"active-view-transition-type",
"any-link",
"autofill",
"blank",
Expand All @@ -951,6 +959,7 @@ pub const OTHER_PSEUDO_CLASSES: [&str; 52] = [
"fullscreen",
"fullscreen-ancestor",
"future",
"has-slotted",
"host",
"host-context",
"hover",
Expand All @@ -977,6 +986,9 @@ pub const OTHER_PSEUDO_CLASSES: [&str; 52] = [
"scope",
"state",
"target",
"target-after",
"target-before",
"target-current",
"unresolved",
"user-invalid",
"user-valid",
Expand Down Expand Up @@ -1156,6 +1168,7 @@ pub const KNOWN_PROPERTIES: &[&str] = &[
"direction",
"display",
"dominant-baseline",
"dynamic-range-limit",
"elevation",
"empty-cells",
"field-sizing",
Expand Down Expand Up @@ -1374,6 +1387,7 @@ pub const KNOWN_PROPERTIES: &[&str] = &[
"overflow-wrap",
"overflow-x",
"overflow-y",
"overlay",
"overscroll-behavior",
"overscroll-behavior-block",
"overscroll-behavior-inline",
Expand Down Expand Up @@ -1416,6 +1430,8 @@ pub const KNOWN_PROPERTIES: &[&str] = &[
"print-color-adjust",
"property-name",
"quotes",
"reading-flow",
"reading-order",
"region-fragment",
"resize",
"rest",
Expand Down Expand Up @@ -1443,6 +1459,7 @@ pub const KNOWN_PROPERTIES: &[&str] = &[
"scroll-margin-left",
"scroll-margin-right",
"scroll-margin-top",
"scroll-marker-group",
"scroll-padding",
"scroll-padding-block",
"scroll-padding-block-end",
Expand All @@ -1458,6 +1475,7 @@ pub const KNOWN_PROPERTIES: &[&str] = &[
"scroll-snap-stop",
"scroll-snap-type",
"scroll-start-target",
"scroll-target-group",
"scroll-timeline",
"scroll-timeline-axis",
"scroll-timeline-name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ a {
color: yellow;
}

/* Scroll and modern CSS properties */
a { scroll-marker-group: after; }
a { scroll-target-group: auto; }
a { reading-flow: flex-visual; }
a { reading-order: 1; }
a { overlay: auto; }
a { dynamic-range-limit: standard; }

/* View Transition navigation property (should not be flagged) */
view-transition {
navigation: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ a {
color: yellow;
}
/* Scroll and modern CSS properties */
a { scroll-marker-group: after; }
a { scroll-target-group: auto; }
a { reading-flow: flex-visual; }
a { reading-order: 1; }
a { overlay: auto; }
a { dynamic-range-limit: standard; }
/* View Transition navigation property (should not be flagged) */
view-transition {
navigation: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ a:defined { }
dialog:open {}
custom-selector:state(checked) {}
:active-view-transition * { transition-duration: 0s; }
::scroll-marker:target-current {}
::scroll-marker:target-before {}
::scroll-marker:target-after {}
slot:has-slotted {}
html:active-view-transition-type(slide) {}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ a:defined { }
dialog:open {}
custom-selector:state(checked) {}
:active-view-transition * { transition-duration: 0s; }
::scroll-marker:target-current {}
::scroll-marker:target-before {}
::scroll-marker:target-after {}
slot:has-slotted {}
html:active-view-transition-type(slide) {}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ a::part(shadow-part) { }
position: absolute;
}
details::details-content {}
select::picker(select) {}
option::checkmark {}
select::picker-icon {}
.carousel::scroll-marker {}
.carousel::scroll-marker-group {}
.carousel::scroll-button(inline-start) {}
.multicol::column {}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ a::part(shadow-part) { }
position: absolute;
}
details::details-content {}
select::picker(select) {}
option::checkmark {}
select::picker-icon {}
.carousel::scroll-marker {}
.carousel::scroll-marker-group {}
.carousel::scroll-button(inline-start) {}
.multicol::column {}
```

Expand Down