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
5 changes: 5 additions & 0 deletions .changeset/fix-scroll-state-container-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
---

Fixed [#8842](https://github.com/biomejs/biome/issues/8842): The CSS formatter now correctly formats `@container scroll-state()` without adding an unwanted space between the function name and opening parenthesis.
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/tests/specs/css/atrule/container.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@ inline-size

@container ( WIDTH <= 150px ) { }
@container ( 150px <= WIDTH ) { }

@container scroll-state(scrolled: bottom) { }

@container scroll-state(stuck: top) { }

@container not scroll-state(stuck) { }

@container card scroll-state(scrolled: bottom) { }

@container scroll-state( scrolled: bottom ) { }
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ inline-size
@container ( WIDTH <= 150px ) { }
@container ( 150px <= WIDTH ) { }

@container scroll-state(scrolled: bottom) { }

@container scroll-state(stuck: top) { }

@container not scroll-state(stuck) { }

@container card scroll-state(scrolled: bottom) { }

@container scroll-state( scrolled: bottom ) { }

```


Expand Down Expand Up @@ -149,4 +159,15 @@ Trailing newline: true
@container (150px <= WIDTH) {
}

@container scroll-state(scrolled: bottom) { }

@container scroll-state(stuck: top) { }

@container not scroll-state(stuck) {
}

@container card scroll-state(scrolled: bottom) { }

@container scroll-state( scrolled: bottom ) { }

```
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub(crate) fn parse_container_at_rule_declarator(p: &mut CssParser) -> ParsedSyn
let m = p.start();
p.bump(T![container]);

if !is_at_container_style_query_in_parens(p) {
if !is_at_container_style_query_in_parens(p) && !is_at_container_scroll_state_query(p) {
let name = parse_custom_identifier(p, CssLexContext::Regular);
// Because the name is optional, we have to indirectly check if it's
// a CSS-wide keyword that can't be used. If it was required, we could
Expand Down
Loading