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

Fixed [#9253](https://github.com/biomejs/biome/issues/9253): parsing of `@container scroll-state(...)` queries.

```css
@container scroll-state(scrolled: bottom) { }
@container scroll-state(stuck) { }
@container scroll-state(not (stuck)) { }
@container scroll-state((stuck) and (scrolled: bottom)) { }
@container scroll-state((stuck) or (snapped: x)) { }
@container main-layout scroll-state(not ((stuck) and (scrolled: bottom))) { }
```
70 changes: 70 additions & 0 deletions crates/biome_css_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

165 changes: 165 additions & 0 deletions crates/biome_css_factory/src/generated/syntax_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ impl FormatRule<AnyCssContainerQueryInParens> for FormatAnyCssContainerQueryInPa
match node {
AnyCssContainerQueryInParens::AnyCssValue(node) => node.format().fmt(f),
AnyCssContainerQueryInParens::CssContainerQueryInParens(node) => node.format().fmt(f),
AnyCssContainerQueryInParens::CssContainerScrollStateQueryInParens(node) => {
node.format().fmt(f)
}
AnyCssContainerQueryInParens::CssContainerSizeFeatureInParens(node) => {
node.format().fmt(f)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file.

use crate::prelude::*;
use biome_css_syntax::AnyCssContainerScrollStateAndCombinableQuery;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssContainerScrollStateAndCombinableQuery;
impl FormatRule<AnyCssContainerScrollStateAndCombinableQuery>
for FormatAnyCssContainerScrollStateAndCombinableQuery
{
type Context = CssFormatContext;
fn fmt(
&self,
node: &AnyCssContainerScrollStateAndCombinableQuery,
f: &mut CssFormatter,
) -> FormatResult<()> {
match node {
AnyCssContainerScrollStateAndCombinableQuery::CssContainerScrollStateAndQuery(node) => {
node.format().fmt(f)
}
AnyCssContainerScrollStateAndCombinableQuery::CssContainerScrollStateInParens(node) => {
node.format().fmt(f)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file.

use crate::prelude::*;
use biome_css_syntax::AnyCssContainerScrollStateInParens;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssContainerScrollStateInParens;
impl FormatRule<AnyCssContainerScrollStateInParens> for FormatAnyCssContainerScrollStateInParens {
type Context = CssFormatContext;
fn fmt(
&self,
node: &AnyCssContainerScrollStateInParens,
f: &mut CssFormatter,
) -> FormatResult<()> {
match node {
AnyCssContainerScrollStateInParens::AnyCssContainerScrollStateQuery(node) => {
node.format().fmt(f)
}
AnyCssContainerScrollStateInParens::AnyCssValue(node) => node.format().fmt(f),
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file.

use crate::prelude::*;
use biome_css_syntax::AnyCssContainerScrollStateOrCombinableQuery;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssContainerScrollStateOrCombinableQuery;
impl FormatRule<AnyCssContainerScrollStateOrCombinableQuery>
for FormatAnyCssContainerScrollStateOrCombinableQuery
{
type Context = CssFormatContext;
fn fmt(
&self,
node: &AnyCssContainerScrollStateOrCombinableQuery,
f: &mut CssFormatter,
) -> FormatResult<()> {
match node {
AnyCssContainerScrollStateOrCombinableQuery::CssContainerScrollStateInParens(node) => {
node.format().fmt(f)
}
AnyCssContainerScrollStateOrCombinableQuery::CssContainerScrollStateOrQuery(node) => {
node.format().fmt(f)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file.

use crate::prelude::*;
use biome_css_syntax::AnyCssContainerScrollStateQuery;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssContainerScrollStateQuery;
impl FormatRule<AnyCssContainerScrollStateQuery> for FormatAnyCssContainerScrollStateQuery {
type Context = CssFormatContext;
fn fmt(
&self,
node: &AnyCssContainerScrollStateQuery,
f: &mut CssFormatter,
) -> FormatResult<()> {
match node {
AnyCssContainerScrollStateQuery::AnyCssQueryFeature(node) => node.format().fmt(f),
AnyCssContainerScrollStateQuery::CssContainerScrollStateAndQuery(node) => {
node.format().fmt(f)
}
AnyCssContainerScrollStateQuery::CssContainerScrollStateInParens(node) => {
node.format().fmt(f)
}
AnyCssContainerScrollStateQuery::CssContainerScrollStateNotQuery(node) => {
node.format().fmt(f)
}
AnyCssContainerScrollStateQuery::CssContainerScrollStateOrQuery(node) => {
node.format().fmt(f)
}
}
}
}
4 changes: 4 additions & 0 deletions crates/biome_css_formatter/src/css/any/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ pub(crate) mod container_and_combinable_query;
pub(crate) mod container_or_combinable_query;
pub(crate) mod container_query;
pub(crate) mod container_query_in_parens;
pub(crate) mod container_scroll_state_and_combinable_query;
pub(crate) mod container_scroll_state_in_parens;
pub(crate) mod container_scroll_state_or_combinable_query;
pub(crate) mod container_scroll_state_query;
pub(crate) mod container_style_and_combinable_query;
pub(crate) mod container_style_in_parens;
pub(crate) mod container_style_or_combinable_query;
Expand Down
Loading
Loading