diff --git a/crates/biome_css_analyze/src/assist/source/use_sorted_properties.rs b/crates/biome_css_analyze/src/assist/source/use_sorted_properties.rs index a184b302649f..96bab0ef84a5 100644 --- a/crates/biome_css_analyze/src/assist/source/use_sorted_properties.rs +++ b/crates/biome_css_analyze/src/assist/source/use_sorted_properties.rs @@ -242,6 +242,7 @@ impl RecessOrderMember { match &self.0 { AnyCssDeclarationOrRule::CssBogus(_) => NodeKindOrder::UnknownKind, AnyCssDeclarationOrRule::CssMetavariable(_) => NodeKindOrder::UnknownKind, + AnyCssDeclarationOrRule::ScssDeclaration(_) => NodeKindOrder::UnknownKind, AnyCssDeclarationOrRule::AnyCssRule(rule) => match rule { AnyCssRule::CssAtRule(_) => NodeKindOrder::NestedRuleOrAtRule, AnyCssRule::CssBogusRule(_) => NodeKindOrder::UnknownKind, diff --git a/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs b/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs index 94edfae600ec..d89aa7eeb483 100644 --- a/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs +++ b/crates/biome_css_analyze/src/lint/correctness/no_invalid_position_at_import_rule.rs @@ -2,7 +2,7 @@ use biome_analyze::{ Ast, Rule, RuleDiagnostic, RuleSource, context::RuleContext, declare_lint_rule, }; use biome_console::markup; -use biome_css_syntax::{AnyCssRule, CssRuleList}; +use biome_css_syntax::{AnyCssRootItem, AnyCssRule, CssRootItemList}; use biome_diagnostics::Severity; use biome_rowan::{AstNode, TextRange}; use biome_rule_options::no_invalid_position_at_import_rule::NoInvalidPositionAtImportRuleOptions; @@ -39,7 +39,7 @@ declare_lint_rule! { } impl Rule for NoInvalidPositionAtImportRule { - type Query = Ast; + type Query = Ast; type State = TextRange; type Signals = Box<[Self::State]>; type Options = NoInvalidPositionAtImportRuleOptions; @@ -49,9 +49,9 @@ impl Rule for NoInvalidPositionAtImportRule { let mut is_invalid_position = false; let mut invalid_import_list = Vec::new(); - for rule in node { - let any_css_at_rule = match rule { - AnyCssRule::CssAtRule(item) => item.rule().ok(), + for item in node { + let any_css_at_rule = match item { + AnyCssRootItem::AnyCssRule(AnyCssRule::CssAtRule(at_rule)) => at_rule.rule().ok(), _ => None, }; diff --git a/crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs b/crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs index 75baa3d7e301..38126ece0d1d 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs @@ -78,7 +78,7 @@ impl Rule for NoEmptySource { fn run(ctx: &RuleContext) -> Option { let node = ctx.query(); - if node.rules().len() > 0 { + if node.items().len() > 0 { return None; } diff --git a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs index 643f34f81a37..56d8c8f5a01b 100644 --- a/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs +++ b/crates/biome_css_analyze/src/lint/suspicious/no_duplicate_at_import_rules.rs @@ -4,7 +4,7 @@ use biome_analyze::{ Ast, Rule, RuleDiagnostic, RuleSource, context::RuleContext, declare_lint_rule, }; use biome_console::markup; -use biome_css_syntax::{AnyCssAtRule, AnyCssRule, CssImportAtRule, CssRuleList}; +use biome_css_syntax::{AnyCssAtRule, AnyCssRootItem, AnyCssRule, CssImportAtRule, CssRootItemList}; use biome_diagnostics::Severity; use biome_rowan::AstNode; use biome_rule_options::no_duplicate_at_import_rules::NoDuplicateAtImportRulesOptions; @@ -59,7 +59,7 @@ declare_lint_rule! { } impl Rule for NoDuplicateAtImportRules { - type Query = Ast; + type Query = Ast; type State = CssImportAtRule; type Signals = Option; type Options = NoDuplicateAtImportRulesOptions; @@ -67,57 +67,56 @@ impl Rule for NoDuplicateAtImportRules { fn run(ctx: &RuleContext) -> Option { let node = ctx.query(); let mut import_url_map: HashMap> = HashMap::new(); - for rule in node { - match rule { - AnyCssRule::CssAtRule(item) => match item.rule().ok()? { - AnyCssAtRule::CssImportAtRule(import_rule) => { - let import_url = import_rule - .url() - .ok()? - .to_trimmed_text() - .to_lowercase_cow() - .replace("url(", "") - .replace(')', "") - .replace('"', "'"); - if let Some(media_query_set) = import_url_map.get_mut(&import_url) { - // if the current import_rule has no media queries or there are no queries saved in the - // media_query_set, this is always a duplicate - if import_rule.media().to_trimmed_text().is_empty() - || media_query_set.is_empty() - { - return Some(import_rule); - } + for item in node { + let AnyCssRootItem::AnyCssRule(AnyCssRule::CssAtRule(at_rule)) = item else { + continue; + }; + let AnyCssAtRule::CssImportAtRule(import_rule) = at_rule.rule().ok()? else { + continue; + }; - for media in import_rule.media() { - match media { - Ok(media) => { - if !media_query_set.insert( - media.to_trimmed_text().to_lowercase_cow().into(), - ) { - return Some(import_rule); - } - } - _ => return None, - } - } - } else { - let mut media_set: HashSet = HashSet::new(); - for media in import_rule.media() { - match media { - Ok(media) => { - media_set.insert( - media.to_trimmed_text().to_lowercase_cow().into(), - ); - } - _ => return None, - } + let import_url = import_rule + .url() + .ok()? + .to_trimmed_text() + .to_lowercase_cow() + .replace("url(", "") + .replace(')', "") + .replace('"', "'"); + if let Some(media_query_set) = import_url_map.get_mut(&import_url) { + // if the current import_rule has no media queries or there are no queries saved in the + // media_query_set, this is always a duplicate + if import_rule.media().to_trimmed_text().is_empty() + || media_query_set.is_empty() + { + return Some(import_rule); + } + + for media in import_rule.media() { + match media { + Ok(media) => { + if !media_query_set.insert( + media.to_trimmed_text().to_lowercase_cow().into(), + ) { + return Some(import_rule); } - import_url_map.insert(import_url, media_set); } + _ => return None, } - _ => return None, - }, - _ => return None, + } + } else { + let mut media_set: HashSet = HashSet::new(); + for media in import_rule.media() { + match media { + Ok(media) => { + media_set.insert( + media.to_trimmed_text().to_lowercase_cow().into(), + ); + } + _ => return None, + } + } + import_url_map.insert(import_url, media_set); } } None diff --git a/crates/biome_css_factory/src/generated/node_factory.rs b/crates/biome_css_factory/src/generated/node_factory.rs index 4fb12a2512bd..df2c585243e9 100644 --- a/crates/biome_css_factory/src/generated/node_factory.rs +++ b/crates/biome_css_factory/src/generated/node_factory.rs @@ -2335,15 +2335,15 @@ pub fn css_returns_statement(returns_token: SyntaxToken, ty: AnyCssType) -> CssR ], )) } -pub fn css_root(rules: CssRuleList, eof_token: SyntaxToken) -> CssRootBuilder { +pub fn css_root(items: CssRootItemList, eof_token: SyntaxToken) -> CssRootBuilder { CssRootBuilder { - rules, + items, eof_token, bom_token: None, } } pub struct CssRootBuilder { - rules: CssRuleList, + items: CssRootItemList, eof_token: SyntaxToken, bom_token: Option, } @@ -2357,7 +2357,7 @@ impl CssRootBuilder { CssSyntaxKind::CSS_ROOT, [ self.bom_token.map(|token| SyntaxElement::Token(token)), - Some(SyntaxElement::Node(self.rules.into_syntax())), + Some(SyntaxElement::Node(self.items.into_syntax())), Some(SyntaxElement::Token(self.eof_token)), ], )) @@ -2964,6 +2964,81 @@ pub fn css_view_transition_at_rule_declarator( [Some(SyntaxElement::Token(view_transition_token))], )) } +pub fn scss_declaration( + name: AnyScssDeclarationName, + colon_token: SyntaxToken, + value: CssGenericComponentValueList, + modifiers: ScssVariableModifierList, +) -> ScssDeclarationBuilder { + ScssDeclarationBuilder { + name, + colon_token, + value, + modifiers, + semicolon_token: None, + } +} +pub struct ScssDeclarationBuilder { + name: AnyScssDeclarationName, + colon_token: SyntaxToken, + value: CssGenericComponentValueList, + modifiers: ScssVariableModifierList, + semicolon_token: Option, +} +impl ScssDeclarationBuilder { + pub fn with_semicolon_token(mut self, semicolon_token: SyntaxToken) -> Self { + self.semicolon_token = Some(semicolon_token); + self + } + pub fn build(self) -> ScssDeclaration { + ScssDeclaration::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::SCSS_DECLARATION, + [ + Some(SyntaxElement::Node(self.name.into_syntax())), + Some(SyntaxElement::Token(self.colon_token)), + Some(SyntaxElement::Node(self.value.into_syntax())), + Some(SyntaxElement::Node(self.modifiers.into_syntax())), + self.semicolon_token + .map(|token| SyntaxElement::Token(token)), + ], + )) + } +} +pub fn scss_identifier(dollar_token: SyntaxToken, name: CssIdentifier) -> ScssIdentifier { + ScssIdentifier::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::SCSS_IDENTIFIER, + [ + Some(SyntaxElement::Token(dollar_token)), + Some(SyntaxElement::Node(name.into_syntax())), + ], + )) +} +pub fn scss_namespaced_identifier( + namespace: CssIdentifier, + dot_token: SyntaxToken, + name: ScssIdentifier, +) -> ScssNamespacedIdentifier { + ScssNamespacedIdentifier::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::SCSS_NAMESPACED_IDENTIFIER, + [ + Some(SyntaxElement::Node(namespace.into_syntax())), + Some(SyntaxElement::Token(dot_token)), + Some(SyntaxElement::Node(name.into_syntax())), + ], + )) +} +pub fn scss_variable_modifier( + excl_token: SyntaxToken, + value_token: SyntaxToken, +) -> ScssVariableModifier { + ScssVariableModifier::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::SCSS_VARIABLE_MODIFIER, + [ + Some(SyntaxElement::Token(excl_token)), + Some(SyntaxElement::Token(value_token)), + ], + )) +} pub fn tw_apply_at_rule( apply_token: SyntaxToken, classes: TwApplyClassList, @@ -3728,6 +3803,18 @@ where }), )) } +pub fn css_root_item_list(items: I) -> CssRootItemList +where + I: IntoIterator, + I::IntoIter: ExactSizeIterator, +{ + CssRootItemList::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::CSS_ROOT_ITEM_LIST, + items + .into_iter() + .map(|item| Some(item.into_syntax().into())), + )) +} pub fn css_rule_list(items: I) -> CssRuleList where I: IntoIterator, @@ -3851,6 +3938,18 @@ where }), )) } +pub fn scss_variable_modifier_list(items: I) -> ScssVariableModifierList +where + I: IntoIterator, + I::IntoIter: ExactSizeIterator, +{ + ScssVariableModifierList::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::SCSS_VARIABLE_MODIFIER_LIST, + items + .into_iter() + .map(|item| Some(item.into_syntax().into())), + )) +} pub fn tw_apply_class_list(items: I) -> TwApplyClassList where I: IntoIterator, diff --git a/crates/biome_css_factory/src/generated/syntax_factory.rs b/crates/biome_css_factory/src/generated/syntax_factory.rs index b3290112214f..6bdc6de04d52 100644 --- a/crates/biome_css_factory/src/generated/syntax_factory.rs +++ b/crates/biome_css_factory/src/generated/syntax_factory.rs @@ -4791,7 +4791,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element - && CssRuleList::can_cast(element.kind()) + && CssRootItemList::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); @@ -6094,6 +6094,138 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.into_node(CSS_VIEW_TRANSITION_AT_RULE_DECLARATOR, children) } + SCSS_DECLARATION => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<5usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element + && AnyScssDeclarationName::can_cast(element.kind()) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && element.kind() == T ! [:] + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && CssGenericComponentValueList::can_cast(element.kind()) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && ScssVariableModifierList::can_cast(element.kind()) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && element.kind() == T ! [;] + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + SCSS_DECLARATION.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(SCSS_DECLARATION, children) + } + SCSS_IDENTIFIER => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element + && element.kind() == T ! [$] + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && CssIdentifier::can_cast(element.kind()) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + SCSS_IDENTIFIER.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(SCSS_IDENTIFIER, children) + } + SCSS_NAMESPACED_IDENTIFIER => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<3usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element + && CssIdentifier::can_cast(element.kind()) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && element.kind() == T ! [.] + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && ScssIdentifier::can_cast(element.kind()) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + SCSS_NAMESPACED_IDENTIFIER.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(SCSS_NAMESPACED_IDENTIFIER, children) + } + SCSS_VARIABLE_MODIFIER => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element + && element.kind() == T![!] + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if let Some(element) = ¤t_element + && matches!(element.kind(), T![default] | T![global]) + { + slots.mark_present(); + current_element = elements.next(); + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + SCSS_VARIABLE_MODIFIER.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(SCSS_VARIABLE_MODIFIER, children) + } TW_APPLY_AT_RULE => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<3usize> = RawNodeSlots::default(); @@ -6724,6 +6856,9 @@ impl SyntaxFactory for CssSyntaxFactory { T ! [,], false, ), + CSS_ROOT_ITEM_LIST => { + Self::make_node_list_syntax(kind, children, AnyCssRootItem::can_cast) + } CSS_RULE_LIST => Self::make_node_list_syntax(kind, children, AnyCssRule::can_cast), CSS_SELECTOR_LIST => Self::make_separated_list_syntax( kind, @@ -6759,6 +6894,9 @@ impl SyntaxFactory for CssSyntaxFactory { T ! [,], false, ), + SCSS_VARIABLE_MODIFIER_LIST => { + Self::make_node_list_syntax(kind, children, ScssVariableModifier::can_cast) + } TW_APPLY_CLASS_LIST => { Self::make_node_list_syntax(kind, children, CssIdentifier::can_cast) } diff --git a/crates/biome_css_formatter/src/css/any/declaration.rs b/crates/biome_css_formatter/src/css/any/declaration.rs index 5f793dbbc9b4..0f7f8405eb6b 100644 --- a/crates/biome_css_formatter/src/css/any/declaration.rs +++ b/crates/biome_css_formatter/src/css/any/declaration.rs @@ -10,6 +10,7 @@ impl FormatRule for FormatAnyCssDeclaration { match node { AnyCssDeclaration::CssDeclarationWithSemicolon(node) => node.format().fmt(f), AnyCssDeclaration::CssEmptyDeclaration(node) => node.format().fmt(f), + AnyCssDeclaration::ScssDeclaration(node) => node.format().fmt(f), } } } diff --git a/crates/biome_css_formatter/src/css/any/declaration_or_at_rule.rs b/crates/biome_css_formatter/src/css/any/declaration_or_at_rule.rs index bb558ec0d93a..1a0c58f70eaf 100644 --- a/crates/biome_css_formatter/src/css/any/declaration_or_at_rule.rs +++ b/crates/biome_css_formatter/src/css/any/declaration_or_at_rule.rs @@ -11,6 +11,7 @@ impl FormatRule for FormatAnyCssDeclarationOrAtRule { AnyCssDeclarationOrAtRule::CssAtRule(node) => node.format().fmt(f), AnyCssDeclarationOrAtRule::CssDeclarationWithSemicolon(node) => node.format().fmt(f), AnyCssDeclarationOrAtRule::CssEmptyDeclaration(node) => node.format().fmt(f), + AnyCssDeclarationOrAtRule::ScssDeclaration(node) => node.format().fmt(f), } } } diff --git a/crates/biome_css_formatter/src/css/any/declaration_or_rule.rs b/crates/biome_css_formatter/src/css/any/declaration_or_rule.rs index 5be7e15e5ae2..6884ff730e03 100644 --- a/crates/biome_css_formatter/src/css/any/declaration_or_rule.rs +++ b/crates/biome_css_formatter/src/css/any/declaration_or_rule.rs @@ -13,6 +13,7 @@ impl FormatRule for FormatAnyCssDeclarationOrRule { AnyCssDeclarationOrRule::CssDeclarationWithSemicolon(node) => node.format().fmt(f), AnyCssDeclarationOrRule::CssEmptyDeclaration(node) => node.format().fmt(f), AnyCssDeclarationOrRule::CssMetavariable(node) => node.format().fmt(f), + AnyCssDeclarationOrRule::ScssDeclaration(node) => node.format().fmt(f), } } } diff --git a/crates/biome_css_formatter/src/css/any/mod.rs b/crates/biome_css_formatter/src/css/any/mod.rs index 6552d4dfaec9..4b568c7290f0 100644 --- a/crates/biome_css_formatter/src/css/any/mod.rs +++ b/crates/biome_css_formatter/src/css/any/mod.rs @@ -76,6 +76,7 @@ pub(crate) mod query_feature; pub(crate) mod query_feature_value; pub(crate) mod relative_selector; pub(crate) mod root; +pub(crate) mod root_item; pub(crate) mod rule; pub(crate) mod rule_block; pub(crate) mod scope_range; diff --git a/crates/biome_css_formatter/src/css/any/page_at_rule_item.rs b/crates/biome_css_formatter/src/css/any/page_at_rule_item.rs index 4c690b775081..eaef76d68084 100644 --- a/crates/biome_css_formatter/src/css/any/page_at_rule_item.rs +++ b/crates/biome_css_formatter/src/css/any/page_at_rule_item.rs @@ -9,10 +9,10 @@ impl FormatRule for FormatAnyCssPageAtRuleItem { fn fmt(&self, node: &AnyCssPageAtRuleItem, f: &mut CssFormatter) -> FormatResult<()> { match node { AnyCssPageAtRuleItem::CssAtRule(node) => node.format().fmt(f), + AnyCssPageAtRuleItem::CssBogus(node) => node.format().fmt(f), AnyCssPageAtRuleItem::CssDeclarationWithSemicolon(node) => node.format().fmt(f), AnyCssPageAtRuleItem::CssEmptyDeclaration(node) => node.format().fmt(f), AnyCssPageAtRuleItem::CssMarginAtRule(node) => node.format().fmt(f), - AnyCssPageAtRuleItem::CssBogus(node) => node.format().fmt(f), } } } diff --git a/crates/biome_css_formatter/src/css/any/root_item.rs b/crates/biome_css_formatter/src/css/any/root_item.rs new file mode 100644 index 000000000000..4877c1163e52 --- /dev/null +++ b/crates/biome_css_formatter/src/css/any/root_item.rs @@ -0,0 +1,16 @@ +//! 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::AnyCssRootItem; +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatAnyCssRootItem; +impl FormatRule for FormatAnyCssRootItem { + type Context = CssFormatContext; + fn fmt(&self, node: &AnyCssRootItem, f: &mut CssFormatter) -> FormatResult<()> { + match node { + AnyCssRootItem::AnyCssRule(node) => node.format().fmt(f), + AnyCssRootItem::CssBogus(node) => node.format().fmt(f), + AnyCssRootItem::ScssDeclaration(node) => node.format().fmt(f), + } + } +} diff --git a/crates/biome_css_formatter/src/css/any/value.rs b/crates/biome_css_formatter/src/css/any/value.rs index 357183234aed..7f9ec54ef0ee 100644 --- a/crates/biome_css_formatter/src/css/any/value.rs +++ b/crates/biome_css_formatter/src/css/any/value.rs @@ -20,6 +20,7 @@ impl FormatRule for FormatAnyCssValue { AnyCssValue::CssRatio(node) => node.format().fmt(f), AnyCssValue::CssString(node) => node.format().fmt(f), AnyCssValue::CssUnicodeRange(node) => node.format().fmt(f), + AnyCssValue::ScssIdentifier(node) => node.format().fmt(f), AnyCssValue::TwValueThemeReference(node) => node.format().fmt(f), } } diff --git a/crates/biome_css_formatter/src/css/auxiliary/root.rs b/crates/biome_css_formatter/src/css/auxiliary/root.rs index 6c5e841ff6b2..27bbf208b9ce 100644 --- a/crates/biome_css_formatter/src/css/auxiliary/root.rs +++ b/crates/biome_css_formatter/src/css/auxiliary/root.rs @@ -9,11 +9,11 @@ impl FormatNodeRule for FormatCssRoot { fn fmt_fields(&self, node: &CssRoot, f: &mut CssFormatter) -> FormatResult<()> { let CssRootFields { bom_token, - rules, + items, eof_token, } = node.as_fields(); - write!(f, [bom_token.format(), rules.format()])?; + write!(f, [bom_token.format(), items.format()])?; if f.options().trailing_newline().value() { write!(f, [hard_line_break()])?; diff --git a/crates/biome_css_formatter/src/css/lists/mod.rs b/crates/biome_css_formatter/src/css/lists/mod.rs index ab2a0e29e4bf..c1c97fd585ba 100644 --- a/crates/biome_css_formatter/src/css/lists/mod.rs +++ b/crates/biome_css_formatter/src/css/lists/mod.rs @@ -29,6 +29,7 @@ pub(crate) mod parameter_list; pub(crate) mod pseudo_element_function_parameter_list; pub(crate) mod pseudo_value_list; pub(crate) mod relative_selector_list; +pub(crate) mod root_item_list; pub(crate) mod rule_list; pub(crate) mod selector_list; pub(crate) mod sub_selector_list; diff --git a/crates/biome_css_formatter/src/css/lists/root_item_list.rs b/crates/biome_css_formatter/src/css/lists/root_item_list.rs new file mode 100644 index 000000000000..929f936a3273 --- /dev/null +++ b/crates/biome_css_formatter/src/css/lists/root_item_list.rs @@ -0,0 +1,18 @@ +use crate::prelude::*; +use biome_css_syntax::CssRootItemList; +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatCssRootItemList; +impl FormatRule for FormatCssRootItemList { + type Context = CssFormatContext; + fn fmt(&self, node: &CssRootItemList, f: &mut CssFormatter) -> FormatResult<()> { + // This is one of the few cases where we _do_ want to respect empty + // lines from the input, so we can use `join_nodes_with_hardline`. + let mut join = f.join_nodes_with_hardline(); + + for rule in node { + join.entry(rule.syntax(), &format_or_verbatim(rule.format())); + } + + join.finish() + } +} diff --git a/crates/biome_css_formatter/src/generated.rs b/crates/biome_css_formatter/src/generated.rs index c44bf2dec77f..7501ff55c27c 100644 --- a/crates/biome_css_formatter/src/generated.rs +++ b/crates/biome_css_formatter/src/generated.rs @@ -6958,6 +6958,158 @@ impl IntoFormat for biome_css_syntax::CssViewTransitionAtRuleD FormatOwnedWithRule :: new (self , crate :: css :: auxiliary :: view_transition_at_rule_declarator :: FormatCssViewTransitionAtRuleDeclarator :: default ()) } } +impl FormatRule + for crate::scss::auxiliary::declaration::FormatScssDeclaration +{ + type Context = CssFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_css_syntax::ScssDeclaration, + f: &mut CssFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_css_syntax::ScssDeclaration { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::ScssDeclaration, + crate::scss::auxiliary::declaration::FormatScssDeclaration, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::scss::auxiliary::declaration::FormatScssDeclaration::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::ScssDeclaration { + type Format = FormatOwnedWithRule< + biome_css_syntax::ScssDeclaration, + crate::scss::auxiliary::declaration::FormatScssDeclaration, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::scss::auxiliary::declaration::FormatScssDeclaration::default(), + ) + } +} +impl FormatRule + for crate::scss::value::identifier::FormatScssIdentifier +{ + type Context = CssFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_css_syntax::ScssIdentifier, + f: &mut CssFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_css_syntax::ScssIdentifier { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::ScssIdentifier, + crate::scss::value::identifier::FormatScssIdentifier, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::scss::value::identifier::FormatScssIdentifier::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::ScssIdentifier { + type Format = FormatOwnedWithRule< + biome_css_syntax::ScssIdentifier, + crate::scss::value::identifier::FormatScssIdentifier, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::scss::value::identifier::FormatScssIdentifier::default(), + ) + } +} +impl FormatRule + for crate::scss::value::namespaced_identifier::FormatScssNamespacedIdentifier +{ + type Context = CssFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_css_syntax::ScssNamespacedIdentifier, + f: &mut CssFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_css_syntax::ScssNamespacedIdentifier { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::ScssNamespacedIdentifier, + crate::scss::value::namespaced_identifier::FormatScssNamespacedIdentifier, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::scss::value::namespaced_identifier::FormatScssNamespacedIdentifier::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::ScssNamespacedIdentifier { + type Format = FormatOwnedWithRule< + biome_css_syntax::ScssNamespacedIdentifier, + crate::scss::value::namespaced_identifier::FormatScssNamespacedIdentifier, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::scss::value::namespaced_identifier::FormatScssNamespacedIdentifier::default(), + ) + } +} +impl FormatRule + for crate::scss::auxiliary::variable_modifier::FormatScssVariableModifier +{ + type Context = CssFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_css_syntax::ScssVariableModifier, + f: &mut CssFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_css_syntax::ScssVariableModifier { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::ScssVariableModifier, + crate::scss::auxiliary::variable_modifier::FormatScssVariableModifier, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::scss::auxiliary::variable_modifier::FormatScssVariableModifier::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::ScssVariableModifier { + type Format = FormatOwnedWithRule< + biome_css_syntax::ScssVariableModifier, + crate::scss::auxiliary::variable_modifier::FormatScssVariableModifier, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::scss::auxiliary::variable_modifier::FormatScssVariableModifier::default(), + ) + } +} impl FormatRule for crate::tailwind::statements::apply_at_rule::FormatTwApplyAtRule { @@ -8140,6 +8292,31 @@ impl IntoFormat for biome_css_syntax::CssRelativeSelectorList ) } } +impl AsFormat for biome_css_syntax::CssRootItemList { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::CssRootItemList, + crate::css::lists::root_item_list::FormatCssRootItemList, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::css::lists::root_item_list::FormatCssRootItemList::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::CssRootItemList { + type Format = FormatOwnedWithRule< + biome_css_syntax::CssRootItemList, + crate::css::lists::root_item_list::FormatCssRootItemList, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::css::lists::root_item_list::FormatCssRootItemList::default(), + ) + } +} impl AsFormat for biome_css_syntax::CssRuleList { type Format<'a> = FormatRefWithRule< 'a, @@ -8296,6 +8473,31 @@ impl IntoFormat for biome_css_syntax::CssValueAtRulePropertyLi FormatOwnedWithRule :: new (self , crate :: css :: lists :: value_at_rule_property_list :: FormatCssValueAtRulePropertyList :: default ()) } } +impl AsFormat for biome_css_syntax::ScssVariableModifierList { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::ScssVariableModifierList, + crate::scss::lists::variable_modifier_list::FormatScssVariableModifierList, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::scss::lists::variable_modifier_list::FormatScssVariableModifierList::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::ScssVariableModifierList { + type Format = FormatOwnedWithRule< + biome_css_syntax::ScssVariableModifierList, + crate::scss::lists::variable_modifier_list::FormatScssVariableModifierList, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::scss::lists::variable_modifier_list::FormatScssVariableModifierList::default(), + ) + } +} impl AsFormat for biome_css_syntax::TwApplyClassList { type Format<'a> = FormatRefWithRule< 'a, @@ -11396,6 +11598,31 @@ impl IntoFormat for biome_css_syntax::AnyCssRoot { FormatOwnedWithRule::new(self, crate::css::any::root::FormatAnyCssRoot::default()) } } +impl AsFormat for biome_css_syntax::AnyCssRootItem { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::AnyCssRootItem, + crate::css::any::root_item::FormatAnyCssRootItem, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::css::any::root_item::FormatAnyCssRootItem::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::AnyCssRootItem { + type Format = FormatOwnedWithRule< + biome_css_syntax::AnyCssRootItem, + crate::css::any::root_item::FormatAnyCssRootItem, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::css::any::root_item::FormatAnyCssRootItem::default(), + ) + } +} impl AsFormat for biome_css_syntax::AnyCssRule { type Format<'a> = FormatRefWithRule< 'a, @@ -11907,6 +12134,31 @@ impl IntoFormat for biome_css_syntax::AnyCssValueAtRulePropert ) } } +impl AsFormat for biome_css_syntax::AnyScssDeclarationName { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::AnyScssDeclarationName, + crate::scss::any::declaration_name::FormatAnyScssDeclarationName, + >; + fn format(&self) -> Self::Format<'_> { + FormatRefWithRule::new( + self, + crate::scss::any::declaration_name::FormatAnyScssDeclarationName::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::AnyScssDeclarationName { + type Format = FormatOwnedWithRule< + biome_css_syntax::AnyScssDeclarationName, + crate::scss::any::declaration_name::FormatAnyScssDeclarationName, + >; + fn into_format(self) -> Self::Format { + FormatOwnedWithRule::new( + self, + crate::scss::any::declaration_name::FormatAnyScssDeclarationName::default(), + ) + } +} impl AsFormat for biome_css_syntax::AnyTwCustomVariantSelector { type Format<'a> = FormatRefWithRule< 'a, diff --git a/crates/biome_css_formatter/src/lib.rs b/crates/biome_css_formatter/src/lib.rs index a3964f7b601c..7d2bcee47d1a 100644 --- a/crates/biome_css_formatter/src/lib.rs +++ b/crates/biome_css_formatter/src/lib.rs @@ -6,6 +6,7 @@ mod css; mod cst; mod generated; mod prelude; +mod scss; mod separated; mod tailwind; mod trivia; diff --git a/crates/biome_css_formatter/src/scss/any/declaration_name.rs b/crates/biome_css_formatter/src/scss/any/declaration_name.rs new file mode 100644 index 000000000000..14e96e5ff431 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/any/declaration_name.rs @@ -0,0 +1,15 @@ +//! 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::AnyScssDeclarationName; +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatAnyScssDeclarationName; +impl FormatRule for FormatAnyScssDeclarationName { + type Context = CssFormatContext; + fn fmt(&self, node: &AnyScssDeclarationName, f: &mut CssFormatter) -> FormatResult<()> { + match node { + AnyScssDeclarationName::ScssIdentifier(node) => node.format().fmt(f), + AnyScssDeclarationName::ScssNamespacedIdentifier(node) => node.format().fmt(f), + } + } +} diff --git a/crates/biome_css_formatter/src/scss/any/mod.rs b/crates/biome_css_formatter/src/scss/any/mod.rs new file mode 100644 index 000000000000..859c41d9f77f --- /dev/null +++ b/crates/biome_css_formatter/src/scss/any/mod.rs @@ -0,0 +1,3 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +pub(crate) mod declaration_name; diff --git a/crates/biome_css_formatter/src/scss/auxiliary/declaration.rs b/crates/biome_css_formatter/src/scss/auxiliary/declaration.rs new file mode 100644 index 000000000000..13b8ac73420f --- /dev/null +++ b/crates/biome_css_formatter/src/scss/auxiliary/declaration.rs @@ -0,0 +1,29 @@ +use crate::prelude::*; +use biome_css_syntax::{ScssDeclaration, ScssDeclarationFields}; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatScssDeclaration; + +impl FormatNodeRule for FormatScssDeclaration { + fn fmt_fields(&self, node: &ScssDeclaration, f: &mut CssFormatter) -> FormatResult<()> { + let ScssDeclarationFields { + name, + colon_token, + value, + modifiers, + semicolon_token, + } = node.as_fields(); + + write!( + f, + [name.format(), colon_token.format(), space(), value.format(),] + )?; + + if !modifiers.is_empty() { + write!(f, [modifiers.format()])?; + } + + write!(f, [semicolon_token.format()]) + } +} diff --git a/crates/biome_css_formatter/src/scss/auxiliary/mod.rs b/crates/biome_css_formatter/src/scss/auxiliary/mod.rs new file mode 100644 index 000000000000..cb5948b72b73 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/auxiliary/mod.rs @@ -0,0 +1,4 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +pub(crate) mod declaration; +pub(crate) mod variable_modifier; diff --git a/crates/biome_css_formatter/src/scss/auxiliary/variable_modifier.rs b/crates/biome_css_formatter/src/scss/auxiliary/variable_modifier.rs new file mode 100644 index 000000000000..8b1d612ad826 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/auxiliary/variable_modifier.rs @@ -0,0 +1,14 @@ +use crate::prelude::*; +use biome_css_syntax::{ScssVariableModifier, ScssVariableModifierFields}; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatScssVariableModifier; + +impl FormatNodeRule for FormatScssVariableModifier { + fn fmt_fields(&self, node: &ScssVariableModifier, f: &mut CssFormatter) -> FormatResult<()> { + let ScssVariableModifierFields { excl_token, value } = node.as_fields(); + + write!(f, [excl_token.format(), value.format()]) + } +} diff --git a/crates/biome_css_formatter/src/scss/lists/mod.rs b/crates/biome_css_formatter/src/scss/lists/mod.rs new file mode 100644 index 000000000000..4dda0d9037b5 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/lists/mod.rs @@ -0,0 +1,3 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +pub(crate) mod variable_modifier_list; diff --git a/crates/biome_css_formatter/src/scss/lists/variable_modifier_list.rs b/crates/biome_css_formatter/src/scss/lists/variable_modifier_list.rs new file mode 100644 index 000000000000..400c02393338 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/lists/variable_modifier_list.rs @@ -0,0 +1,26 @@ +use crate::prelude::*; +use biome_css_syntax::ScssVariableModifierList; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatScssVariableModifierList; + +impl FormatRule for FormatScssVariableModifierList { + type Context = CssFormatContext; + fn fmt(&self, node: &ScssVariableModifierList, f: &mut CssFormatter) -> FormatResult<()> { + // Format in the correct order: !default, then !global, then unknown/rest + for modifier in node.iter().filter(|m| m.is_default()) { + write!(f, [space(), modifier.format()])?; + } + + for modifier in node.iter().filter(|m| m.is_global()) { + write!(f, [space(), modifier.format()])?; + } + + for modifier in node.iter().filter(|m| m.is_unknown()) { + write!(f, [space(), modifier.format()])?; + } + + Ok(()) + } +} diff --git a/crates/biome_css_formatter/src/scss/mod.rs b/crates/biome_css_formatter/src/scss/mod.rs new file mode 100644 index 000000000000..121bb0090165 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/mod.rs @@ -0,0 +1,6 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +pub(crate) mod any; +pub(crate) mod auxiliary; +pub(crate) mod lists; +pub(crate) mod value; diff --git a/crates/biome_css_formatter/src/scss/value/identifier.rs b/crates/biome_css_formatter/src/scss/value/identifier.rs new file mode 100644 index 000000000000..325ae00ab6ab --- /dev/null +++ b/crates/biome_css_formatter/src/scss/value/identifier.rs @@ -0,0 +1,14 @@ +use crate::prelude::*; +use biome_css_syntax::{ScssIdentifier, ScssIdentifierFields}; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatScssIdentifier; + +impl FormatNodeRule for FormatScssIdentifier { + fn fmt_fields(&self, node: &ScssIdentifier, f: &mut CssFormatter) -> FormatResult<()> { + let ScssIdentifierFields { dollar_token, name } = node.as_fields(); + + write!(f, [dollar_token.format(), name.format()]) + } +} diff --git a/crates/biome_css_formatter/src/scss/value/mod.rs b/crates/biome_css_formatter/src/scss/value/mod.rs new file mode 100644 index 000000000000..3c3e80ecb96d --- /dev/null +++ b/crates/biome_css_formatter/src/scss/value/mod.rs @@ -0,0 +1,4 @@ +//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. + +pub(crate) mod identifier; +pub(crate) mod namespaced_identifier; diff --git a/crates/biome_css_formatter/src/scss/value/namespaced_identifier.rs b/crates/biome_css_formatter/src/scss/value/namespaced_identifier.rs new file mode 100644 index 000000000000..a799d127c110 --- /dev/null +++ b/crates/biome_css_formatter/src/scss/value/namespaced_identifier.rs @@ -0,0 +1,22 @@ +use crate::prelude::*; +use biome_css_syntax::{ScssNamespacedIdentifier, ScssNamespacedIdentifierFields}; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatScssNamespacedIdentifier; + +impl FormatNodeRule for FormatScssNamespacedIdentifier { + fn fmt_fields( + &self, + node: &ScssNamespacedIdentifier, + f: &mut CssFormatter, + ) -> FormatResult<()> { + let ScssNamespacedIdentifierFields { + namespace, + dot_token, + name, + } = node.as_fields(); + + write!(f, [namespace.format(), dot_token.format(), name.format()]) + } +} diff --git a/crates/biome_css_formatter/tests/language.rs b/crates/biome_css_formatter/tests/language.rs index 129f8175712c..03060984907e 100644 --- a/crates/biome_css_formatter/tests/language.rs +++ b/crates/biome_css_formatter/tests/language.rs @@ -10,11 +10,16 @@ use biome_service::{ workspace::DocumentFileSource, }; -#[derive(Default)] pub struct CssTestFormatLanguage { source_type: CssFileSource, } +impl CssTestFormatLanguage { + pub fn new(source_type: CssFileSource) -> Self { + Self { source_type } + } +} + impl TestFormatLanguage for CssTestFormatLanguage { type ServiceLanguage = CssLanguage; type Context = CssFormatContext; diff --git a/crates/biome_css_formatter/tests/prettier_tests.rs b/crates/biome_css_formatter/tests/prettier_tests.rs index d254c2fa5f72..c81f6e6316e2 100644 --- a/crates/biome_css_formatter/tests/prettier_tests.rs +++ b/crates/biome_css_formatter/tests/prettier_tests.rs @@ -1,4 +1,5 @@ use biome_css_formatter::{CssFormatLanguage, context::CssFormatOptions}; +use biome_css_syntax::CssFileSource; use biome_formatter::{IndentStyle, IndentWidth}; use biome_formatter_test::test_prettier_snapshot::{PrettierSnapshot, PrettierTestFile}; use camino::Utf8Path; @@ -20,7 +21,14 @@ fn test_snapshot(input: &'static str, _: &str, _: &str, _: &str) { let options = CssFormatOptions::default() .with_indent_style(IndentStyle::Space) .with_indent_width(IndentWidth::default()); - let language = language::CssTestFormatLanguage::default(); + let source_type = { + if test_file.file_extension() == "scss" { + CssFileSource::scss() + } else { + CssFileSource::css() + } + }; + let language = language::CssTestFormatLanguage::new(source_type); let snapshot = PrettierSnapshot::new(test_file, language, CssFormatLanguage::new(options)); snapshot.test() diff --git a/crates/biome_css_formatter/tests/quick_test.rs b/crates/biome_css_formatter/tests/quick_test.rs index 47bbcbf3054b..ca5200e67aea 100644 --- a/crates/biome_css_formatter/tests/quick_test.rs +++ b/crates/biome_css_formatter/tests/quick_test.rs @@ -14,13 +14,16 @@ mod language { // use this test check if your snippet prints as you wish, without using a snapshot fn quick_test() { let src = r#" -.container {& [lang="ru"] { - color: blue; - } } +.component { + $global-var: modified !global; + $another-var: value !default!global; + $third-var:value!global!default!default; + color: $global-var; +} "#; - let parse = parse_css(src, CssFileSource::css(), CssParserOptions::default()); + let parse = parse_css(src, CssFileSource::scss(), CssParserOptions::default()); println!("{parse:#?}"); let options = CssFormatOptions::default() @@ -31,7 +34,7 @@ fn quick_test() { let result = doc.print().unwrap(); let root = &parse.syntax(); - let language = language::CssTestFormatLanguage::default(); + let language = language::CssTestFormatLanguage::new(CssFileSource::scss()); println!("{}", doc.into_document()); eprintln!("{}", result.as_code()); diff --git a/crates/biome_css_formatter/tests/spec_test.rs b/crates/biome_css_formatter/tests/spec_test.rs index 1c094617b182..98204b224b7c 100644 --- a/crates/biome_css_formatter/tests/spec_test.rs +++ b/crates/biome_css_formatter/tests/spec_test.rs @@ -1,6 +1,7 @@ use biome_configuration::css::CssFormatterConfiguration; use biome_configuration::{Configuration, CssConfiguration}; use biome_css_formatter::{CssFormatLanguage, context::CssFormatOptions}; +use biome_css_syntax::CssFileSource; use biome_formatter_test::spec::{SpecSnapshot, SpecTestFile}; use biome_service::workspace::UpdateSettingsParams; use camino::Utf8Path; @@ -51,8 +52,9 @@ pub fn run(spec_input_file: &str, _expected_file: &str, test_directory: &str, _f return; }; + let source_type: CssFileSource = test_file.input_file().as_path().try_into().unwrap(); let options = CssFormatOptions::default(); - let language = language::CssTestFormatLanguage::default(); + let language = language::CssTestFormatLanguage::new(source_type); let snapshot = SpecSnapshot::new( test_file, diff --git a/crates/biome_css_formatter/tests/spec_tests.rs b/crates/biome_css_formatter/tests/spec_tests.rs index a546881a2712..e1349d9a3d54 100644 --- a/crates/biome_css_formatter/tests/spec_tests.rs +++ b/crates/biome_css_formatter/tests/spec_tests.rs @@ -3,6 +3,6 @@ mod spec_test; mod formatter { mod css_module { - tests_macros::gen_tests! {"tests/specs/css/**/*.css", crate::spec_test::run, ""} + tests_macros::gen_tests! {"tests/specs/css/**/*.{css,scss}", crate::spec_test::run, ""} } } diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/global-flag.scss b/crates/biome_css_formatter/tests/specs/css/scss/declaration/global-flag.scss new file mode 100644 index 000000000000..54522b954d85 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/global-flag.scss @@ -0,0 +1,13 @@ +$global-var:initial; + +.component { + $global-var: + modified !global; + $another-var: value !default !global; + $third-var:value!global!default; + $fourth-var:test!default!global!default; + $fifth-var : value + + !global !default; + color: $global-var; +} diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/global-flag.scss.snap b/crates/biome_css_formatter/tests/specs/css/scss/declaration/global-flag.scss.snap new file mode 100644 index 000000000000..7068c23bba82 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/global-flag.scss.snap @@ -0,0 +1,52 @@ +--- +source: crates/biome_formatter_test/src/snapshot_builder.rs +info: css/scss/declaration/global-flag.scss +--- +# Input + +```scss +$global-var:initial; + +.component { + $global-var: + modified !global; + $another-var: value !default !global; + $third-var:value!global!default; + $fourth-var:test!default!global!default; + $fifth-var : value + + !global !default; + color: $global-var; +} + +``` + + +============================= + +# Outputs + +## Output 1 + +----- +Indent style: Tab +Indent width: 2 +Line ending: LF +Line width: 80 +Quote style: Double Quotes +Trailing newline: true +----- + +```scss +$global-var: initial; + +.component { + $global-var: modified !global; + $another-var: value !default !global; + $third-var: value !default !global; + $fourth-var: test !default !default !global; + $fifth-var: value !default !global; + color: $global-var; +} + +``` diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/mixed.scss b/crates/biome_css_formatter/tests/specs/css/scss/declaration/mixed.scss new file mode 100644 index 000000000000..5b059e275b3e --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/mixed.scss @@ -0,0 +1,10 @@ +.example { + $local-var: 10px; + ns.$namespaced-var: 20px; + $default-var: red !default; + $global-var:blue!global; + $combined:green!global!default!global; + + padding: $local-var; + margin: ns.$namespaced-var; +} diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/mixed.scss.snap b/crates/biome_css_formatter/tests/specs/css/scss/declaration/mixed.scss.snap new file mode 100644 index 000000000000..0f4326cdd939 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/mixed.scss.snap @@ -0,0 +1,49 @@ +--- +source: crates/biome_formatter_test/src/snapshot_builder.rs +info: css/scss/declaration/mixed.scss +--- +# Input + +```scss +.example { + $local-var: 10px; + ns.$namespaced-var: 20px; + $default-var: red !default; + $global-var:blue!global; + $combined:green!global!default!global; + + padding: $local-var; + margin: ns.$namespaced-var; +} + +``` + + +============================= + +# Outputs + +## Output 1 + +----- +Indent style: Tab +Indent width: 2 +Line ending: LF +Line width: 80 +Quote style: Double Quotes +Trailing newline: true +----- + +```scss +.example { + $local-var: 10px; + ns.$namespaced-var: 20px; + $default-var: red !default; + $global-var: blue !global; + $combined: green !default !global !global; + + padding: $local-var; + margin: ns.$namespaced-var; +} + +``` diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/namespaced.scss b/crates/biome_css_formatter/tests/specs/css/scss/declaration/namespaced.scss new file mode 100644 index 000000000000..1fd9339e6b84 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/namespaced.scss @@ -0,0 +1,6 @@ +ns.$var: value; +namespace.$primary-color:#ff0000; + +config.$theme-color : + + blue ; diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/namespaced.scss.snap b/crates/biome_css_formatter/tests/specs/css/scss/declaration/namespaced.scss.snap new file mode 100644 index 000000000000..8e37657ebf17 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/namespaced.scss.snap @@ -0,0 +1,39 @@ +--- +source: crates/biome_formatter_test/src/snapshot_builder.rs +info: css/scss/declaration/namespaced.scss +--- +# Input + +```scss +ns.$var: value; +namespace.$primary-color:#ff0000; + +config.$theme-color : + + blue ; + +``` + + +============================= + +# Outputs + +## Output 1 + +----- +Indent style: Tab +Indent width: 2 +Line ending: LF +Line width: 80 +Quote style: Double Quotes +Trailing newline: true +----- + +```scss +ns.$var: value; +namespace.$primary-color: #ff0000; + +config.$theme-color: blue; + +``` diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/simple-variable.scss b/crates/biome_css_formatter/tests/specs/css/scss/declaration/simple-variable.scss new file mode 100644 index 000000000000..ec0f1cf27731 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/simple-variable.scss @@ -0,0 +1,5 @@ +$primary-color: #ff0000; + +$secondary-color : + #00ff00 ; +$font-size:16px; diff --git a/crates/biome_css_formatter/tests/specs/css/scss/declaration/simple-variable.scss.snap b/crates/biome_css_formatter/tests/specs/css/scss/declaration/simple-variable.scss.snap new file mode 100644 index 000000000000..7b9713a195a3 --- /dev/null +++ b/crates/biome_css_formatter/tests/specs/css/scss/declaration/simple-variable.scss.snap @@ -0,0 +1,38 @@ +--- +source: crates/biome_formatter_test/src/snapshot_builder.rs +info: css/scss/declaration/simple-variable.scss +--- +# Input + +```scss +$primary-color: #ff0000; + +$secondary-color : + #00ff00 ; +$font-size:16px; + +``` + + +============================= + +# Outputs + +## Output 1 + +----- +Indent style: Tab +Indent width: 2 +Line ending: LF +Line width: 80 +Quote style: Double Quotes +Trailing newline: true +----- + +```scss +$primary-color: #ff0000; + +$secondary-color: #00ff00; +$font-size: 16px; + +``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/debug.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/debug.css.snap index ab140e11a196..d2d14312b6e7 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/debug.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/debug.css.snap @@ -80,29 +80,6 @@ info: css/atrule/debug.css @debug $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var; ``` -# Errors -``` -debug.css:22:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ ; - > 22 │ @debug $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var; - │ ^ - 23 │ - -debug.css:22:95 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ ; - > 22 │ @debug $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var; - │ ^ - 23 │ - - -``` - # Lines exceeding max width of 80 characters ``` 15: @debug $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var; diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/each.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/each.css.snap index 29ac5b590405..f225cd32afd3 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/each.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/each.css.snap @@ -696,455 +696,6 @@ h3 } ``` -# Errors -``` -each.css:1:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - > 1 │ @each $animal in puma, sea-slug, egret, salamander {} - │ ^ - 2 │ @each $animal in puma,sea-slug,egret,salamander{} - 3 │ @each $animal in puma , sea-slug , egret , salamander {} - -each.css:2:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @each $animal in puma, sea-slug, egret, salamander {} - > 2 │ @each $animal in puma,sea-slug,egret,salamander{} - │ ^ - 3 │ @each $animal in puma , sea-slug , egret , salamander {} - 4 │ @each $animal in - -each.css:3:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @each $animal in puma, sea-slug, egret, salamander {} - 2 │ @each $animal in puma,sea-slug,egret,salamander{} - > 3 │ @each $animal in puma , sea-slug , egret , salamander {} - │ ^ - 4 │ @each $animal in - 5 │ puma, sea-slug, egret, salamander {} - -each.css:4:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 2 │ @each $animal in puma,sea-slug,egret,salamander{} - 3 │ @each $animal in puma , sea-slug , egret , salamander {} - > 4 │ @each $animal in - │ ^ - 5 │ puma, sea-slug, egret, salamander {} - 6 │ @each - -each.css:7:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 5 │ puma, sea-slug, egret, salamander {} - 6 │ @each - > 7 │ $animal - │ ^ - 8 │ in - 9 │ puma - -each.css:19:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 17 │ } - 18 │ @each - > 19 │ $animal - │ ^ - 20 │ in - 21 │ puma - -each.css:32:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 30 │ @each - 31 │ - > 32 │ $animal - │ ^ - 33 │ - 34 │ in - -each.css:53:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 52 │ } - > 53 │ @each $animal in ((puma), (sea-slug), (egret), (salamander)) {} - │ ^ - 54 │ @each $animal in((puma),(sea-slug),(egret),(salamander)){} - 55 │ @each $animal in ( ( puma ) , ( sea-slug ) , ( egret ) , ( salamander ) ) {} - -each.css:54:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 52 │ } - 53 │ @each $animal in ((puma), (sea-slug), (egret), (salamander)) {} - > 54 │ @each $animal in((puma),(sea-slug),(egret),(salamander)){} - │ ^ - 55 │ @each $animal in ( ( puma ) , ( sea-slug ) , ( egret ) , ( salamander ) ) {} - 56 │ @each $animal - -each.css:55:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 53 │ @each $animal in ((puma), (sea-slug), (egret), (salamander)) {} - 54 │ @each $animal in((puma),(sea-slug),(egret),(salamander)){} - > 55 │ @each $animal in ( ( puma ) , ( sea-slug ) , ( egret ) , ( salamander ) ) {} - │ ^ - 56 │ @each $animal - 57 │ in ((puma), (sea-slug), (egret), (salamander)) {} - -each.css:56:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 54 │ @each $animal in((puma),(sea-slug),(egret),(salamander)){} - 55 │ @each $animal in ( ( puma ) , ( sea-slug ) , ( egret ) , ( salamander ) ) {} - > 56 │ @each $animal - │ ^ - 57 │ in ((puma), (sea-slug), (egret), (salamander)) {} - 58 │ @each - -each.css:59:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 57 │ in ((puma), (sea-slug), (egret), (salamander)) {} - 58 │ @each - > 59 │ $animal - │ ^ - 60 │ in ( - 61 │ (puma), - -each.css:67:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 65 │ ) { } - 66 │ @each - > 67 │ $animal - │ ^ - 68 │ in - 69 │ ( - -each.css:90:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ @each - 89 │ - > 90 │ $animal - │ ^ - 91 │ - 92 │ in - -each.css:131:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 130 │ } - > 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - │ ^ - 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - 133 │ @each $animal, $color, $cursor in - -each.css:131:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 130 │ } - > 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - │ ^ - 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - 133 │ @each $animal, $color, $cursor in - -each.css:131:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 130 │ } - > 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - │ ^ - 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - 133 │ @each $animal, $color, $cursor in - -each.css:132:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 130 │ } - 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - > 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - │ ^ - 133 │ @each $animal, $color, $cursor in - 134 │ (puma, black, default), - -each.css:132:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 130 │ } - 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - > 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - │ ^ - 133 │ @each $animal, $color, $cursor in - 134 │ (puma, black, default), - -each.css:132:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 130 │ } - 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - > 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - │ ^ - 133 │ @each $animal, $color, $cursor in - 134 │ (puma, black, default), - -each.css:133:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - > 133 │ @each $animal, $color, $cursor in - │ ^ - 134 │ (puma, black, default), - 135 │ (sea-slug, blue, pointer), - -each.css:133:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - > 133 │ @each $animal, $color, $cursor in - │ ^ - 134 │ (puma, black, default), - 135 │ (sea-slug, blue, pointer), - -each.css:133:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 131 │ @each $animal, $color, $cursor in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - 132 │ @each $animal,$color,$cursor in (puma,black,default),(sea-slug,blue,pointer),(egret,white,move){} - > 133 │ @each $animal, $color, $cursor in - │ ^ - 134 │ (puma, black, default), - 135 │ (sea-slug, blue, pointer), - -each.css:137:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 135 │ (sea-slug, blue, pointer), - 136 │ (egret, white, move) {} - > 137 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var in puma, sea-slug, egret, salamander {} - │ ^ - 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - -each.css:138:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 136 │ (egret, white, move) {} - 137 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var in puma, sea-slug, egret, salamander {} - > 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - │ ^ - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - -each.css:138:93 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 136 │ (egret, white, move) {} - 137 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var in puma, sea-slug, egret, salamander {} - > 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - │ ^ - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - -each.css:138:180 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 136 │ (egret, white, move) {} - 137 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var in puma, sea-slug, egret, salamander {} - > 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - │ ^ - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - -each.css:139:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 137 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var in puma, sea-slug, egret, salamander {} - 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - > 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - │ ^ - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - -each.css:139:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 137 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var in puma, sea-slug, egret, salamander {} - 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - > 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - │ ^ - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - -each.css:140:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - > 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - │ ^ - 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - 142 │ @each $element, - -each.css:140:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 138 │ @each $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 in (puma, black, default), (sea-slug, blue, pointer), (egret, white, move) {} - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - > 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - │ ^ - 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - 142 │ @each $element, - -each.css:141:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - > 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - │ ^ - 142 │ @each $element, - 143 │ $size in (h1: 20px, h2: 16px, h3: 14px) {} - -each.css:141:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @each $element, $size in (h1: 20px, h2: 16px, h3: 14px) {} - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - > 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - │ ^ - 142 │ @each $element, - 143 │ $size in (h1: 20px, h2: 16px, h3: 14px) {} - -each.css:142:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 140 │ @each $element,$size in(h1:20px,h2:16px,h3:14px){} - 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - > 142 │ @each $element, - │ ^ - 143 │ $size in (h1: 20px, h2: 16px, h3: 14px) {} - 144 │ @each - -each.css:143:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 141 │ @each $element , $size in ( h1 : 20px , h2 : 16px , h3 : 14px ) {} - 142 │ @each $element, - > 143 │ $size in (h1: 20px, h2: 16px, h3: 14px) {} - │ ^ - 144 │ @each - 145 │ $element, - -each.css:145:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 143 │ $size in (h1: 20px, h2: 16px, h3: 14px) {} - 144 │ @each - > 145 │ $element, - │ ^ - 146 │ $size - 147 │ in - -each.css:146:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 144 │ @each - 145 │ $element, - > 146 │ $size - │ ^ - 147 │ in - 148 │ ( - -each.css:164:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 162 │ } - 163 │ @each - > 164 │ $element, - │ ^ - 165 │ $size - 166 │ in - -each.css:165:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 163 │ @each - 164 │ $element, - > 165 │ $size - │ ^ - 166 │ in - 167 │ ( - -each.css:183:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 181 │ } - 182 │ @each - > 183 │ $element, - │ ^ - 184 │ - 185 │ $size - -each.css:185:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 183 │ $element, - 184 │ - > 185 │ $size - │ ^ - 186 │ - 187 │ in - - -``` - # Lines exceeding max width of 80 characters ``` 52: @each $animal in ( ( puma ) , ( sea-slug ) , ( egret ) , ( salamander ) ) { diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/for.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/for.css.snap index 1adb6e8872f5..e66ad1148ade 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/for.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/for.css.snap @@ -195,310 +195,6 @@ through } ``` -# Errors -``` -for.css:1:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - > 1 │ @for $i from 1 through 8 {} - │ ^ - 2 │ @for $i from 1 through 8{} - 3 │ @for $i from 1 through 8 {} - -for.css:2:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @for $i from 1 through 8 {} - > 2 │ @for $i from 1 through 8{} - │ ^ - 3 │ @for $i from 1 through 8 {} - 4 │ @for $i - -for.css:3:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @for $i from 1 through 8 {} - 2 │ @for $i from 1 through 8{} - > 3 │ @for $i from 1 through 8 {} - │ ^ - 4 │ @for $i - 5 │ from - -for.css:4:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 2 │ @for $i from 1 through 8{} - 3 │ @for $i from 1 through 8 {} - > 4 │ @for $i - │ ^ - 5 │ from - 6 │ 1 - -for.css:11:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 9 │ {} - 10 │ @for - > 11 │ $i - │ ^ - 12 │ from - 13 │ 1 - -for.css:18:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 16 │ {} - 17 │ @for - > 18 │ $i - │ ^ - 19 │ from - 20 │ 1 - -for.css:26:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 24 │ @for - 25 │ - > 26 │ $i - │ ^ - 27 │ - 28 │ from - -for.css:37:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 36 │ {} - > 37 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from 1 through 5 {} - │ ^ - 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - -for.css:38:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 36 │ {} - 37 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from 1 through 5 {} - > 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - │ ^ - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - -for.css:38:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 36 │ {} - 37 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from 1 through 5 {} - > 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - │ ^ - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - -for.css:39:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 37 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from 1 through 5 {} - 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - > 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - -for.css:39:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 37 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from 1 through 5 {} - 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - > 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - -for.css:40:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - -for.css:40:96 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - -for.css:40:190 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 38 │ @for $i from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through 5 {} - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - -for.css:41:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - -for.css:41:96 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - -for.css:41:186 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 39 │ @for $i from 1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - │ ^ - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - -for.css:42:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - │ ^ - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - 44 │ - -for.css:42:97 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - │ ^ - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - 44 │ - -for.css:42:105 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - │ ^ - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - 44 │ - -for.css:42:121 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - │ ^ - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - 44 │ - -for.css:42:130 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 40 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 through $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - > 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - │ ^ - 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - 44 │ - -for.css:43:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - > 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - │ ^ - 44 │ - -for.css:43:97 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - > 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - │ ^ - 44 │ - -for.css:43:185 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - > 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - │ ^ - 44 │ - -for.css:43:281 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - > 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - │ ^ - 44 │ - -for.css:43:370 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 41 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 end $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 {} - 42 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($var1 + $var1) through ($var-2 + $var-2) {} - > 43 │ @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var1) through ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2 + $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var-2) {} - │ ^ - 44 │ - - -``` - # Lines exceeding max width of 80 characters ``` 35: @for $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var from 1 through 5 { diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/function.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/function.css.snap index 6bdfc4de6b09..4369f620a7b2 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/function.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/function.css.snap @@ -228,385 +228,732 @@ $args ``` function.css:1:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { - │ ^ + │ ^^^^ + 2 │ @return "Func"; + 3 │ } + + i Expected a function parameter here. + + > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { + │ ^^^^ 2 │ @return "Func"; 3 │ } function.css:1:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { - │ ^ + │ ^^^^^ + 2 │ @return "Func"; + 3 │ } + + i Expected a function parameter here. + + > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { + │ ^^^^^ 2 │ @return "Func"; 3 │ } function.css:1:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2: 10'. + + > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { + │ ^^^^^^^^^ + 2 │ @return "Func"; + 3 │ } + + i Expected a function parameter here. > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { - │ ^ + │ ^^^^^^^^^ 2 │ @return "Func"; 3 │ } function.css:1:42 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args...'. > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { - │ ^ + │ ^^^^^^^^ + 2 │ @return "Func"; + 3 │ } + + i Expected a function parameter here. + + > 1 │ @function --func($arg, $arg1, $arg2: 10, $args...) { + │ ^^^^^^^^ 2 │ @return "Func"; 3 │ } function.css:4:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. 2 │ @return "Func"; 3 │ } > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ - │ ^ + │ ^^^^ + 5 │ @return "Func"; + 6 │ } + + i Expected a function parameter here. + + 2 │ @return "Func"; + 3 │ } + > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ + │ ^^^^ 5 │ @return "Func"; 6 │ } function.css:4:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. + + 2 │ @return "Func"; + 3 │ } + > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ + │ ^^^^^ + 5 │ @return "Func"; + 6 │ } + + i Expected a function parameter here. 2 │ @return "Func"; 3 │ } > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ - │ ^ + │ ^^^^^ 5 │ @return "Func"; 6 │ } function.css:4:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2:10'. 2 │ @return "Func"; 3 │ } > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ - │ ^ + │ ^^^^^^^^ + 5 │ @return "Func"; + 6 │ } + + i Expected a function parameter here. + + 2 │ @return "Func"; + 3 │ } + > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ + │ ^^^^^^^^ 5 │ @return "Func"; 6 │ } function.css:4:38 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args...'. + + 2 │ @return "Func"; + 3 │ } + > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ + │ ^^^^^^^^ + 5 │ @return "Func"; + 6 │ } + + i Expected a function parameter here. 2 │ @return "Func"; 3 │ } > 4 │ @function --func($arg,$arg1,$arg2:10,$args...){ - │ ^ + │ ^^^^^^^^ 5 │ @return "Func"; 6 │ } function.css:7:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. 5 │ @return "Func"; 6 │ } > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^ + 8 │ @return "Func"; + 9 │ } + + i Expected a function parameter here. + + 5 │ @return "Func"; + 6 │ } + > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^ 8 │ @return "Func"; 9 │ } function.css:7:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. 5 │ @return "Func"; 6 │ } > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^^ + 8 │ @return "Func"; + 9 │ } + + i Expected a function parameter here. + + 5 │ @return "Func"; + 6 │ } + > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^^ 8 │ @return "Func"; 9 │ } function.css:7:35 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2 : 10'. 5 │ @return "Func"; 6 │ } > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^^^^^^^ + 8 │ @return "Func"; + 9 │ } + + i Expected a function parameter here. + + 5 │ @return "Func"; + 6 │ } + > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^^^^^^^ 8 │ @return "Func"; 9 │ } function.css:7:48 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args ...'. + + 5 │ @return "Func"; + 6 │ } + > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^^^^^^ + 8 │ @return "Func"; + 9 │ } + + i Expected a function parameter here. 5 │ @return "Func"; 6 │ } > 7 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^^^^^^ 8 │ @return "Func"; 9 │ } function.css:10:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. + + 8 │ @return "Func"; + 9 │ } + > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^ + 11 │ @return "Func"; + 12 │ } + + i Expected a function parameter here. 8 │ @return "Func"; 9 │ } > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^ 11 │ @return "Func"; 12 │ } function.css:10:32 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. + + 8 │ @return "Func"; + 9 │ } + > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^^ + 11 │ @return "Func"; + 12 │ } + + i Expected a function parameter here. 8 │ @return "Func"; 9 │ } > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^^ 11 │ @return "Func"; 12 │ } function.css:10:42 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2 : 10'. 8 │ @return "Func"; 9 │ } > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^^^^^^^^^ + 11 │ @return "Func"; + 12 │ } + + i Expected a function parameter here. + + 8 │ @return "Func"; + 9 │ } + > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^^^^^^^^^ 11 │ @return "Func"; 12 │ } function.css:10:59 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args ...'. 8 │ @return "Func"; 9 │ } > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { - │ ^ + │ ^^^^^^^^^^ + 11 │ @return "Func"; + 12 │ } + + i Expected a function parameter here. + + 8 │ @return "Func"; + 9 │ } + > 10 │ @function --func ( $arg , $arg1 , $arg2 : 10 , $args ... ) { + │ ^^^^^^^^^^ 11 │ @return "Func"; 12 │ } function.css:14:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. 12 │ } 13 │ @function --func( > 14 │ $arg, - │ ^ + │ ^^^^ + 15 │ $arg1, + 16 │ $arg2: 10, + + i Expected a function parameter here. + + 12 │ } + 13 │ @function --func( + > 14 │ $arg, + │ ^^^^ 15 │ $arg1, 16 │ $arg2: 10, function.css:15:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. + + 13 │ @function --func( + 14 │ $arg, + > 15 │ $arg1, + │ ^^^^^ + 16 │ $arg2: 10, + 17 │ $args... + + i Expected a function parameter here. 13 │ @function --func( 14 │ $arg, > 15 │ $arg1, - │ ^ + │ ^^^^^ 16 │ $arg2: 10, 17 │ $args... function.css:16:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2: 10'. + + 14 │ $arg, + 15 │ $arg1, + > 16 │ $arg2: 10, + │ ^^^^^^^^^ + 17 │ $args... + 18 │ ) { + + i Expected a function parameter here. 14 │ $arg, 15 │ $arg1, > 16 │ $arg2: 10, - │ ^ + │ ^^^^^^^^^ 17 │ $args... 18 │ ) { function.css:17:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args...'. 15 │ $arg1, 16 │ $arg2: 10, > 17 │ $args... - │ ^ + │ ^^^^^^^^ + 18 │ ) { + 19 │ @return "Func"; + + i Expected a function parameter here. + + 15 │ $arg1, + 16 │ $arg2: 10, + > 17 │ $args... + │ ^^^^^^^^ 18 │ ) { 19 │ @return "Func"; function.css:23:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. + + 21 │ @function + 22 │ --func( + > 23 │ $arg, + │ ^^^^ + 24 │ $arg1, + 25 │ $arg2: 10, + + i Expected a function parameter here. 21 │ @function 22 │ --func( > 23 │ $arg, - │ ^ + │ ^^^^ 24 │ $arg1, 25 │ $arg2: 10, function.css:24:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. 22 │ --func( 23 │ $arg, > 24 │ $arg1, - │ ^ + │ ^^^^^ + 25 │ $arg2: 10, + 26 │ $args... + + i Expected a function parameter here. + + 22 │ --func( + 23 │ $arg, + > 24 │ $arg1, + │ ^^^^^ 25 │ $arg2: 10, 26 │ $args... function.css:25:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2: 10'. + + 23 │ $arg, + 24 │ $arg1, + > 25 │ $arg2: 10, + │ ^^^^^^^^^ + 26 │ $args... + 27 │ ) { + + i Expected a function parameter here. 23 │ $arg, 24 │ $arg1, > 25 │ $arg2: 10, - │ ^ + │ ^^^^^^^^^ 26 │ $args... 27 │ ) { function.css:26:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args...'. 24 │ $arg1, 25 │ $arg2: 10, > 26 │ $args... - │ ^ + │ ^^^^^^^^ + 27 │ ) { + 28 │ @return "Func"; + + i Expected a function parameter here. + + 24 │ $arg1, + 25 │ $arg2: 10, + > 26 │ $args... + │ ^^^^^^^^ 27 │ ) { 28 │ @return "Func"; function.css:33:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. + + 31 │ --func + 32 │ ( + > 33 │ $arg + │ ^^^^ + 34 │ , + 35 │ $arg1 + + i Expected a function parameter here. 31 │ --func 32 │ ( > 33 │ $arg - │ ^ + │ ^^^^ 34 │ , 35 │ $arg1 function.css:35:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. 33 │ $arg 34 │ , > 35 │ $arg1 - │ ^ + │ ^^^^^ + 36 │ , + 37 │ $arg2 + + i Expected a function parameter here. + + 33 │ $arg + 34 │ , + > 35 │ $arg1 + │ ^^^^^ 36 │ , 37 │ $arg2 function.css:37:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2 + : + 10'. 35 │ $arg1 36 │ , > 37 │ $arg2 - │ ^ - 38 │ : - 39 │ 10 + │ ^^^^^ + > 38 │ : + > 39 │ 10 + │ ^^ + 40 │ , + 41 │ $args + + i Expected a function parameter here. + + 35 │ $arg1 + 36 │ , + > 37 │ $arg2 + │ ^^^^^ + > 38 │ : + > 39 │ 10 + │ ^^ + 40 │ , + 41 │ $args function.css:41:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args + ...'. 39 │ 10 40 │ , > 41 │ $args - │ ^ - 42 │ ... + │ ^^^^^ + > 42 │ ... + │ ^^^ 43 │ ) + 44 │ { + + i Expected a function parameter here. + + 39 │ 10 + 40 │ , + > 41 │ $args + │ ^^^^^ + > 42 │ ... + │ ^^^ + 43 │ ) + 44 │ { function.css:55:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg'. + + 53 │ ( + 54 │ + > 55 │ $arg + │ ^^^^ + 56 │ + 57 │ , + + i Expected a function parameter here. 53 │ ( 54 │ > 55 │ $arg - │ ^ + │ ^^^^ 56 │ 57 │ , function.css:59:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg1'. + + 57 │ , + 58 │ + > 59 │ $arg1 + │ ^^^^^ + 60 │ + 61 │ , + + i Expected a function parameter here. 57 │ , 58 │ > 59 │ $arg1 - │ ^ + │ ^^^^^ 60 │ 61 │ , function.css:63:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$arg2 + + : + + 10'. 61 │ , 62 │ > 63 │ $arg2 - │ ^ - 64 │ - 65 │ : + │ ^^^^^ + > 64 │ + > 65 │ : + > 66 │ + > 67 │ 10 + │ ^^ + 68 │ + 69 │ , + + i Expected a function parameter here. + + 61 │ , + 62 │ + > 63 │ $arg2 + │ ^^^^^ + > 64 │ + > 65 │ : + > 66 │ + > 67 │ 10 + │ ^^ + 68 │ + 69 │ , function.css:71:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$args + + ...'. 69 │ , 70 │ > 71 │ $args - │ ^ - 72 │ - 73 │ ... + │ ^^^^^ + > 72 │ + > 73 │ ... + │ ^^^ + 74 │ + 75 │ ) + + i Expected a function parameter here. + + 69 │ , + 70 │ + > 71 │ $args + │ ^^^^^ + > 72 │ + > 73 │ ... + │ ^^^ + 74 │ + 75 │ ) function.css:86:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg'. 85 │ } > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 87 │ @return "Func"; + 88 │ } + + i Expected a function parameter here. + + 85 │ } + > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 87 │ @return "Func"; 88 │ } function.css:86:99 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1'. 85 │ } > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 87 │ @return "Func"; + 88 │ } + + i Expected a function parameter here. + + 85 │ } + > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 87 │ @return "Func"; 88 │ } function.css:86:181 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10'. + + 85 │ } + > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 87 │ @return "Func"; + 88 │ } + + i Expected a function parameter here. 85 │ } > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 87 │ @return "Func"; 88 │ } function.css:86:267 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...'. + + 85 │ } + > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 87 │ @return "Func"; + 88 │ } + + i Expected a function parameter here. 85 │ } > 86 │ @function --func($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 87 │ @return "Func"; 88 │ } diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/if-else.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/if-else.css.snap index 446d1fe7f1b7..4df8fbddb429 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/if-else.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/if-else.css.snap @@ -159,24 +159,21 @@ p { ```diff --- Prettier +++ Biome -@@ -1,102 +1,157 @@ +@@ -1,102 +1,154 @@ @if $media == phonePortrait { - $k: 0.15625; -} @else if $media == phoneLandscape { - $k: 0.08803; -} @else if $media == tabletPortrait { - $k: 0.065106; -+ $ -+ k: 0.15625; ++ $k: .15625; +} +@else if $media == phoneLandscape { -+ $ -+ k: 0.08803; -+} -+@else if $media == tabletPortrait { -+ $ -+ k: 0.065106; ++ $k: .08803; } ++@else if $media == tabletPortrait { ++ $k: .065106; ++} p { @if $type == ocean { } @@ -266,21 +263,17 @@ p { @if $type==ocean { - } @else if $type==matador { } -- @if $type == ocean { -- } @else if $type == matador { + @else if $type==matador { + } + @if $type == ocean { + } + @else if $type == matador { - } ++ } @if $type == ocean { - } @else if $type == matador { } -- @if $type == ocean { -- } @else if $type == matador { + @else if $type == matador { - } ++ } @if $type == ocean { - } @else if $type == matador { } @@ -288,10 +281,7 @@ p { - } @else if $type == matador { + @else if + $type == matador { - } -- @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables -- == -- $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { ++ } + @if $type + == + ocean { @@ -300,13 +290,17 @@ p { + $type + == + matador { -+ } + } +- @if $type == ocean { +- } @else if $type == matador { + @if $type + + == + + ocean { -+ } + } +- @if $type == ocean { +- } @else if $type == matador { + + @else if + @@ -315,7 +309,10 @@ p { + == + + matador { -+ } + } +- @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables +- == +- $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { + @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { color: blue; - } @else if @@ -373,16 +370,13 @@ p { ```css @if $media == phonePortrait { - $ - k: 0.15625; + $k: .15625; } @else if $media == phoneLandscape { - $ - k: 0.08803; + $k: .08803; } @else if $media == tabletPortrait { - $ - k: 0.065106; + $k: .065106; } p { @if $type == ocean { @@ -533,745 +527,53 @@ p { # Errors ``` -if-else.css:1:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - > 1 │ @if $media == phonePortrait { - │ ^ - 2 │ $k: .15625; - 3 │ } @else if $media == phoneLandscape { - if-else.css:2:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variable declarations are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 1 │ @if $media == phonePortrait { > 2 │ $k: .15625; - │ ^ + │ ^^^^^^^^^^^ 3 │ } @else if $media == phoneLandscape { 4 │ $k: .08803; -if-else.css:3:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @if $media == phonePortrait { - 2 │ $k: .15625; - > 3 │ } @else if $media == phoneLandscape { - │ ^ - 4 │ $k: .08803; - 5 │ } @else if $media == tabletPortrait { + i SCSS only syntax if-else.css:4:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variable declarations are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 2 │ $k: .15625; 3 │ } @else if $media == phoneLandscape { > 4 │ $k: .08803; - │ ^ + │ ^^^^^^^^^^^ 5 │ } @else if $media == tabletPortrait { 6 │ $k: .065106; -if-else.css:5:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 3 │ } @else if $media == phoneLandscape { - 4 │ $k: .08803; - > 5 │ } @else if $media == tabletPortrait { - │ ^ - 6 │ $k: .065106; - 7 │ } + i SCSS only syntax if-else.css:6:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variable declarations are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 4 │ $k: .08803; 5 │ } @else if $media == tabletPortrait { > 6 │ $k: .065106; - │ ^ + │ ^^^^^^^^^^^^ 7 │ } 8 │ p { -if-else.css:9:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 7 │ } - 8 │ p { - > 9 │ @if $type == ocean {} - │ ^ - 10 │ @if $type==ocean{} - 11 │ @if $type == ocean {} - -if-else.css:10:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 8 │ p { - 9 │ @if $type == ocean {} - > 10 │ @if $type==ocean{} - │ ^ - 11 │ @if $type == ocean {} - 12 │ @if $type - -if-else.css:11:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 9 │ @if $type == ocean {} - 10 │ @if $type==ocean{} - > 11 │ @if $type == ocean {} - │ ^ - 12 │ @if $type - 13 │ == ocean {} - -if-else.css:12:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 10 │ @if $type==ocean{} - 11 │ @if $type == ocean {} - > 12 │ @if $type - │ ^ - 13 │ == ocean {} - 14 │ @if - -if-else.css:15:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 13 │ == ocean {} - 14 │ @if - > 15 │ $type - │ ^ - 16 │ == - 17 │ ocean - -if-else.css:22:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 20 │ @if - 21 │ - > 22 │ $type - │ ^ - 23 │ - 24 │ == - -if-else.css:31:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 30 │ } - > 31 │ @if (($type) == (ocean)) {} - │ ^ - 32 │ @if (($type)==(ocean)){} - 33 │ @if ( ( $type ) == ( ocean ) ) {} - -if-else.css:32:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 30 │ } - 31 │ @if (($type) == (ocean)) {} - > 32 │ @if (($type)==(ocean)){} - │ ^ - 33 │ @if ( ( $type ) == ( ocean ) ) {} - 34 │ @if (($type) - -if-else.css:33:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 31 │ @if (($type) == (ocean)) {} - 32 │ @if (($type)==(ocean)){} - > 33 │ @if ( ( $type ) == ( ocean ) ) {} - │ ^ - 34 │ @if (($type) - 35 │ == (ocean)) {} - -if-else.css:34:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 32 │ @if (($type)==(ocean)){} - 33 │ @if ( ( $type ) == ( ocean ) ) {} - > 34 │ @if (($type) - │ ^ - 35 │ == (ocean)) {} - 36 │ @if - -if-else.css:39:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 37 │ ( - 38 │ ( - > 39 │ $type - │ ^ - 40 │ ) - 41 │ == - -if-else.css:54:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 52 │ ( - 53 │ - > 54 │ $type - │ ^ - 55 │ - 56 │ ) - -if-else.css:71:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 70 │ } - > 71 │ @if $type == ocean { - │ ^ - 72 │ color: blue; - 73 │ } @else if $type == matador { - -if-else.css:73:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 71 │ @if $type == ocean { - 72 │ color: blue; - > 73 │ } @else if $type == matador { - │ ^ - 74 │ color: red; - 75 │ } @else if $type == monster { - -if-else.css:75:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 73 │ } @else if $type == matador { - 74 │ color: red; - > 75 │ } @else if $type == monster { - │ ^ - 76 │ color: green; - 77 │ } @else { - -if-else.css:80:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 78 │ color: black; - 79 │ } - > 80 │ @if $type == ocean { - │ ^ - 81 │ } @else if $type == matador { - 82 │ } - -if-else.css:81:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 79 │ } - 80 │ @if $type == ocean { - > 81 │ } @else if $type == matador { - │ ^ - 82 │ } - 83 │ @if $type==ocean{}@else if $type==matador{} - -if-else.css:83:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 81 │ } @else if $type == matador { - 82 │ } - > 83 │ @if $type==ocean{}@else if $type==matador{} - │ ^ - 84 │ @if $type == ocean { } @else if $type == matador { } - 85 │ @if $type == ocean {} - -if-else.css:83:32 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 81 │ } @else if $type == matador { - 82 │ } - > 83 │ @if $type==ocean{}@else if $type==matador{} - │ ^ - 84 │ @if $type == ocean { } @else if $type == matador { } - 85 │ @if $type == ocean {} - -if-else.css:84:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ } - 83 │ @if $type==ocean{}@else if $type==matador{} - > 84 │ @if $type == ocean { } @else if $type == matador { } - │ ^ - 85 │ @if $type == ocean {} - 86 │ @else if $type == matador {} - -if-else.css:84:45 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ } - 83 │ @if $type==ocean{}@else if $type==matador{} - > 84 │ @if $type == ocean { } @else if $type == matador { } - │ ^ - 85 │ @if $type == ocean {} - 86 │ @else if $type == matador {} - -if-else.css:85:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 83 │ @if $type==ocean{}@else if $type==matador{} - 84 │ @if $type == ocean { } @else if $type == matador { } - > 85 │ @if $type == ocean {} - │ ^ - 86 │ @else if $type == matador {} - 87 │ @if - -if-else.css:86:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 84 │ @if $type == ocean { } @else if $type == matador { } - 85 │ @if $type == ocean {} - > 86 │ @else if $type == matador {} - │ ^ - 87 │ @if - 88 │ $type == ocean {} - -if-else.css:88:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 86 │ @else if $type == matador {} - 87 │ @if - > 88 │ $type == ocean {} - │ ^ - 89 │ @else if - 90 │ $type == matador {} - -if-else.css:90:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ $type == ocean {} - 89 │ @else if - > 90 │ $type == matador {} - │ ^ - 91 │ @if - 92 │ $type - -if-else.css:92:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 90 │ $type == matador {} - 91 │ @if - > 92 │ $type - │ ^ - 93 │ == - 94 │ ocean - -if-else.css:99:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 97 │ @else - 98 │ if - > 99 │ $type - │ ^ - 100 │ == - 101 │ matador - -if-else.css:106:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 104 │ @if - 105 │ - > 106 │ $type - │ ^ - 107 │ - 108 │ == - -if-else.css:120:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 118 │ if - 119 │ - > 120 │ $type - │ ^ - 121 │ - 122 │ == - -if-else.css:129:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 128 │ } - > 129 │ @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - │ ^ - 130 │ color: blue; - 131 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - -if-else.css:129:98 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 128 │ } - > 129 │ @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - │ ^ - 130 │ color: blue; - 131 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - -if-else.css:131:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 129 │ @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - 130 │ color: blue; - > 131 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - │ ^ - 132 │ color: red; - 133 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - -if-else.css:131:105 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 129 │ @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - 130 │ color: blue; - > 131 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - │ ^ - 132 │ color: red; - 133 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - -if-else.css:133:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 131 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - 132 │ color: red; - > 133 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - │ ^ - 134 │ color: green; - 135 │ } @else { - -if-else.css:133:105 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 131 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - 132 │ color: red; - > 133 │ } @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - │ ^ - 134 │ color: green; - 135 │ } @else { - -if-else.css:138:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 136 │ color: black; - 137 │ } - > 138 │ @if $very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - │ ^ - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - -if-else.css:138:43 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 136 │ color: black; - 137 │ } - > 138 │ @if $very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - │ ^ - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - -if-else.css:139:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 137 │ } - 138 │ @if $very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - > 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - │ ^ - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - -if-else.css:139:58 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 137 │ } - 138 │ @if $very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - > 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - │ ^ - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - -if-else.css:140:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 138 │ @if $very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - > 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - │ ^ - 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - 142 │ @if (str-slice($item, 0, 1) == ":") {} - -if-else.css:140:83 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 138 │ @if $very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - > 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - │ ^ - 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - 142 │ @if (str-slice($item, 0, 1) == ":") {} - -if-else.css:141:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:36 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:65 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:87 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:108 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:127 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:150 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:169 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:193 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:212 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:233 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:252 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:276 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:295 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:319 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:141:338 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 139 │ @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 {} - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - > 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - │ ^ - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - -if-else.css:142:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 140 │ @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 {} - 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - > 142 │ @if (str-slice($item, 0, 1) == ":") {} - │ ^ - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - 144 │ @if ($type == ocean) {} @else if ($type == matador) {} @else {} - -if-else.css:143:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 141 │ @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px {} - 142 │ @if (str-slice($item, 0, 1) == ":") {} - > 143 │ @if (str-slice($item, 0, 3) == " : ") {} - │ ^ - 144 │ @if ($type == ocean) {} @else if ($type == matador) {} @else {} - 145 │ } - -if-else.css:144:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - > 144 │ @if ($type == ocean) {} @else if ($type == matador) {} @else {} - │ ^ - 145 │ } - 146 │ - -if-else.css:144:39 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 142 │ @if (str-slice($item, 0, 1) == ":") {} - 143 │ @if (str-slice($item, 0, 3) == " : ") {} - > 144 │ @if ($type == ocean) {} @else if ($type == matador) {} @else {} - │ ^ - 145 │ } - 146 │ + i SCSS only syntax ``` # Lines exceeding max width of 80 characters ``` - 127: @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { + 124: @if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { + 127: @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { 130: @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - 133: @else if $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables == $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-variables { - 141: @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 { - 143: @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 { - 145: @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px { + 138: @if $very-very-very-very-very-very-long-var == 0 and $very-very-very-long-var == 0 { + 140: @if $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 and $very-very-very-very-very-very-very-very-very-very-very-long-var == 0 { + 142: @if $base-font-size != 16px or $base-line-height != 24px or $base-unit != 'em' or $h1-font-size != 2 * $base-font-size or $h2-font-size != 1.5 * $base-font-size or $h3-font-size != 1.17 * $base-font-size or $h4-font-size != 1 * $base-font-size or $h5-font-size != 0.83 * $base-font-size or $h6-font-size != 0.67 * $base-font-size or $indent-amount != 40px { ``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/import.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/import.css.snap index fb41ccb307c4..22f1d988e8a7 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/import.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/import.css.snap @@ -105,85 +105,42 @@ $dir: 'fonts'; #main { @import "example"; } -@@ -32,49 +26,44 @@ +@@ -32,17 +26,10 @@ } #main { @import "example"; -} - -@import "test.less" { - } +-} -@import "test.less" { - a: b; - c: d; --} + } @import url("foo"); -$dir: "fonts"; -+$ -+dir: 'fonts'; ++$dir: 'fonts'; --@import url("foo.css"); --@import url("foo.css"); @import url("foo.css"); --@import url("foo.css"); --@import url("fineprint.css") print; --@import url("fineprint.css") print; --@import url("fineprint.css") print; -+@import url('foo.css'); -+@import url("foo.css"); -+@import url("foo.css"); -+@import url("fineprint.css")print; - @import url("fineprint.css") print; --@import url("bluish.css") projection, tv; --@import url("bluish.css") projection, tv; --@import url("bluish.css") projection, tv; --@import url("bluish.css") projection, tv; --@import url("bluish.css") projection, tv; -+@import url("fineprint.css") print; -+@import url("fineprint.css") -+ print; -+@import url("bluish.css") projection,tv; + @import url("foo.css"); +@@ -59,14 +46,9 @@ @import url("bluish.css") projection, tv; --@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") -+@import url("bluish.css") projection ,tv; -+@import url("bluish.css") projection , tv; -+@import url("bluish.css") projection , tv; -+@import url("bluish.css") - projection, - tv; + @import url("bluish.css") projection, tv; + @import url("very-very-very-very-very-very-very-very-very-very-long-name.css") +- projection, +- tv; -@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") - projection tv; --@import url("landscape.css") screen and (orientation: landscape); ++ projection, tv; ++@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection tv; + @import url("landscape.css") screen and (orientation: landscape); -@import "rounded-corners", "text-shadow"; -@import "rounded-corners", "text-shadow"; -$family: unquote("Droid+Sans"); -+@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection,tv; -+@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection tv; -+@import url('landscape.css') screen and (orientation:landscape); @import url("http://fonts.googleapis.com/css?family=#{$family}"); --@import url("foo.css"); --@import url("foo.css"); --@import url("foo.css"); --@import url("foo.css"); --@import url("foo bar baz.css"); -+@import url( "foo.css"); -+@import url("foo.css" ); -+@import url( "foo.css" ); -+@import url( "foo.css" ); - @import url("foo bar baz.css"); -+@import url( "foo bar baz.css" ); - @import url("foo bar baz.css"); --@import url("foo.css"); --@import "https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600"; --@import url("foo.css,800"); -+@import url( -+"foo.css" -+); -+@import 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600'; -+@import url( -+"foo.css,800" -+); + @import url("foo.css"); + @import url("foo.css"); ``` # Output @@ -220,44 +177,37 @@ $dir: 'fonts'; } @import url("foo"); -$ -dir: 'fonts'; +$dir: 'fonts'; @import url("foo.css"); -@import url('foo.css'); -@import url("foo.css"); -@import url("foo.css"); -@import url("fineprint.css")print; +@import url("foo.css"); +@import url("foo.css"); +@import url("foo.css"); +@import url("fineprint.css") print; +@import url("fineprint.css") print; +@import url("fineprint.css") print; @import url("fineprint.css") print; -@import url("fineprint.css") print; -@import url("fineprint.css") - print; -@import url("bluish.css") projection,tv; @import url("bluish.css") projection, tv; -@import url("bluish.css") projection ,tv; -@import url("bluish.css") projection , tv; -@import url("bluish.css") projection , tv; -@import url("bluish.css") - projection, - tv; -@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection,tv; +@import url("bluish.css") projection, tv; +@import url("bluish.css") projection, tv; +@import url("bluish.css") projection, tv; +@import url("bluish.css") projection, tv; +@import url("bluish.css") projection, tv; +@import url("very-very-very-very-very-very-very-very-very-very-long-name.css") + projection, tv; @import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection tv; -@import url('landscape.css') screen and (orientation:landscape); +@import url("landscape.css") screen and (orientation: landscape); @import url("http://fonts.googleapis.com/css?family=#{$family}"); -@import url( "foo.css"); -@import url("foo.css" ); -@import url( "foo.css" ); -@import url( "foo.css" ); +@import url("foo.css"); +@import url("foo.css"); +@import url("foo.css"); +@import url("foo.css"); +@import url("foo bar baz.css"); @import url("foo bar baz.css"); -@import url( "foo bar baz.css" ); @import url("foo bar baz.css"); -@import url( -"foo.css" -); -@import 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600'; -@import url( -"foo.css,800" -); +@import url("foo.css"); +@import "https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600"; +@import url("foo.css,800"); ``` # Errors @@ -277,84 +227,15 @@ import.css:6:29 parse ━━━━━━━━━━━━━━━━━━━ import.css:42:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` - - 41 │ @import url('foo'); - > 42 │ $dir: 'fonts'; - │ ^ - 43 │ - 44 │ @import url("foo.css"); - -import.css:42:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Unexpected value or character. - - 41 │ @import url('foo'); - > 42 │ $dir: 'fonts'; - │ ^^^^^^^ - 43 │ - 44 │ @import url("foo.css"); - - i Expected one of: - - - hover - - focus - - active - - first-child - - last-child - - nth-child - - nth-last-child - - first-of-type - - last-of-type - - nth-of-type - - nth-last-of-type - - only-child - - only-of-type - - checked - - disabled - - enabled - - required - - optional - - valid - - invalid - - in-range - - out-of-range - - read-only - - read-write - - placeholder-shown - - default - - checked - - indeterminate - - blank - - empty - - root - - target - - lang - - not - - is - - where - - fullscreen - - link - - visited - - any-link - - local-link - - scope - - state - - current - - past - - future - -import.css:42:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `;` + × SCSS variable declarations are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 41 │ @import url('foo'); > 42 │ $dir: 'fonts'; - │ ^ + │ ^^^^^^^^^^^^^^ 43 │ 44 │ @import url("foo.css"); - i Remove ; + i SCSS only syntax import.css:62:91 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -369,27 +250,10 @@ import.css:62:91 parse ━━━━━━━━━━━━━━━━━━━ i Remove tv -import.css:79:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `}` but instead the file ends - - 77 │ "foo.css,800" - 78 │ ); - > 79 │ - │ - - i the file ends here - - 77 │ "foo.css,800" - 78 │ ); - > 79 │ - │ - ``` # Lines exceeding max width of 80 characters ``` - 52: @import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection,tv; - 53: @import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection tv; + 50: @import url("very-very-very-very-very-very-very-very-very-very-long-name.css") projection tv; ``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/include.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/include.css.snap index 2f0bbcea276c..7a3563b97203 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/include.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/include.css.snap @@ -401,280 +401,6 @@ border-color: $very-very-very-very-very-very-very-very-very-very-very-very-very- } ``` -# Errors -``` -include.css:1:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - > 1 │ @include mix(1px, 2px, $arg2: 10, 2px 4px 6px); - │ ^ - 2 │ @include mix(1px,2px,$arg2:10,2px 4px 6px); - 3 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - -include.css:2:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @include mix(1px, 2px, $arg2: 10, 2px 4px 6px); - > 2 │ @include mix(1px,2px,$arg2:10,2px 4px 6px); - │ ^ - 3 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - 4 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - -include.css:3:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @include mix(1px, 2px, $arg2: 10, 2px 4px 6px); - 2 │ @include mix(1px,2px,$arg2:10,2px 4px 6px); - > 3 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - │ ^ - 4 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - 5 │ @include mix( - -include.css:4:33 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 2 │ @include mix(1px,2px,$arg2:10,2px 4px 6px); - 3 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - > 4 │ @include mix ( 1px , 2px , $arg2 : 10 , 2px 4px 6px ); - │ ^ - 5 │ @include mix( - 6 │ 1px, - -include.css:8:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 6 │ 1px, - 7 │ 2px, - > 8 │ $arg2: 10, - │ ^ - 9 │ 2px 4px 6px - 10 │ ); - -include.css:15:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 13 │ 1px, - 14 │ 2px, - > 15 │ $arg2: 10, - │ ^ - 16 │ 2px 4px 6px - 17 │ ); - -include.css:25:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 23 │ 2px - 24 │ , - > 25 │ $arg2 - │ ^ - 26 │ : - 27 │ 10 - -include.css:48:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 46 │ , - 47 │ - > 48 │ $arg2 - │ ^ - 49 │ - 50 │ : - -include.css:65:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 64 │ ; - > 65 │ @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); - │ ^ - 66 │ a { - 67 │ @include global-variable-overriding; - -include.css:65:100 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 64 │ ; - > 65 │ @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); - │ ^ - 66 │ a { - 67 │ @include global-variable-overriding; - -include.css:65:187 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 64 │ ; - > 65 │ @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); - │ ^ - 66 │ a { - 67 │ @include global-variable-overriding; - -include.css:68:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 66 │ a { - 67 │ @include global-variable-overriding; - > 68 │ @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); - │ ^ - 69 │ @include apply-to-ie6-only {} - 70 │ @include apply-to-ie6-only{} - -include.css:68:104 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 66 │ a { - 67 │ @include global-variable-overriding; - > 68 │ @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); - │ ^ - 69 │ @include apply-to-ie6-only {} - 70 │ @include apply-to-ie6-only{} - -include.css:68:191 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 66 │ a { - 67 │ @include global-variable-overriding; - > 68 │ @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); - │ ^ - 69 │ @include apply-to-ie6-only {} - 70 │ @include apply-to-ie6-only{} - -include.css:88:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 86 │ a { - 87 │ @include section-type-1( - > 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - │ ^ - 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - -include.css:88:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 86 │ a { - 87 │ @include section-type-1( - > 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - │ ^ - 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - -include.css:89:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 87 │ @include section-type-1( - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - > 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - │ ^ - 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - 91 │ ); - -include.css:89:65 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 87 │ @include section-type-1( - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - > 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - │ ^ - 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - 91 │ ); - -include.css:89:98 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 87 │ @include section-type-1( - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - > 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - │ ^ - 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - 91 │ ); - -include.css:90:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - > 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - │ ^ - 91 │ ); - 92 │ } - -include.css:90:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - > 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - │ ^ - 91 │ ); - 92 │ } - -include.css:90:62 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - > 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - │ ^ - 91 │ ); - 92 │ } - -include.css:90:110 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ $header: (margin: 0 0 $margin-base, text-align: left), - 89 │ $decoration: (type: base, margin: 0 auto -1px 0, primary-color: $brand-primary, secondary-color: $gray-light), - > 90 │ $title: (margin: 0 0 $margin-small, color: false, font-size: $font-size-h3, font-weight: false, line-height: $line-height-h3) - │ ^ - 91 │ ); - 92 │ } - -include.css:106:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 104 │ ( - 105 │ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), - > 106 │ border-color: $brand-primary - │ ^ - 107 │ ) - 108 │ ); - -include.css:116:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 114 │ ( - 115 │ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), - > 116 │ border-color: $very-very-very-very-very-very-very-very-very-very-very-very-very-long-value - │ ^ - 117 │ ) - 118 │ ); - - -``` - # Lines exceeding max width of 80 characters ``` 58: @include mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg: 1px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1: 2px, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, 2px 4px 6px); diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/mixin.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/mixin.css.snap index b7e806b7f9ff..c66ae64e8226 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/mixin.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/mixin.css.snap @@ -359,611 +359,6 @@ $background } ``` -# Errors -``` -mixin.css:21:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 19 │ } - 20 │ - > 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - │ ^ - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:21:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 19 │ } - 20 │ - > 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - │ ^ - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:21:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 19 │ } - 20 │ - > 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - │ ^ - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:21:36 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 19 │ } - 20 │ - > 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - │ ^ - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:22:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - > 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - │ ^ - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:22:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - > 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - │ ^ - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:22:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - > 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - │ ^ - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:22:32 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - > 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - │ ^ - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - -mixin.css:23:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - > 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 25 │ @mixin mix( - -mixin.css:23:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - > 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 25 │ @mixin mix( - -mixin.css:23:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - > 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 25 │ @mixin mix( - -mixin.css:23:42 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 21 │ @mixin mix($arg, $arg1, $arg2: 10, $args...) {} - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - > 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 25 │ @mixin mix( - -mixin.css:24:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - > 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 25 │ @mixin mix( - 26 │ $arg, - -mixin.css:24:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - > 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 25 │ @mixin mix( - 26 │ $arg, - -mixin.css:24:36 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - > 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 25 │ @mixin mix( - 26 │ $arg, - -mixin.css:24:53 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 22 │ @mixin mix($arg,$arg1,$arg2:10,$args...){} - 23 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - > 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - │ ^ - 25 │ @mixin mix( - 26 │ $arg, - -mixin.css:26:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 24 │ @mixin mix ( $arg , $arg1 , $arg2 : 10 , $args ... ) {} - 25 │ @mixin mix( - > 26 │ $arg, - │ ^ - 27 │ $arg1, - 28 │ $arg2: 10, - -mixin.css:27:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 25 │ @mixin mix( - 26 │ $arg, - > 27 │ $arg1, - │ ^ - 28 │ $arg2: 10, - 29 │ $args... - -mixin.css:28:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 26 │ $arg, - 27 │ $arg1, - > 28 │ $arg2: 10, - │ ^ - 29 │ $args... - 30 │ ) {} - -mixin.css:29:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 27 │ $arg1, - 28 │ $arg2: 10, - > 29 │ $args... - │ ^ - 30 │ ) {} - 31 │ @mixin - -mixin.css:33:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 31 │ @mixin - 32 │ mix( - > 33 │ $arg, - │ ^ - 34 │ $arg1, - 35 │ $arg2: 10, - -mixin.css:34:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 32 │ mix( - 33 │ $arg, - > 34 │ $arg1, - │ ^ - 35 │ $arg2: 10, - 36 │ $args... - -mixin.css:35:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 33 │ $arg, - 34 │ $arg1, - > 35 │ $arg2: 10, - │ ^ - 36 │ $args... - 37 │ ) {} - -mixin.css:36:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 34 │ $arg1, - 35 │ $arg2: 10, - > 36 │ $args... - │ ^ - 37 │ ) {} - 38 │ @mixin - -mixin.css:41:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 39 │ mix - 40 │ ( - > 41 │ $arg - │ ^ - 42 │ , - 43 │ $arg1 - -mixin.css:43:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 41 │ $arg - 42 │ , - > 43 │ $arg1 - │ ^ - 44 │ , - 45 │ $arg2 - -mixin.css:45:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 43 │ $arg1 - 44 │ , - > 45 │ $arg2 - │ ^ - 46 │ : - 47 │ 10 - -mixin.css:49:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 47 │ 10 - 48 │ , - > 49 │ $args - │ ^ - 50 │ ... - 51 │ ) - -mixin.css:60:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 58 │ ( - 59 │ - > 60 │ $arg - │ ^ - 61 │ - 62 │ , - -mixin.css:64:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 62 │ , - 63 │ - > 64 │ $arg1 - │ ^ - 65 │ - 66 │ , - -mixin.css:68:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 66 │ , - 67 │ - > 68 │ $arg2 - │ ^ - 69 │ - 70 │ : - -mixin.css:76:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 74 │ , - 75 │ - > 76 │ $args - │ ^ - 77 │ - 78 │ ... - -mixin.css:84:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ { - 83 │ } - > 84 │ @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) {} - │ ^ - 85 │ @mixin component($conf: ()) {} - 86 │ @mixin component($conf: ( )) {} - -mixin.css:84:93 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ { - 83 │ } - > 84 │ @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) {} - │ ^ - 85 │ @mixin component($conf: ()) {} - 86 │ @mixin component($conf: ( )) {} - -mixin.css:84:175 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ { - 83 │ } - > 84 │ @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) {} - │ ^ - 85 │ @mixin component($conf: ()) {} - 86 │ @mixin component($conf: ( )) {} - -mixin.css:84:261 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ { - 83 │ } - > 84 │ @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) {} - │ ^ - 85 │ @mixin component($conf: ()) {} - 86 │ @mixin component($conf: ( )) {} - -mixin.css:85:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 83 │ } - 84 │ @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) {} - > 85 │ @mixin component($conf: ()) {} - │ ^ - 86 │ @mixin component($conf: ( )) {} - 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - -mixin.css:86:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 84 │ @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) {} - 85 │ @mixin component($conf: ()) {} - > 86 │ @mixin component($conf: ( )) {} - │ ^ - 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - -mixin.css:87:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 85 │ @mixin component($conf: ()) {} - 86 │ @mixin component($conf: ( )) {} - > 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - │ ^ - 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - -mixin.css:87:49 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 85 │ @mixin component($conf: ()) {} - 86 │ @mixin component($conf: ( )) {} - > 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - │ ^ - 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - -mixin.css:88:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 86 │ @mixin component($conf: ( )) {} - 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - > 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - │ ^ - 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - 90 │ @mixin button-variant( - -mixin.css:88:52 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 86 │ @mixin component($conf: ( )) {} - 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - > 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - │ ^ - 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - 90 │ @mixin button-variant( - -mixin.css:89:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - > 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - │ ^ - 90 │ @mixin button-variant( - 91 │ $hover-background: darken($background, 7.5%) - -mixin.css:89:48 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 87 │ @mixin button-variant($hover-background: darken($background, 7.5%)) {} - 88 │ @mixin button-variant( $hover-background : darken( $background , 7.5% ) ) {} - > 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - │ ^ - 90 │ @mixin button-variant( - 91 │ $hover-background: darken($background, 7.5%) - -mixin.css:91:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - 90 │ @mixin button-variant( - > 91 │ $hover-background: darken($background, 7.5%) - │ ^ - 92 │ ) {} - 93 │ @mixin - -mixin.css:91:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 89 │ @mixin button-variant($hover-background:darken($background,7.5%)) {} - 90 │ @mixin button-variant( - > 91 │ $hover-background: darken($background, 7.5%) - │ ^ - 92 │ ) {} - 93 │ @mixin - -mixin.css:95:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 93 │ @mixin - 94 │ button-variant( - > 95 │ $hover-background - │ ^ - 96 │ : - 97 │ darken( - -mixin.css:98:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 96 │ : - 97 │ darken( - > 98 │ $background - │ ^ - 99 │ , - 100 │ 7.5% - -mixin.css:104:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 102 │ ) - 103 │ {} - > 104 │ @mixin button-variant($foo: "...") {} - │ ^ - 105 │ @mixin button-variant($foo: " ... ") {} - 106 │ @mixin button-variant($foo: " ... ") {} - -mixin.css:105:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 103 │ {} - 104 │ @mixin button-variant($foo: "...") {} - > 105 │ @mixin button-variant($foo: " ... ") {} - │ ^ - 106 │ @mixin button-variant($foo: " ... ") {} - 107 │ @mixin sexy-border($color, $width, $foo: (color: red)) {} - -mixin.css:106:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 104 │ @mixin button-variant($foo: "...") {} - 105 │ @mixin button-variant($foo: " ... ") {} - > 106 │ @mixin button-variant($foo: " ... ") {} - │ ^ - 107 │ @mixin sexy-border($color, $width, $foo: (color: red)) {} - 108 │ - -mixin.css:107:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 105 │ @mixin button-variant($foo: " ... ") {} - 106 │ @mixin button-variant($foo: " ... ") {} - > 107 │ @mixin sexy-border($color, $width, $foo: (color: red)) {} - │ ^ - 108 │ - 109 │ @mixin selector($param: "value") {} - -mixin.css:107:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 105 │ @mixin button-variant($foo: " ... ") {} - 106 │ @mixin button-variant($foo: " ... ") {} - > 107 │ @mixin sexy-border($color, $width, $foo: (color: red)) {} - │ ^ - 108 │ - 109 │ @mixin selector($param: "value") {} - -mixin.css:107:36 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 105 │ @mixin button-variant($foo: " ... ") {} - 106 │ @mixin button-variant($foo: " ... ") {} - > 107 │ @mixin sexy-border($color, $width, $foo: (color: red)) {} - │ ^ - 108 │ - 109 │ @mixin selector($param: "value") {} - -mixin.css:109:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 107 │ @mixin sexy-border($color, $width, $foo: (color: red)) {} - 108 │ - > 109 │ @mixin selector($param: "value") {} - │ ^ - 110 │ - - -``` - # Lines exceeding max width of 80 characters ``` 78: @mixin mix($very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg1, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg2: 10, $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-args...) { diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/return.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/return.css.snap index 1968e525dc46..298866e49b89 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/return.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/return.css.snap @@ -391,722 +391,357 @@ $gutter-width ``` return.css:1:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. > 1 │ @function --grid-width($n) { - │ ^ + │ ^^ 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 3 │ } -return.css:2:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @function --grid-width($n) { - > 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ - 3 │ } - 4 │ @function --grid-width($n) { - -return.css:2:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @function --grid-width($n) { - > 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ - 3 │ } - 4 │ @function --grid-width($n) { - -return.css:2:33 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @function --grid-width($n) { - > 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ - 3 │ } - 4 │ @function --grid-width($n) { - -return.css:2:43 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. - 1 │ @function --grid-width($n) { - > 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ + > 1 │ @function --grid-width($n) { + │ ^^ + 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 3 │ } - 4 │ @function --grid-width($n) { return.css:4:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 3 │ } > 4 │ @function --grid-width($n) { - │ ^ + │ ^^ 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 6 │ } -return.css:5:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 3 │ } - 4 │ @function --grid-width($n) { - > 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ - 6 │ } - 7 │ @function --grid-width($n) { - -return.css:5:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 3 │ } - 4 │ @function --grid-width($n) { - > 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ - 6 │ } - 7 │ @function --grid-width($n) { - -return.css:5:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 3 │ } - 4 │ @function --grid-width($n) { - > 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ - 6 │ } - 7 │ @function --grid-width($n) { - -return.css:5:39 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 2 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 3 │ } - 4 │ @function --grid-width($n) { - > 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; - │ ^ + > 4 │ @function --grid-width($n) { + │ ^^ + 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 6 │ } - 7 │ @function --grid-width($n) { return.css:7:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; 6 │ } > 7 │ @function --grid-width($n) { - │ ^ + │ ^^ 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; 9 │ } -return.css:8:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 6 │ } - 7 │ @function --grid-width($n) { - > 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; - │ ^ - 9 │ } - 10 │ @function --grid-width($n) { - -return.css:8:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 6 │ } - 7 │ @function --grid-width($n) { - > 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; - │ ^ - 9 │ } - 10 │ @function --grid-width($n) { - -return.css:8:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. - 6 │ } - 7 │ @function --grid-width($n) { - > 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; - │ ^ - 9 │ } - 10 │ @function --grid-width($n) { - -return.css:8:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 6 │ } - 7 │ @function --grid-width($n) { - > 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; - │ ^ - 9 │ } - 10 │ @function --grid-width($n) { + 5 │ @return $n * $grid-width + ($n - 1) * $gutter-width / 10; + 6 │ } + > 7 │ @function --grid-width($n) { + │ ^^ + 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; + 9 │ } return.css:10:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; 9 │ } > 10 │ @function --grid-width($n) { - │ ^ + │ ^^ 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 12 │ } -return.css:11:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 9 │ } - 10 │ @function --grid-width($n) { - > 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ - 12 │ } - 13 │ @function --grid-width($n) { - -return.css:11:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 9 │ } - 10 │ @function --grid-width($n) { - > 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ - 12 │ } - 13 │ @function --grid-width($n) { - -return.css:11:34 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 9 │ } - 10 │ @function --grid-width($n) { - > 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ - 12 │ } - 13 │ @function --grid-width($n) { - -return.css:11:45 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 8 │ @return $n*$grid-width+($n-1)*$gutter-width/10; 9 │ } - 10 │ @function --grid-width($n) { - > 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ + > 10 │ @function --grid-width($n) { + │ ^^ + 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 12 │ } - 13 │ @function --grid-width($n) { return.css:13:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 12 │ } > 13 │ @function --grid-width($n) { - │ ^ + │ ^^ 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 15 │ } -return.css:14:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 12 │ } - 13 │ @function --grid-width($n) { - > 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ - 15 │ } - 16 │ @function --grid-width($n) { - -return.css:14:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 12 │ } - 13 │ @function --grid-width($n) { - > 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ - 15 │ } - 16 │ @function --grid-width($n) { - -return.css:14:41 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 12 │ } - 13 │ @function --grid-width($n) { - > 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ - 15 │ } - 16 │ @function --grid-width($n) { - -return.css:14:57 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 11 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 12 │ } - 13 │ @function --grid-width($n) { - > 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; - │ ^ + > 13 │ @function --grid-width($n) { + │ ^^ + 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 15 │ } - 16 │ @function --grid-width($n) { return.css:16:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 15 │ } > 16 │ @function --grid-width($n) { - │ ^ + │ ^^ 17 │ @return $n 18 │ * -return.css:17:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 14 │ @return $n * $grid-width + ( $n - 1 ) * $gutter-width / 10 ; 15 │ } - 16 │ @function --grid-width($n) { - > 17 │ @return $n - │ ^ - 18 │ * - 19 │ $grid-width - -return.css:19:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - + > 16 │ @function --grid-width($n) { + │ ^^ 17 │ @return $n 18 │ * - > 19 │ $grid-width - │ ^ - 20 │ + ( - 21 │ $n - -return.css:21:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 19 │ $grid-width - 20 │ + ( - > 21 │ $n - │ ^ - 22 │ - - 23 │ 1 - -return.css:26:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 24 │ ) - 25 │ * - > 26 │ $gutter-width - │ ^ - 27 │ / - 28 │ 10 return.css:31:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 29 │ ; 30 │ } > 31 │ @function --grid-width($n) { - │ ^ + │ ^^ 32 │ @return 33 │ $n -return.css:33:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. - 31 │ @function --grid-width($n) { + 29 │ ; + 30 │ } + > 31 │ @function --grid-width($n) { + │ ^^ 32 │ @return - > 33 │ $n - │ ^ - 34 │ * - 35 │ $grid-width - -return.css:35:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - 33 │ $n - 34 │ * - > 35 │ $grid-width - │ ^ - 36 │ + ( - 37 │ $n - -return.css:37:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 35 │ $grid-width - 36 │ + ( - > 37 │ $n - │ ^ - 38 │ - - 39 │ 1 - -return.css:42:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 40 │ ) - 41 │ * - > 42 │ $gutter-width - │ ^ - 43 │ / - 44 │ 10 return.css:49:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 47 │ @function 48 │ --grid-width( > 49 │ $n - │ ^ + │ ^^ 50 │ ) 51 │ { -return.css:53:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 47 │ @function + 48 │ --grid-width( + > 49 │ $n + │ ^^ + 50 │ ) 51 │ { - 52 │ @return - > 53 │ $n - │ ^ - 54 │ * - 55 │ $grid-width - -return.css:55:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 53 │ $n - 54 │ * - > 55 │ $grid-width - │ ^ - 56 │ + - 57 │ ( - -return.css:58:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 56 │ + - 57 │ ( - > 58 │ $n - │ ^ - 59 │ - - 60 │ 1 - -return.css:63:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 61 │ ) - 62 │ * - > 63 │ $gutter-width - │ ^ - 64 │ / - 65 │ 10 return.css:72:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 70 │ --grid-width( 71 │ > 72 │ $n - │ ^ + │ ^^ 73 │ 74 │ ) -return.css:80:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 78 │ @return - 79 │ - > 80 │ $n - │ ^ - 81 │ - 82 │ * + i Expected a function parameter here. -return.css:84:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 82 │ * - 83 │ - > 84 │ $grid-width - │ ^ - 85 │ - 86 │ + - -return.css:90:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ ( - 89 │ - > 90 │ $n - │ ^ - 91 │ - 92 │ - - -return.css:100:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 98 │ * - 99 │ - > 100 │ $gutter-width - │ ^ - 101 │ - 102 │ / + 70 │ --grid-width( + 71 │ + > 72 │ $n + │ ^^ + 73 │ + 74 │ ) return.css:109:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$n'. 108 │ } > 109 │ @function --grid-width($n) { - │ ^ + │ ^^ 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; 111 │ } -return.css:110:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. 108 │ } - 109 │ @function --grid-width($n) { - > 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; - │ ^ - 111 │ } - 112 │ @function --extend($obj, $ext-obj) { - -return.css:110:59 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 108 │ } - 109 │ @function --grid-width($n) { - > 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; - │ ^ - 111 │ } - 112 │ @function --extend($obj, $ext-obj) { - -return.css:110:106 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 108 │ } - 109 │ @function --grid-width($n) { - > 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; - │ ^ - 111 │ } - 112 │ @function --extend($obj, $ext-obj) { - -return.css:110:157 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 108 │ } - 109 │ @function --grid-width($n) { - > 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; - │ ^ + > 109 │ @function --grid-width($n) { + │ ^^ + 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; 111 │ } - 112 │ @function --extend($obj, $ext-obj) { return.css:112:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$obj'. 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; 111 │ } > 112 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 113 │ @return map-merge($obj, $ext-obj); 114 │ } -return.css:112:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; 111 │ } > 112 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 113 │ @return map-merge($obj, $ext-obj); 114 │ } -return.css:113:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +return.css:112:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$ext-obj'. + 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; 111 │ } - 112 │ @function --extend($obj, $ext-obj) { - > 113 │ @return map-merge($obj, $ext-obj); - │ ^ + > 112 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 113 │ @return map-merge($obj, $ext-obj); 114 │ } - 115 │ @function --extend($obj, $ext-obj) { -return.css:113:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 110 │ @return $very-very-very-very-very-very-vey-long-var * $very-very-very-very-very-very-vey-long-var + ($very-very-very-very-very-very-vey-long-var - 1) * $very-very-very-very-very-very-vey-long-var; 111 │ } - 112 │ @function --extend($obj, $ext-obj) { - > 113 │ @return map-merge($obj, $ext-obj); - │ ^ + > 112 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 113 │ @return map-merge($obj, $ext-obj); 114 │ } - 115 │ @function --extend($obj, $ext-obj) { return.css:115:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$obj'. 113 │ @return map-merge($obj, $ext-obj); 114 │ } > 115 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } -return.css:115:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. 113 │ @return map-merge($obj, $ext-obj); 114 │ } > 115 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } -return.css:116:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +return.css:115:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$ext-obj'. + 113 │ @return map-merge($obj, $ext-obj); 114 │ } - 115 │ @function --extend($obj, $ext-obj) { - > 116 │ @return map-merge( $obj , $ext-obj ) ; - │ ^ + > 115 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } - 118 │ @function --extend($obj, $ext-obj) { -return.css:116:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 113 │ @return map-merge($obj, $ext-obj); 114 │ } - 115 │ @function --extend($obj, $ext-obj) { - > 116 │ @return map-merge( $obj , $ext-obj ) ; - │ ^ + > 115 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } - 118 │ @function --extend($obj, $ext-obj) { return.css:118:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$obj'. 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } > 118 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 119 │ @return map-merge($obj,$ext-obj); 120 │ } -return.css:118:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } > 118 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 119 │ @return map-merge($obj,$ext-obj); 120 │ } -return.css:119:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +return.css:118:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$ext-obj'. + 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } - 118 │ @function --extend($obj, $ext-obj) { - > 119 │ @return map-merge($obj,$ext-obj); - │ ^ + > 118 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 119 │ @return map-merge($obj,$ext-obj); 120 │ } - 121 │ @function --extend($obj, $ext-obj) { -return.css:119:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. + 116 │ @return map-merge( $obj , $ext-obj ) ; 117 │ } - 118 │ @function --extend($obj, $ext-obj) { - > 119 │ @return map-merge($obj,$ext-obj); - │ ^ + > 118 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 119 │ @return map-merge($obj,$ext-obj); 120 │ } - 121 │ @function --extend($obj, $ext-obj) { return.css:121:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$obj'. 119 │ @return map-merge($obj,$ext-obj); 120 │ } > 121 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 122 │ @return 123 │ map-merge( -return.css:121:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected a function parameter here. 119 │ @return map-merge($obj,$ext-obj); 120 │ } > 121 │ @function --extend($obj, $ext-obj) { - │ ^ + │ ^^^^ 122 │ @return 123 │ map-merge( -return.css:124:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +return.css:121:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Expected a function parameter but instead found '$ext-obj'. + 119 │ @return map-merge($obj,$ext-obj); + 120 │ } + > 121 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ 122 │ @return 123 │ map-merge( - > 124 │ $obj - │ ^ - 125 │ , - 126 │ $ext-obj -return.css:126:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 124 │ $obj - 125 │ , - > 126 │ $ext-obj - │ ^ - 127 │ ) - 128 │ ; + i Expected a function parameter here. + + 119 │ @return map-merge($obj,$ext-obj); + 120 │ } + > 121 │ @function --extend($obj, $ext-obj) { + │ ^^^^^^^^ + 122 │ @return + 123 │ map-merge( ``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/while.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/while.css.snap index adf586675af2..5c33cd44084f 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/atrule/while.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/atrule/while.css.snap @@ -381,333 +381,6 @@ $i } ``` -# Errors -``` -while.css:1:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - > 1 │ @while $i > 0 {} - │ ^ - 2 │ @while $i>0{} - 3 │ @while $i > 0 {} - -while.css:2:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @while $i > 0 {} - > 2 │ @while $i>0{} - │ ^ - 3 │ @while $i > 0 {} - 4 │ @while $i - -while.css:3:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ @while $i > 0 {} - 2 │ @while $i>0{} - > 3 │ @while $i > 0 {} - │ ^ - 4 │ @while $i - 5 │ > - -while.css:4:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 2 │ @while $i>0{} - 3 │ @while $i > 0 {} - > 4 │ @while $i - │ ^ - 5 │ > - 6 │ 0 - -while.css:9:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 7 │ {} - 8 │ @while - > 9 │ $i - │ ^ - 10 │ > - 11 │ 0 - -while.css:14:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 12 │ {} - 13 │ @while - > 14 │ $i - │ ^ - 15 │ > - 16 │ 0 - -while.css:21:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 19 │ @while - 20 │ - > 21 │ $i - │ ^ - 22 │ - 23 │ > - -while.css:30:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 29 │ } - > 30 │ @while ($i > 0) {} - │ ^ - 31 │ @while ($i>0){} - 32 │ @while ( $i > 0 ) {} - -while.css:31:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 29 │ } - 30 │ @while ($i > 0) {} - > 31 │ @while ($i>0){} - │ ^ - 32 │ @while ( $i > 0 ) {} - 33 │ @while ( $i > 0 ) {} - -while.css:32:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 30 │ @while ($i > 0) {} - 31 │ @while ($i>0){} - > 32 │ @while ( $i > 0 ) {} - │ ^ - 33 │ @while ( $i > 0 ) {} - 34 │ @while ( - -while.css:33:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 31 │ @while ($i>0){} - 32 │ @while ( $i > 0 ) {} - > 33 │ @while ( $i > 0 ) {} - │ ^ - 34 │ @while ( - 35 │ $i > 0 - -while.css:35:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 33 │ @while ( $i > 0 ) {} - 34 │ @while ( - > 35 │ $i > 0 - │ ^ - 36 │ ) {} - 37 │ @while - -while.css:38:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 36 │ ) {} - 37 │ @while - > 38 │ ($i > 0) {} - │ ^ - 39 │ @while - 40 │ ( - -while.css:41:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 39 │ @while - 40 │ ( - > 41 │ $i - │ ^ - 42 │ > - 43 │ 0 - -while.css:51:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 49 │ ( - 50 │ - > 51 │ $i - │ ^ - 52 │ - 53 │ > - -while.css:62:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 61 │ } - > 62 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1 {} - │ ^ - 63 │ @while 1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - 64 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - -while.css:63:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 61 │ } - 62 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1 {} - > 63 │ @while 1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - │ ^ - 64 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - 65 │ @while (($i) > (0)) {} - -while.css:64:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 62 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1 {} - 63 │ @while 1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - > 64 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - │ ^ - 65 │ @while (($i) > (0)) {} - 66 │ @while (($i)>(0)){} - -while.css:64:100 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 62 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1 {} - 63 │ @while 1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - > 64 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - │ ^ - 65 │ @while (($i) > (0)) {} - 66 │ @while (($i)>(0)){} - -while.css:65:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 63 │ @while 1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - 64 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - > 65 │ @while (($i) > (0)) {} - │ ^ - 66 │ @while (($i)>(0)){} - 67 │ @while ( ( $i ) > ( 0 ) ) {} - -while.css:66:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 64 │ @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var {} - 65 │ @while (($i) > (0)) {} - > 66 │ @while (($i)>(0)){} - │ ^ - 67 │ @while ( ( $i ) > ( 0 ) ) {} - 68 │ @while (($i) - -while.css:67:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 65 │ @while (($i) > (0)) {} - 66 │ @while (($i)>(0)){} - > 67 │ @while ( ( $i ) > ( 0 ) ) {} - │ ^ - 68 │ @while (($i) - 69 │ > - -while.css:68:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 66 │ @while (($i)>(0)){} - 67 │ @while ( ( $i ) > ( 0 ) ) {} - > 68 │ @while (($i) - │ ^ - 69 │ > - 70 │ (0) - -while.css:75:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 73 │ ( - 74 │ ( - > 75 │ $i - │ ^ - 76 │ ) - 77 │ > - -while.css:90:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 88 │ ( - 89 │ - > 90 │ $i - │ ^ - 91 │ - 92 │ ) - -while.css:107:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 106 │ } - > 107 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - │ ^ - 108 │ @while (1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - 109 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - -while.css:108:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 106 │ } - 107 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - > 108 │ @while (1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - │ ^ - 109 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - 110 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - -while.css:109:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 107 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - 108 │ @while (1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - > 109 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - │ ^ - 110 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - 111 │ - -while.css:110:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 108 │ @while (1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - 109 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - > 110 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - │ ^ - 111 │ - -while.css:110:101 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 108 │ @while (1 > $very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - 109 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1) {} - > 110 │ @while ($very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > $other-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var) {} - │ ^ - 111 │ - - -``` - # Lines exceeding max width of 80 characters ``` 55: @while $very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-var > 1 { diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/fill-value/fill.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/fill-value/fill.css.snap index 0ff9b1f75754..7399df19a0ff 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/fill-value/fill.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/fill-value/fill.css.snap @@ -18,7 +18,7 @@ div { ```diff --- Prettier +++ Biome -@@ -1,11 +1,6 @@ +@@ -1,11 +1,4 @@ div { - border-left: 1px solid - mix($warningBackgroundColors, $warningBorderColors, 50%); @@ -30,9 +30,7 @@ div { - Arial, - sans-serif; + border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); -+ $ -+ fontFamily: -+ "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; ++ $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; } ``` @@ -41,9 +39,7 @@ div { ```css div { border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); - $ - fontFamily: - "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; + $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; } ``` @@ -51,63 +47,46 @@ div { ``` fill.css:2:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` - - 1 │ div { - > 2 │ border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); - │ ^ - 3 │ $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; - 4 │ } - -fill.css:2:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `warningBackgroundColors` + × SCSS variables are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 1 │ div { > 2 │ border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); - │ ^^^^^^^^^^^^^^^^^^^^^^^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^ 3 │ $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; 4 │ } - i Remove warningBackgroundColors + i SCSS only syntax fill.css:2:56 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variables are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 1 │ div { > 2 │ border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^ 3 │ $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; 4 │ } -fill.css:2:57 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `warningBorderColors` - - 1 │ div { - > 2 │ border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); - │ ^^^^^^^^^^^^^^^^^^^ - 3 │ $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; - 4 │ } - - i Remove warningBorderColors + i SCSS only syntax fill.css:3:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variable declarations are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 1 │ div { 2 │ border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); > 3 │ $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 │ } 5 │ + i SCSS only syntax + ``` # Lines exceeding max width of 80 characters ``` 2: border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%); + 3: $fontFamily: "Lato", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; ``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/parens/empty-lines.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/parens/empty-lines.css.snap index df2a783cc3dd..87dd5490113d 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/parens/empty-lines.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/parens/empty-lines.css.snap @@ -26,24 +26,20 @@ $colours: ( ```diff --- Prettier +++ Biome -@@ -1,7 +1,15 @@ --$colours: ( +@@ -1,7 +1,12 @@ + $colours: ( - "text": $light-100, - "background-primary": $dark-300, -+$ -+colours: -+( -+ "text" -+: $light-100, ++ "text": $light-100, + "background-primary": $dark-300, + -+ -+ - "background-secondary": $dark-200, - "background-tertiary": $dark-100 + + ++ ++ + "background-secondary": $dark-200, + "background-tertiary": $dark-100 ); @@ -52,11 +48,8 @@ $colours: ( # Output ```css -$ -colours: -( - "text" -: $light-100, +$colours: ( + "text": $light-100, "background-primary": $dark-300, @@ -73,283 +66,39 @@ colours: ``` empty-lines.css:1:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` - - > 1 │ $colours: ( - │ ^ - 2 │ "text": $light-100, - 3 │ "background-primary": $dark-300, - -empty-lines.css:1:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Unexpected value or character. - - > 1 │ $colours: ( - │ ^ - 2 │ "text": $light-100, - 3 │ "background-primary": $dark-300, - - i Expected one of: - - - hover - - focus - - active - - first-child - - last-child - - nth-child - - nth-last-child - - first-of-type - - last-of-type - - nth-of-type - - nth-last-of-type - - only-child - - only-of-type - - checked - - disabled - - enabled - - required - - optional - - valid - - invalid - - in-range - - out-of-range - - read-only - - read-write - - placeholder-shown - - default - - checked - - indeterminate - - blank - - empty - - root - - target - - lang - - not - - is - - where - - fullscreen - - link - - visited - - any-link - - local-link - - scope - - state - - current - - past - - future - -empty-lines.css:2:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ $colours: ( - > 2 │ "text": $light-100, - │ ^ - 3 │ "background-primary": $dark-300, - 4 │ - -empty-lines.css:2:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `light-100` - - 1 │ $colours: ( - > 2 │ "text": $light-100, - │ ^^^^^^^^^ - 3 │ "background-primary": $dark-300, - 4 │ - - i Remove light-100 - -empty-lines.css:3:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a selector but instead found '"background-primary"'. - - 1 │ $colours: ( - 2 │ "text": $light-100, - > 3 │ "background-primary": $dark-300, - │ ^^^^^^^^^^^^^^^^^^^^ - 4 │ - - i Expected a selector here. - - 1 │ $colours: ( - 2 │ "text": $light-100, - > 3 │ "background-primary": $dark-300, - │ ^^^^^^^^^^^^^^^^^^^^ - 4 │ - -empty-lines.css:3:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `:` - - 1 │ $colours: ( - 2 │ "text": $light-100, - > 3 │ "background-primary": $dark-300, - │ ^ - 4 │ - - i Remove : - -empty-lines.css:3:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ $colours: ( - 2 │ "text": $light-100, - > 3 │ "background-primary": $dark-300, - │ ^ - 4 │ - -empty-lines.css:3:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `dark-300` - - 1 │ $colours: ( - 2 │ "text": $light-100, - > 3 │ "background-primary": $dark-300, - │ ^^^^^^^^ - 4 │ - - i Remove dark-300 - -empty-lines.css:10:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a selector but instead found '"background-secondary"'. - - > 10 │ "background-secondary": $dark-200, - │ ^^^^^^^^^^^^^^^^^^^^^^ - 11 │ "background-tertiary": $dark-100 - 12 │ ); - - i Expected a selector here. - - > 10 │ "background-secondary": $dark-200, - │ ^^^^^^^^^^^^^^^^^^^^^^ - 11 │ "background-tertiary": $dark-100 - 12 │ ); - -empty-lines.css:10:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `:` - - > 10 │ "background-secondary": $dark-200, - │ ^ - 11 │ "background-tertiary": $dark-100 - 12 │ ); - - i Remove : - -empty-lines.css:10:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - > 10 │ "background-secondary": $dark-200, - │ ^ - 11 │ "background-tertiary": $dark-100 - 12 │ ); - -empty-lines.css:10:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `dark-200` + × SCSS variable declarations are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. + > 1 │ $colours: ( + │ ^^^^^^^^^^^ + > 2 │ "text": $light-100, + > 3 │ "background-primary": $dark-300, + > 4 │ + ... > 10 │ "background-secondary": $dark-200, - │ ^^^^^^^^ - 11 │ "background-tertiary": $dark-100 - 12 │ ); - - i Remove dark-200 - -empty-lines.css:11:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a selector but instead found '"background-tertiary"'. - - 10 │ "background-secondary": $dark-200, - > 11 │ "background-tertiary": $dark-100 - │ ^^^^^^^^^^^^^^^^^^^^^ - 12 │ ); - 13 │ - - i Expected a selector here. - - 10 │ "background-secondary": $dark-200, - > 11 │ "background-tertiary": $dark-100 - │ ^^^^^^^^^^^^^^^^^^^^^ - 12 │ ); - 13 │ - -empty-lines.css:11:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `:` - - 10 │ "background-secondary": $dark-200, > 11 │ "background-tertiary": $dark-100 - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 │ ); 13 │ - i Remove : - -empty-lines.css:11:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 10 │ "background-secondary": $dark-200, - > 11 │ "background-tertiary": $dark-100 - │ ^ - 12 │ ); - 13 │ - -empty-lines.css:11:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `dark-100` - - 10 │ "background-secondary": $dark-200, - > 11 │ "background-tertiary": $dark-100 - │ ^^^^^^^^ - 12 │ ); - 13 │ - - i Remove dark-100 + i SCSS only syntax empty-lines.css:12:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × expected `,` but instead found `)` + × Expected a qualified rule, or an at rule but instead found ');'. 10 │ "background-secondary": $dark-200, 11 │ "background-tertiary": $dark-100 > 12 │ ); - │ ^ + │ ^^ 13 │ - i Remove ) - -empty-lines.css:12:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `,` but instead found `;` + i Expected a qualified rule, or an at rule here. 10 │ "background-secondary": $dark-200, 11 │ "background-tertiary": $dark-100 > 12 │ ); - │ ^ + │ ^^ 13 │ - i Remove ; - -empty-lines.css:13:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `}` but instead the file ends - - 11 │ "background-tertiary": $dark-100 - 12 │ ); - > 13 │ - │ - - i the file ends here - - 11 │ "background-tertiary": $dark-100 - 12 │ ); - > 13 │ - │ - ``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-mixins.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-mixins.css.snap index c550d4355110..21500da38b77 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-mixins.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-mixins.css.snap @@ -107,41 +107,9 @@ a { # Errors ``` -postcss-mixins.css:2:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 1 │ a { - > 2 │ @mixin $(theme)-colors; - │ ^ - 3 │ } - 4 │ - -postcss-mixins.css:5:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 3 │ } - 4 │ - > 5 │ @define-mixin icon $network, $color: blue { - │ ^ - 6 │ .icon.is-$(network) { - 7 │ color: $color; - -postcss-mixins.css:5:30 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` - - 3 │ } - 4 │ - > 5 │ @define-mixin icon $network, $color: blue { - │ ^ - 6 │ .icon.is-$(network) { - 7 │ color: $color; - postcss-mixins.css:6:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × expected `,` but instead found `$` 5 │ @define-mixin icon $network, $color: blue { > 6 │ .icon.is-$(network) { @@ -149,6 +117,8 @@ postcss-mixins.css:6:14 parse ━━━━━━━━━━━━━━━━ 7 │ color: $color; 8 │ @mixin-content; + i Remove $ + postcss-mixins.css:6:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `network` @@ -175,18 +145,20 @@ postcss-mixins.css:6:23 parse ━━━━━━━━━━━━━━━━ postcss-mixins.css:7:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variables are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 5 │ @define-mixin icon $network, $color: blue { 6 │ .icon.is-$(network) { > 7 │ color: $color; - │ ^ + │ ^^^^^^ 8 │ @mixin-content; 9 │ } + i SCSS only syntax + postcss-mixins.css:10:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × expected `,` but instead found `$` 8 │ @mixin-content; 9 │ } @@ -195,6 +167,8 @@ postcss-mixins.css:10:14 parse ━━━━━━━━━━━━━━━━ 11 │ color: white; 12 │ background: $color; + i Remove $ + postcss-mixins.css:10:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `network` @@ -236,14 +210,16 @@ postcss-mixins.css:10:24 parse ━━━━━━━━━━━━━━━━ postcss-mixins.css:12:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variables are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 10 │ .icon.is-$(network):hover { 11 │ color: white; > 12 │ background: $color; - │ ^ + │ ^^^^^^ 13 │ } 14 │ } + i SCSS only syntax + ``` diff --git a/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-simple-vars.css.snap b/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-simple-vars.css.snap index 742ded974ac3..8dc80d12be8e 100644 --- a/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-simple-vars.css.snap +++ b/crates/biome_css_formatter/tests/specs/prettier/css/postcss-plugins/postcss-simple-vars.css.snap @@ -52,21 +52,61 @@ color: @@(style)color123; ``` postcss-simple-vars.css:1:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Unexpected value or character. > 1 │ background-color: $$(style)Color; │ ^ 2 │ background-color: $$(style)Color Color122; 3 │ color: @@color; -postcss-simple-vars.css:1:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected one of: - > 1 │ background-color: $$(style)Color; - │ ^ - 2 │ background-color: $$(style)Color Color122; - 3 │ color: @@color; + - hover + - focus + - active + - first-child + - last-child + - nth-child + - nth-last-child + - first-of-type + - last-of-type + - nth-of-type + - nth-last-of-type + - only-child + - only-of-type + - checked + - disabled + - enabled + - required + - optional + - valid + - invalid + - in-range + - out-of-range + - read-only + - read-write + - placeholder-shown + - default + - checked + - indeterminate + - blank + - empty + - root + - target + - lang + - not + - is + - where + - fullscreen + - link + - visited + - any-link + - local-link + - scope + - state + - current + - past + - future postcss-simple-vars.css:1:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -114,23 +154,23 @@ postcss-simple-vars.css:1:33 parse ━━━━━━━━━━━━━━━ postcss-simple-vars.css:2:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Unexpected value or character. 1 │ background-color: $$(style)Color; > 2 │ background-color: $$(style)Color Color122; - │ ^ + │ ^^^^^^^^^^^^^^^^^^^^^^^ 3 │ color: @@color; 4 │ font: 100% $font-stack; -postcss-simple-vars.css:2:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unexpected character `$` + i Expected one of: - 1 │ background-color: $$(style)Color; - > 2 │ background-color: $$(style)Color Color122; - │ ^ - 3 │ color: @@color; - 4 │ font: 100% $font-stack; + - identifier + - string + - number + - dimension + - ratio + - custom property + - function postcss-simple-vars.css:3:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -155,15 +195,17 @@ postcss-simple-vars.css:3:8 parse ━━━━━━━━━━━━━━━ postcss-simple-vars.css:4:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × SCSS variables are an SCSS only feature. Convert your file to an SCSS file or remove the syntax. 2 │ background-color: $$(style)Color Color122; 3 │ color: @@color; > 4 │ font: 100% $font-stack; - │ ^ + │ ^^^^^^^^^^^ 5 │ background-color: darken(@link-color, 10%); 6 │ border: 1px solid var(--border-color); + i SCSS only syntax + postcss-simple-vars.css:5:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a declaration item but instead found '@'. @@ -199,15 +241,25 @@ postcss-simple-vars.css:5:27 parse ━━━━━━━━━━━━━━━ postcss-simple-vars.css:7:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × Unexpected value or character. 5 │ background-color: darken(@link-color, 10%); 6 │ border: 1px solid var(--border-color); > 7 │ color: $(style)color; - │ ^ + │ ^^^^^^^^^^^^^ 8 │ color: @@(style) color123; 9 │ color: @@(style)color123; + i Expected one of: + + - identifier + - string + - number + - dimension + - ratio + - custom property + - function + postcss-simple-vars.css:8:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Unexpected value or character. diff --git a/crates/biome_css_parser/src/lexer/mod.rs b/crates/biome_css_parser/src/lexer/mod.rs index 0612d6aace9c..7b7a9ee96532 100644 --- a/crates/biome_css_parser/src/lexer/mod.rs +++ b/crates/biome_css_parser/src/lexer/mod.rs @@ -3,7 +3,7 @@ mod tests; use crate::CssParserOptions; -use biome_css_syntax::{CssSyntaxKind, CssSyntaxKind::*, T, TextLen, TextSize}; +use biome_css_syntax::{CssFileSource, CssSyntaxKind, CssSyntaxKind::*, T, TextLen, TextSize}; use biome_parser::diagnostic::ParseDiagnostic; use biome_parser::lexer::{ LexContext, Lexer, LexerCheckpoint, LexerWithCheckpoint, ReLexer, TokenFlags, @@ -94,6 +94,8 @@ pub(crate) struct CssLexer<'src> { diagnostics: Vec, options: CssParserOptions, + + source_type: CssFileSource, } impl<'src> Lexer<'src> for CssLexer<'src> { @@ -216,6 +218,7 @@ impl<'src> CssLexer<'src> { position: 0, diagnostics: vec![], options: CssParserOptions::default(), + source_type: CssFileSource::default(), } } @@ -223,6 +226,13 @@ impl<'src> CssLexer<'src> { Self { options, ..self } } + pub(crate) fn with_source_type(self, source_type: CssFileSource) -> Self { + Self { + source_type, + ..self + } + } + /// Bumps the current byte and creates a lexed token of the passed in kind fn consume_byte(&mut self, tok: CssSyntaxKind) -> CssSyntaxKind { self.advance(1); @@ -327,6 +337,7 @@ impl<'src> CssLexer<'src> { self.advance(1); self.consume_byte(T!["$="]) } + DOL => self.consume_byte(T![$]), UNI if self.options.is_metavariable_enabled() && self.is_metavariable_start() => { self.consume_metavariable(GRIT_METAVARIABLE) } @@ -1099,17 +1110,29 @@ impl<'src> CssLexer<'src> { self.advance(2); let mut has_newline = false; + let is_scss = self.source_type.is_scss(); + let mut depth = 1u32; while let Some(chr) = self.current_byte() { match chr { + b'/' if is_scss && self.peek_byte() == Some(b'*') => { + self.advance(2); + depth = depth.saturating_add(1); + } b'*' if self.peek_byte() == Some(b'/') => { self.advance(2); - if has_newline { - self.after_newline = true; - return MULTILINE_COMMENT; - } else { - return COMMENT; + if is_scss { + depth = depth.saturating_sub(1); + } + + if !is_scss || depth == 0 { + if has_newline { + self.after_newline = true; + return MULTILINE_COMMENT; + } else { + return COMMENT; + } } } b'\n' | b'\r' => { @@ -1135,7 +1158,7 @@ impl<'src> CssLexer<'src> { COMMENT } } - Some(b'/') if self.options.allow_wrong_line_comments => { + Some(b'/') if self.options.allow_wrong_line_comments || self.source_type.is_scss() => { self.advance(2); while let Some(chr) = self.current_byte() { diff --git a/crates/biome_css_parser/src/lib.rs b/crates/biome_css_parser/src/lib.rs index 9bd9e80ba660..a7b409455212 100644 --- a/crates/biome_css_parser/src/lib.rs +++ b/crates/biome_css_parser/src/lib.rs @@ -73,9 +73,9 @@ impl CssParse { /// use biome_css_parser::CssParserOptions; /// let parse = parse_css(r#""#, CssFileSource::css(), CssParserOptions::default()); /// - /// let root_value = parse.tree().as_css_root().unwrap().rules(); + /// let root_value = parse.tree().as_css_root().unwrap().items(); /// - /// assert_eq!(root_value.syntax().kind(), CssSyntaxKind::CSS_RULE_LIST); + /// assert_eq!(root_value.syntax().kind(), CssSyntaxKind::CSS_ROOT_ITEM_LIST); /// /// # Ok(()) /// # } diff --git a/crates/biome_css_parser/src/parser.rs b/crates/biome_css_parser/src/parser.rs index 33a216053297..50bea9c8c9a6 100644 --- a/crates/biome_css_parser/src/parser.rs +++ b/crates/biome_css_parser/src/parser.rs @@ -110,7 +110,7 @@ impl<'source> CssParser<'source> { ) -> Self { Self { context: ParserContext::default(), - source: CssTokenSource::from_str(source, options), + source: CssTokenSource::from_str(source, options, source_type), source_type, state: CssParserState::new(), options, diff --git a/crates/biome_css_parser/src/syntax/block/declaration_block.rs b/crates/biome_css_parser/src/syntax/block/declaration_block.rs index 54bc08ada89d..f30a8a6430d7 100644 --- a/crates/biome_css_parser/src/syntax/block/declaration_block.rs +++ b/crates/biome_css_parser/src/syntax/block/declaration_block.rs @@ -1,6 +1,6 @@ use crate::parser::CssParser; use crate::syntax::block::ParseBlockBody; -use crate::syntax::{DeclarationList, is_at_declaration}; +use crate::syntax::{DeclarationList, is_at_any_declaration}; use biome_css_syntax::CssSyntaxKind; use biome_css_syntax::CssSyntaxKind::*; use biome_parser::CompletedMarker; @@ -16,7 +16,7 @@ impl ParseBlockBody for DeclarationBlock { const BLOCK_KIND: CssSyntaxKind = CSS_DECLARATION_BLOCK; fn is_at_element(&self, p: &mut CssParser) -> bool { - is_at_declaration(p) + is_at_any_declaration(p) } fn parse_list(&mut self, p: &mut CssParser) { diff --git a/crates/biome_css_parser/src/syntax/declaration.rs b/crates/biome_css_parser/src/syntax/declaration.rs new file mode 100644 index 000000000000..06a80c8d5798 --- /dev/null +++ b/crates/biome_css_parser/src/syntax/declaration.rs @@ -0,0 +1,147 @@ +use crate::parser::CssParser; +use crate::syntax::CssSyntaxFeatures; +use crate::syntax::parse_error::{expected_declaration_item, scss_only_syntax_error}; +use crate::syntax::property::{is_at_any_property, parse_any_property}; +use crate::syntax::scss::{is_at_scss_declaration, parse_scss_declaration}; +use biome_css_syntax::CssSyntaxKind::*; +use biome_css_syntax::{CssSyntaxKind, T}; +use biome_parser::parse_lists::ParseNodeList; +use biome_parser::parse_recovery::{ParseRecoveryTokenSet, RecoveryResult}; +use biome_parser::prelude::ParsedSyntax; +use biome_parser::prelude::ParsedSyntax::{Absent, Present}; +use biome_parser::{Parser, SyntaxFeature, token_set}; + +pub(crate) struct DeclarationList; + +impl ParseNodeList for DeclarationList { + type Kind = CssSyntaxKind; + type Parser<'source> = CssParser<'source>; + const LIST_KIND: Self::Kind = CSS_DECLARATION_LIST; + + fn parse_element(&mut self, p: &mut Self::Parser<'_>) -> ParsedSyntax { + parse_any_declaration_with_semicolon(p) + } + + fn is_at_list_end(&self, p: &mut Self::Parser<'_>) -> bool { + p.at(T!['}']) + } + + fn recover( + &mut self, + p: &mut Self::Parser<'_>, + parsed_element: ParsedSyntax, + ) -> RecoveryResult { + parsed_element.or_recover_with_token_set( + p, + &ParseRecoveryTokenSet::new(CSS_BOGUS, token_set!(T!['}'])), + expected_declaration_item, + ) + } +} + +pub(crate) fn is_at_declaration(p: &mut CssParser) -> bool { + is_at_any_property(p) +} + +#[inline] +pub(crate) fn parse_declaration(p: &mut CssParser) -> ParsedSyntax { + if !is_at_declaration(p) { + return Absent; + } + + let m = p.start(); + + parse_any_property(p).ok(); + parse_declaration_important(p).ok(); + + Present(m.complete(p, CSS_DECLARATION)) +} + +#[inline] +pub(crate) fn is_at_any_declaration_with_semicolon(p: &mut CssParser) -> bool { + is_at_any_declaration(p) || is_at_empty_declaration(p) +} + +#[inline] +pub(crate) fn parse_any_declaration_with_semicolon(p: &mut CssParser) -> ParsedSyntax { + if is_at_empty_declaration(p) { + parse_empty_declaration(p) + } else if is_at_scss_declaration(p) { + CssSyntaxFeatures::Scss.parse_exclusive_syntax(p, parse_scss_declaration, |p, marker| { + scss_only_syntax_error(p, "SCSS variable declarations", marker.range(p)) + }) + } else if is_at_any_declaration_with_semicolon(p) { + parse_declaration_with_semicolon(p) + } else { + Absent + } +} + +#[inline] +pub(crate) fn is_at_any_declaration(p: &mut CssParser) -> bool { + is_at_declaration(p) || is_at_scss_declaration(p) +} + +/// Parses a CSS declaration that may optionally end with a semicolon. +/// +/// This function attempts to parse a single CSS declaration from the current position +/// of the parser. It handles the optional semicolon (';') at the end of the declaration, +/// adhering to CSS syntax rules where the semicolon is mandatory for all declarations +/// except the last one in a block. In the case of the last declaration before a closing +/// brace ('}'), the semicolon is optional. If the semicolon is omitted for declarations +/// that are not at the end, the parser will raise an error. +#[inline] +pub(crate) fn parse_declaration_with_semicolon(p: &mut CssParser) -> ParsedSyntax { + if !is_at_declaration(p) { + return Absent; + } + + let m = p.start(); + + parse_declaration(p).ok(); + + // If the next token is a closing brace ('}'), the semicolon is optional. + // Otherwise, a semicolon is expected and the parser will enforce its presence. + // div { color: red; } + // div { color: red } + if !p.at(T!['}']) { + if p.nth_at(1, T!['}']) { + p.eat(T![;]); + } else { + p.expect(T![;]); + } + } + + Present(m.complete(p, CSS_DECLARATION_WITH_SEMICOLON)) +} + +#[inline] +pub(crate) fn is_at_empty_declaration(p: &mut CssParser) -> bool { + p.at(T![;]) +} + +#[inline] +pub(crate) fn parse_empty_declaration(p: &mut CssParser) -> ParsedSyntax { + if !is_at_empty_declaration(p) { + return Absent; + } + let m = p.start(); + p.bump(T![;]); + Present(m.complete(p, CSS_EMPTY_DECLARATION)) +} + +#[inline] +fn is_at_declaration_important(p: &mut CssParser) -> bool { + p.at(T![!]) && p.nth_at(1, T![important]) +} + +#[inline] +fn parse_declaration_important(p: &mut CssParser) -> ParsedSyntax { + if !is_at_declaration_important(p) { + return Absent; + } + let m = p.start(); + p.bump(T![!]); + p.bump(T![important]); + Present(m.complete(p, CSS_DECLARATION_IMPORTANT)) +} diff --git a/crates/biome_css_parser/src/syntax/mod.rs b/crates/biome_css_parser/src/syntax/mod.rs index faecb131c34f..6abc40228bfc 100644 --- a/crates/biome_css_parser/src/syntax/mod.rs +++ b/crates/biome_css_parser/src/syntax/mod.rs @@ -1,8 +1,10 @@ mod at_rule; mod block; mod css_modules; +mod declaration; mod parse_error; mod property; +mod scss; mod selector; mod util; mod value; @@ -12,11 +14,14 @@ use crate::parser::CssParser; use crate::syntax::at_rule::{is_at_at_rule, parse_at_rule}; use crate::syntax::block::{DeclarationOrRuleList, parse_declaration_or_rule_list_block}; use crate::syntax::parse_error::{ - expected_any_rule, expected_non_css_wide_keyword_identifier, tailwind_disabled, + expected_any_rule, expected_component_value, expected_non_css_wide_keyword_identifier, + scss_only_syntax_error, tailwind_disabled, }; use crate::syntax::property::color::{is_at_color, parse_color}; use crate::syntax::property::unicode_range::{is_at_unicode_range, parse_unicode_range}; -use crate::syntax::property::{is_at_any_property, parse_any_property}; +use crate::syntax::scss::{ + is_at_scss_declaration, is_at_scss_identifier, parse_scss_declaration, parse_scss_identifier, +}; use crate::syntax::selector::SelectorList; use crate::syntax::selector::is_nth_at_selector; use crate::syntax::selector::relative_selector::{RelativeSelectorList, is_at_relative_selector}; @@ -33,9 +38,9 @@ use biome_parser::{Parser, SyntaxFeature, token_set}; use value::dimension::{is_at_any_dimension, parse_any_dimension}; use value::function::{is_at_any_function, parse_any_function}; -use self::parse_error::{expected_component_value, expected_declaration_item}; - pub(crate) enum CssSyntaxFeatures { + /// Enable support for SCSS-specific syntax. + Scss, /// Enable support for Tailwind CSS directives and syntax. Tailwind, @@ -46,11 +51,17 @@ pub(crate) enum CssSyntaxFeatures { CssModulesWithVue, } +pub(crate) use declaration::{ + DeclarationList, is_at_any_declaration, is_at_any_declaration_with_semicolon, + is_at_declaration, parse_any_declaration_with_semicolon, parse_declaration, +}; + impl SyntaxFeature for CssSyntaxFeatures { type Parser<'source> = CssParser<'source>; fn is_supported(&self, p: &Self::Parser<'_>) -> bool { match self { + Self::Scss => p.source_type.is_scss(), Self::Tailwind => p.options().is_tailwind_directives_enabled(), Self::CssModules => p.options().is_css_modules_enabled(), Self::CssModulesWithVue => p.options().is_css_modules_vue_enabled(), @@ -69,13 +80,68 @@ pub(crate) fn parse_root(p: &mut CssParser) { EmbeddingKind::None | EmbeddingKind::Html(_) => { p.eat(UNICODE_BOM); - RuleList::new(EOF).parse_list(p); + RootItemList.parse_list(p); m.complete(p, CSS_ROOT); } } } +struct RootItemList; + +#[inline] +pub(crate) fn is_at_root_item_list_element(p: &mut CssParser) -> bool { + is_at_at_rule(p) || is_at_scss_declaration(p) || is_at_qualified_rule(p) +} + +struct RootItemListParseRecovery; + +impl ParseRecovery for RootItemListParseRecovery { + type Kind = CssSyntaxKind; + type Parser<'source> = CssParser<'source>; + const RECOVERED_KIND: Self::Kind = CSS_BOGUS_RULE; + + fn is_at_recovered(&self, p: &mut Self::Parser<'_>) -> bool { + p.at(EOF) || is_at_root_item_list_element(p) + } +} + +impl ParseNodeList for RootItemList { + type Kind = CssSyntaxKind; + type Parser<'source> = CssParser<'source>; + const LIST_KIND: Self::Kind = CSS_ROOT_ITEM_LIST; + + fn parse_element(&mut self, p: &mut Self::Parser<'_>) -> ParsedSyntax { + if is_at_at_rule(p) { + parse_at_rule(p) + } else if is_at_scss_declaration(p) { + CssSyntaxFeatures::Scss.parse_exclusive_syntax( + p, + parse_scss_declaration, + |p, marker| { + scss_only_syntax_error(p, "SCSS variable declarations", marker.range(p)) + }, + ) + } else if is_at_qualified_rule(p) { + parse_qualified_rule(p) + } else { + Absent + } + } + + fn is_at_list_end(&self, p: &mut Self::Parser<'_>) -> bool { + p.at(EOF) + } + + fn recover( + &mut self, + p: &mut Self::Parser<'_>, + parsed_element: ParsedSyntax, + ) -> RecoveryResult { + parsed_element.or_recover(p, &RootItemListParseRecovery, expected_any_rule) + } +} + struct RuleList { end_kind: CssSyntaxKind, } @@ -191,131 +257,6 @@ pub(crate) fn parse_nested_qualified_rule(p: &mut CssParser) -> ParsedSyntax { Present(m.complete(p, CSS_NESTED_QUALIFIED_RULE)) } -pub(crate) struct DeclarationList; - -impl ParseNodeList for DeclarationList { - type Kind = CssSyntaxKind; - type Parser<'source> = CssParser<'source>; - const LIST_KIND: Self::Kind = CSS_DECLARATION_LIST; - - fn parse_element(&mut self, p: &mut Self::Parser<'_>) -> ParsedSyntax { - parse_declaration_with_semicolon(p) - } - - fn is_at_list_end(&self, p: &mut Self::Parser<'_>) -> bool { - p.at(T!['}']) - } - - fn recover( - &mut self, - p: &mut Self::Parser<'_>, - parsed_element: ParsedSyntax, - ) -> RecoveryResult { - parsed_element.or_recover_with_token_set( - p, - &ParseRecoveryTokenSet::new(CSS_BOGUS, token_set!(T!['}'])), - expected_declaration_item, - ) - } -} - -pub(crate) fn is_at_declaration(p: &mut CssParser) -> bool { - is_at_any_property(p) -} -#[inline] -pub(crate) fn parse_declaration(p: &mut CssParser) -> ParsedSyntax { - if !is_at_declaration(p) { - return Absent; - } - - let m = p.start(); - - parse_any_property(p).ok(); - parse_declaration_important(p).ok(); - - Present(m.complete(p, CSS_DECLARATION)) -} - -#[inline] -pub(crate) fn is_at_any_declaration_with_semicolon(p: &mut CssParser) -> bool { - is_at_declaration(p) || is_at_empty_declaration(p) -} - -#[inline] -pub(crate) fn parse_any_declaration_with_semicolon(p: &mut CssParser) -> ParsedSyntax { - if is_at_empty_declaration(p) { - parse_empty_declaration(p) - } else if is_at_any_declaration_with_semicolon(p) { - parse_declaration_with_semicolon(p) - } else { - Absent - } -} - -/// Parses a CSS declaration that may optionally end with a semicolon. -/// -/// This function attempts to parse a single CSS declaration from the current position -/// of the parser. It handles the optional semicolon (';') at the end of the declaration, -/// adhering to CSS syntax rules where the semicolon is mandatory for all declarations -/// except the last one in a block. In the case of the last declaration before a closing -/// brace ('}'), the semicolon is optional. If the semicolon is omitted for declarations -/// that are not at the end, the parser will raise an error. -#[inline] -pub(crate) fn parse_declaration_with_semicolon(p: &mut CssParser) -> ParsedSyntax { - if !is_at_declaration(p) { - return Absent; - } - - let m = p.start(); - - parse_declaration(p).ok(); - - // If the next token is a closing brace ('}') or an EOF, the semicolon is optional. - // Otherwise, a semicolon is expected and the parser will enforce its presence. - // div { color: red; } - // div { color: red } - if !p.at(T!['}']) || p.at(EOF) { - if p.nth_at(1, T!['}']) || p.nth_at(1, EOF) { - p.eat(T![;]); - } else { - p.expect(T![;]); - } - } - - Present(m.complete(p, CSS_DECLARATION_WITH_SEMICOLON)) -} - -#[inline] -pub(crate) fn is_at_empty_declaration(p: &mut CssParser) -> bool { - p.at(T![;]) -} - -#[inline] -pub(crate) fn parse_empty_declaration(p: &mut CssParser) -> ParsedSyntax { - if !is_at_empty_declaration(p) { - return Absent; - } - let m = p.start(); - p.bump(T![;]); - Present(m.complete(p, CSS_EMPTY_DECLARATION)) -} - -#[inline] -fn is_at_declaration_important(p: &mut CssParser) -> bool { - p.at(T![!]) && p.nth_at(1, T![important]) -} - -#[inline] -fn parse_declaration_important(p: &mut CssParser) -> ParsedSyntax { - if !is_at_declaration_important(p) { - return Absent; - } - let m = p.start(); - p.bump(T![!]); - p.bump(T![important]); - Present(m.complete(p, CSS_DECLARATION_IMPORTANT)) -} - #[inline] fn is_at_metavariable(p: &mut CssParser) -> bool { p.at(GRIT_METAVARIABLE) @@ -339,6 +280,7 @@ fn parse_metavariable(p: &mut CssParser) -> ParsedSyntax { #[inline] pub(crate) fn is_at_any_value(p: &mut CssParser) -> bool { is_at_any_function(p) + || is_at_scss_identifier(p) || is_at_identifier(p) || p.at(CSS_STRING_LITERAL) || is_at_any_dimension(p) @@ -352,7 +294,11 @@ pub(crate) fn is_at_any_value(p: &mut CssParser) -> bool { #[inline] pub(crate) fn parse_any_value(p: &mut CssParser) -> ParsedSyntax { - if is_at_any_function(p) { + if is_at_scss_identifier(p) { + CssSyntaxFeatures::Scss.parse_exclusive_syntax(p, parse_scss_identifier, |p, m| { + scss_only_syntax_error(p, "SCSS variables", m.range(p)) + }) + } else if is_at_any_function(p) { parse_any_function(p) } else if is_at_dashed_identifier(p) { if p.nth_at(1, T![-]) && p.nth_at(2, T![*]) { diff --git a/crates/biome_css_parser/src/syntax/parse_error.rs b/crates/biome_css_parser/src/syntax/parse_error.rs index 440a0a981759..4893542fa550 100644 --- a/crates/biome_css_parser/src/syntax/parse_error.rs +++ b/crates/biome_css_parser/src/syntax/parse_error.rs @@ -243,3 +243,17 @@ pub(crate) fn tailwind_disabled(p: &CssParser, range: TextRange) -> ParseDiagnos pub(crate) fn expected_tw_source(p: &CssParser, range: TextRange) -> ParseDiagnostic { expected_any(&["string literal", "inline(\"...\")"], range, p) } + +pub(crate) fn scss_only_syntax_error( + p: &CssParser, + syntax: &str, + range: TextRange, +) -> ParseDiagnostic { + p.err_builder( + format!( + "{syntax} are an SCSS only feature. Convert your file to an SCSS file or remove the syntax." + ), + range, + ) + .with_hint(markup! { "SCSS only syntax" }) +} diff --git a/crates/biome_css_parser/src/syntax/scss/declaration.rs b/crates/biome_css_parser/src/syntax/scss/declaration.rs new file mode 100644 index 000000000000..2288681ae9a4 --- /dev/null +++ b/crates/biome_css_parser/src/syntax/scss/declaration.rs @@ -0,0 +1,137 @@ +use super::is_at_scss_identifier; +use super::parse_scss_identifier; +use crate::parser::CssParser; +use crate::syntax::property::GenericComponentValueList; +use crate::syntax::{is_at_identifier, is_nth_at_identifier, parse_regular_identifier}; +use biome_css_syntax::CssSyntaxKind::{ + EOF, SCSS_DECLARATION, SCSS_NAMESPACED_IDENTIFIER, SCSS_VARIABLE_MODIFIER, + SCSS_VARIABLE_MODIFIER_LIST, +}; +use biome_css_syntax::{CssSyntaxKind, T}; +use biome_parser::diagnostic::expected_token_any; +use biome_parser::parse_lists::ParseNodeList; +use biome_parser::parse_recovery::{RecoveryError, RecoveryResult}; +use biome_parser::prelude::ParsedSyntax; +use biome_parser::prelude::ParsedSyntax::{Absent, Present}; +use biome_parser::{Parser, TokenSet, token_set}; + +#[inline] +pub(crate) fn is_at_scss_declaration(p: &mut CssParser) -> bool { + if is_at_scss_identifier(p) { + p.nth_at(2, T![:]) + } else if is_at_scss_namespaced_identifier(p) { + p.nth_at(4, T![:]) + } else { + false + } +} + +#[inline] +pub(crate) fn parse_scss_declaration(p: &mut CssParser) -> ParsedSyntax { + if !is_at_scss_declaration(p) { + return Absent; + } + + let m = p.start(); + + parse_scss_declaration_name(p).ok(); + p.expect(T![:]); + + GenericComponentValueList.parse_list(p); + ScssVariableModifierList.parse_list(p); + + if !p.at(T!['}']) && !p.at(EOF) { + if p.nth_at(1, T!['}']) { + p.eat(T![;]); + } else { + p.expect(T![;]); + } + } + + Present(m.complete(p, SCSS_DECLARATION)) +} + +#[inline] +fn is_at_scss_namespaced_identifier(p: &mut CssParser) -> bool { + is_nth_at_identifier(p, 0) + && p.nth_at(1, T![.]) + && p.nth_at(2, T![$]) + && is_nth_at_identifier(p, 3) +} + +#[inline] +fn parse_scss_namespaced_identifier(p: &mut CssParser) -> ParsedSyntax { + if !is_at_scss_namespaced_identifier(p) { + return Absent; + } + + let m = p.start(); + parse_regular_identifier(p).ok(); + p.expect(T![.]); + parse_scss_identifier(p).ok(); + Present(m.complete(p, SCSS_NAMESPACED_IDENTIFIER)) +} + +#[inline] +fn parse_scss_declaration_name(p: &mut CssParser) -> ParsedSyntax { + if is_at_scss_namespaced_identifier(p) { + parse_scss_namespaced_identifier(p) + } else { + parse_scss_identifier(p) + } +} + +#[inline] +fn is_at_scss_variable_modifier(p: &mut CssParser) -> bool { + p.at(T![!]) +} + +const SCSS_VARIABLE_MODIFIER_SET: TokenSet = token_set!(T![default], T![global]); + +#[inline] +fn parse_scss_variable_modifier(p: &mut CssParser) -> ParsedSyntax { + if !is_at_scss_variable_modifier(p) { + return Absent; + } + + let m = p.start(); + p.bump(T![!]); + + if p.at_ts(SCSS_VARIABLE_MODIFIER_SET) { + p.bump_ts(SCSS_VARIABLE_MODIFIER_SET); + } else { + p.error(expected_token_any(&[T![default], T![global]])); + if is_at_identifier(p) { + p.bump_any(); + } + } + + Present(m.complete(p, SCSS_VARIABLE_MODIFIER)) +} + +struct ScssVariableModifierList; + +impl ParseNodeList for ScssVariableModifierList { + type Kind = CssSyntaxKind; + type Parser<'source> = CssParser<'source>; + const LIST_KIND: Self::Kind = SCSS_VARIABLE_MODIFIER_LIST; + + fn parse_element(&mut self, p: &mut Self::Parser<'_>) -> ParsedSyntax { + parse_scss_variable_modifier(p) + } + + fn is_at_list_end(&self, p: &mut Self::Parser<'_>) -> bool { + !is_at_scss_variable_modifier(p) + } + + fn recover( + &mut self, + _p: &mut Self::Parser<'_>, + parsed_element: ParsedSyntax, + ) -> RecoveryResult { + match parsed_element { + Absent => Err(RecoveryError::AlreadyRecovered), + Present(m) => Ok(m), + } + } +} diff --git a/crates/biome_css_parser/src/syntax/scss/mod.rs b/crates/biome_css_parser/src/syntax/scss/mod.rs new file mode 100644 index 000000000000..693435b7efd0 --- /dev/null +++ b/crates/biome_css_parser/src/syntax/scss/mod.rs @@ -0,0 +1,28 @@ +mod declaration; + +use crate::parser::CssParser; +use crate::syntax::{is_nth_at_identifier, parse_regular_identifier}; +use biome_css_syntax::CssSyntaxKind::SCSS_IDENTIFIER; +use biome_css_syntax::T; +use biome_parser::Parser; +use biome_parser::prelude::ParsedSyntax; +use biome_parser::prelude::ParsedSyntax::{Absent, Present}; + +pub(crate) use declaration::{is_at_scss_declaration, parse_scss_declaration}; + +#[inline] +pub(crate) fn is_at_scss_identifier(p: &mut CssParser) -> bool { + p.at(T![$]) && is_nth_at_identifier(p, 1) +} + +#[inline] +pub(crate) fn parse_scss_identifier(p: &mut CssParser) -> ParsedSyntax { + if !is_at_scss_identifier(p) { + return Absent; + } + + let m = p.start(); + p.bump(T![$]); + parse_regular_identifier(p).ok(); + Present(m.complete(p, SCSS_IDENTIFIER)) +} diff --git a/crates/biome_css_parser/src/token_source.rs b/crates/biome_css_parser/src/token_source.rs index e1497f2eee78..a1913d62f691 100644 --- a/crates/biome_css_parser/src/token_source.rs +++ b/crates/biome_css_parser/src/token_source.rs @@ -1,7 +1,7 @@ use crate::CssParserOptions; use crate::lexer::{CssLexContext, CssLexer, CssReLexContext}; use biome_css_syntax::CssSyntaxKind::EOF; -use biome_css_syntax::{CssSyntaxKind, TextRange}; +use biome_css_syntax::{CssFileSource, CssSyntaxKind, TextRange}; use biome_parser::diagnostic::ParseDiagnostic; use biome_parser::lexer::BufferedLexer; use biome_parser::prelude::{BumpWithContext, TokenSource}; @@ -27,8 +27,14 @@ impl<'src> CssTokenSource<'src> { } /// Creates a new token source for the given string - pub fn from_str(source: &'src str, options: CssParserOptions) -> Self { - let lexer = CssLexer::from_str(source).with_options(options); + pub fn from_str( + source: &'src str, + options: CssParserOptions, + source_type: CssFileSource, + ) -> Self { + let lexer = CssLexer::from_str(source) + .with_options(options) + .with_source_type(source_type); let buffered = BufferedLexer::new(lexer); let mut source = CssTokenSource::new(buffered); diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_charset_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_charset_error.css.snap index 469912cee4ab..94cb37fbcb16 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_charset_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_charset_error.css.snap @@ -2,7 +2,6 @@ source: crates/biome_css_parser/tests/spec_test.rs expression: snapshot --- - ## Input ```css @@ -22,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -108,7 +107,7 @@ CssRoot { ``` 0: CSS_ROOT@0..114 0: (empty) - 1: CSS_RULE_LIST@0..112 + 1: CSS_ROOT_ITEM_LIST@0..112 0: CSS_AT_RULE@0..16 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..16 @@ -271,5 +270,3 @@ at_rule_charset_error.css:8:1 parse ━━━━━━━━━━━━━━ │ ``` - - diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_color_profile_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_color_profile_error.css.snap index 36da616580ad..cab4930da706 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_color_profile_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_color_profile_error.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -120,7 +120,7 @@ CssRoot { ``` 0: CSS_ROOT@0..119 0: (empty) - 1: CSS_RULE_LIST@0..118 + 1: CSS_ROOT_ITEM_LIST@0..118 0: CSS_AT_RULE@0..26 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..26 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_and_query_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_and_query_error.css.snap index c4ff7b17ded2..183d4c7c727a 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_and_query_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_and_query_error.css.snap @@ -41,7 +41,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..44 "@" [Comments("/* No valid container ..."), Newline("\n")] [], rule: CssContainerAtRule { @@ -411,7 +411,7 @@ CssRoot { ``` 0: CSS_ROOT@0..681 0: (empty) - 1: CSS_RULE_LIST@0..680 + 1: CSS_ROOT_ITEM_LIST@0..680 0: CSS_AT_RULE@0..77 0: AT@0..44 "@" [Comments("/* No valid container ..."), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@44..77 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_error.css.snap index a4907731fc9c..cc87135ce95f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_error.css.snap @@ -35,7 +35,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -507,7 +507,7 @@ CssRoot { ``` 0: CSS_ROOT@0..530 0: (empty) - 1: CSS_RULE_LIST@0..529 + 1: CSS_ROOT_ITEM_LIST@0..529 0: CSS_AT_RULE@0..39 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..39 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_or_query_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_or_query_error.css.snap index 6bbb609d9b5e..c0d07e67fca0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_or_query_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_or_query_error.css.snap @@ -49,7 +49,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..53 "@" [Comments("/* or */"), Newline("\n"), Comments("/* No valid container ..."), Newline("\n")] [], rule: CssContainerAtRule { @@ -480,7 +480,7 @@ CssRoot { ``` 0: CSS_ROOT@0..751 0: (empty) - 1: CSS_RULE_LIST@0..750 + 1: CSS_ROOT_ITEM_LIST@0..750 0: CSS_AT_RULE@0..85 0: AT@0..53 "@" [Comments("/* or */"), Newline("\n"), Comments("/* No valid container ..."), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@53..85 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_not_query.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_not_query.css.snap index 154ceac3a6db..8d53f6f8da97 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_not_query.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_not_query.css.snap @@ -55,7 +55,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..101 "@" [Comments("/*\n ERROR CASE 1: Mi ..."), Newline("\n")] [], rule: CssContainerAtRule { @@ -359,7 +359,7 @@ CssRoot { ``` 0: CSS_ROOT@0..871 0: (empty) - 1: CSS_RULE_LIST@0..870 + 1: CSS_ROOT_ITEM_LIST@0..870 0: CSS_AT_RULE@0..130 0: AT@0..101 "@" [Comments("/*\n ERROR CASE 1: Mi ..."), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@101..130 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_query_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_query_error.css.snap index 01417265d0e9..76e93651fa70 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_query_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_query_error.css.snap @@ -83,7 +83,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..85 "@" [Comments("/*\n ERROR CASE 1: Mi ..."), Newline("\n")] [], rule: CssContainerAtRule { @@ -667,7 +667,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1437 0: (empty) - 1: CSS_RULE_LIST@0..1436 + 1: CSS_ROOT_ITEM_LIST@0..1436 0: CSS_AT_RULE@0..134 0: AT@0..85 "@" [Comments("/*\n ERROR CASE 1: Mi ..."), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@85..134 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_counter_style_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_counter_style_error.css.snap index f76388c9f952..869162ccbe6e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_counter_style_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_counter_style_error.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -219,7 +219,7 @@ CssRoot { ``` 0: CSS_ROOT@0..233 0: (empty) - 1: CSS_RULE_LIST@0..233 + 1: CSS_ROOT_ITEM_LIST@0..233 0: CSS_AT_RULE@0..20 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_document_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_document_error.css.snap index 7de0af7b2530..1724ebb2f843 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_document_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_document_error.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..2 "@" [Whitespace(" ")] [], rule: CssDocumentAtRule { @@ -100,7 +100,7 @@ CssRoot { ``` 0: CSS_ROOT@0..204 0: (empty) - 1: CSS_RULE_LIST@0..203 + 1: CSS_ROOT_ITEM_LIST@0..203 0: CSS_AT_RULE@0..114 0: AT@0..2 "@" [Whitespace(" ")] [] 1: CSS_DOCUMENT_AT_RULE@2..114 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_face_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_face_error.css.snap index 092ac232646e..c93917fe2e0e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_face_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_face_error.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontFaceAtRule { @@ -105,7 +105,7 @@ CssRoot { ``` 0: CSS_ROOT@0..46 0: (empty) - 1: CSS_RULE_LIST@0..46 + 1: CSS_ROOT_ITEM_LIST@0..46 0: CSS_AT_RULE@0..11 0: AT@0..1 "@" [] [] 1: CSS_FONT_FACE_AT_RULE@1..11 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_feature_values_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_feature_values_error.css.snap index c7cd0edeea40..1ab3b86ed73e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_feature_values_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_feature_values_error.css.snap @@ -37,7 +37,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontFeatureValuesAtRule { @@ -240,7 +240,7 @@ CssRoot { ``` 0: CSS_ROOT@0..304 0: (empty) - 1: CSS_RULE_LIST@0..303 + 1: CSS_ROOT_ITEM_LIST@0..303 0: CSS_AT_RULE@0..26 0: AT@0..1 "@" [] [] 1: CSS_FONT_FEATURE_VALUES_AT_RULE@1..26 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css.snap index 27441ee13ddf..8a0da8041156 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css.snap @@ -25,7 +25,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -269,7 +269,7 @@ CssRoot { ``` 0: CSS_ROOT@0..350 0: (empty) - 1: CSS_RULE_LIST@0..349 + 1: CSS_ROOT_ITEM_LIST@0..349 0: CSS_AT_RULE@0..26 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..26 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_function_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_function_error.css.snap index aae9a7cda45d..5faa8d0ca4a7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_function_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_function_error.css.snap @@ -76,7 +76,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -1145,7 +1145,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1738 0: (empty) - 1: CSS_RULE_LIST@0..1737 + 1: CSS_ROOT_ITEM_LIST@0..1737 0: CSS_AT_RULE@0..27 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..27 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_import/at_rule_import_support_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_import/at_rule_import_support_error.css.snap index 495409449c71..3373f36347e6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_import/at_rule_import_support_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_import/at_rule_import_support_error.css.snap @@ -22,7 +22,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..51 "@" [Comments("/*invalid query insid ..."), Newline("\n")] [], rule: CssBogusAtRule { @@ -138,7 +138,7 @@ CssRoot { ``` 0: CSS_ROOT@0..343 0: (empty) - 1: CSS_RULE_LIST@0..342 + 1: CSS_ROOT_ITEM_LIST@0..342 0: CSS_AT_RULE@0..100 0: AT@0..51 "@" [Comments("/*invalid query insid ..."), Newline("\n")] [] 1: CSS_BOGUS_AT_RULE@51..100 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes.css.snap index f00fbda62b42..ae21cedf6ff2 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes.css.snap @@ -89,7 +89,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { @@ -888,7 +888,7 @@ CssRoot { ``` 0: CSS_ROOT@0..840 0: (empty) - 1: CSS_RULE_LIST@0..839 + 1: CSS_ROOT_ITEM_LIST@0..839 0: CSS_AT_RULE@0..95 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..95 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes_1.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes_1.css.snap index 0868f0d50b91..0748beec6de3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes_1.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/at_rule_keyframes_1.css.snap @@ -51,7 +51,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { @@ -391,7 +391,7 @@ CssRoot { ``` 0: CSS_ROOT@0..335 0: (empty) - 1: CSS_RULE_LIST@0..334 + 1: CSS_ROOT_ITEM_LIST@0..334 0: CSS_AT_RULE@0..67 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..67 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/disabled_css_module/at_rule_keyframe_disabled_css_modules.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/disabled_css_module/at_rule_keyframe_disabled_css_modules.css.snap index de2be35de19e..0cbf0aae12d6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/disabled_css_module/at_rule_keyframe_disabled_css_modules.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/disabled_css_module/at_rule_keyframe_disabled_css_modules.css.snap @@ -1,6 +1,5 @@ --- source: crates/biome_css_parser/tests/spec_test.rs -assertion_line: 169 expression: snapshot --- ## Input @@ -25,7 +24,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { @@ -216,7 +215,7 @@ CssRoot { ``` 0: CSS_ROOT@0..264 0: (empty) - 1: CSS_RULE_LIST@0..263 + 1: CSS_ROOT_ITEM_LIST@0..263 0: CSS_AT_RULE@0..18 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..18 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/enabled_css_module/at_rule_keyframe_enabled_css_modules.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/enabled_css_module/at_rule_keyframe_enabled_css_modules.css.snap index 893c0c82b7a2..7fbdcb072f3a 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/enabled_css_module/at_rule_keyframe_enabled_css_modules.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes/enabled_css_module/at_rule_keyframe_enabled_css_modules.css.snap @@ -18,7 +18,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { @@ -123,7 +123,7 @@ CssRoot { ``` 0: CSS_ROOT@0..107 0: (empty) - 1: CSS_RULE_LIST@0..106 + 1: CSS_ROOT_ITEM_LIST@0..106 0: CSS_AT_RULE@0..28 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..28 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_layer_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_layer_error.css.snap index d9e3d04c22b7..797c8a3ab947 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_layer_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_layer_error.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssLayerAtRule { @@ -111,7 +111,7 @@ CssRoot { ``` 0: CSS_ROOT@0..120 0: (empty) - 1: CSS_RULE_LIST@0..119 + 1: CSS_ROOT_ITEM_LIST@0..119 0: CSS_AT_RULE@0..119 0: AT@0..1 "@" [] [] 1: CSS_LAYER_AT_RULE@1..119 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snap index 26b9f50c861a..596d8050c46b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snap @@ -33,7 +33,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssMediaAtRule { @@ -54,7 +54,7 @@ CssRoot { missing separator, CssBogusMediaQuery { items: [ - ERROR_TOKEN@27..28 "$" [] [], + DOLLAR@27..28 "$" [] [], IDENT@28..39 "-breakpoint" [] [], R_PAREN@39..41 ")" [] [Whitespace(" ")], ], @@ -336,7 +336,7 @@ CssRoot { ``` 0: CSS_ROOT@0..267 0: (empty) - 1: CSS_RULE_LIST@0..266 + 1: CSS_ROOT_ITEM_LIST@0..266 0: CSS_AT_RULE@0..43 0: AT@0..1 "@" [] [] 1: CSS_MEDIA_AT_RULE@1..43 @@ -352,7 +352,7 @@ CssRoot { 2: (empty) 1: (empty) 2: CSS_BOGUS_MEDIA_QUERY@27..41 - 0: ERROR_TOKEN@27..28 "$" [] [] + 0: DOLLAR@27..28 "$" [] [] 1: IDENT@28..39 "-breakpoint" [] [] 2: R_PAREN@39..41 ")" [] [Whitespace(" ")] 1: CSS_RULE_BLOCK@41..43 @@ -535,13 +535,15 @@ CssRoot { ``` at_rule_media_error.css:1:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × unexpected character `$` + × expected `)` but instead found `$` > 1 │ @media (--umrel-breakpoints$-breakpoint) {} │ ^ 2 │ 3 │ @media only screen and width <= 500px { + i Remove $ + at_rule_media_error.css:3:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `,` but instead found `width` diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_namespace_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_namespace_error.css.snap index 9dd6517ad01e..95173ee610f9 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_namespace_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_namespace_error.css.snap @@ -2,7 +2,6 @@ source: crates/biome_css_parser/tests/spec_test.rs expression: snapshot --- - ## Input ```css @@ -20,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -71,7 +70,7 @@ CssRoot { ``` 0: CSS_ROOT@0..78 0: (empty) - 1: CSS_RULE_LIST@0..75 + 1: CSS_ROOT_ITEM_LIST@0..75 0: CSS_AT_RULE@0..12 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..12 @@ -146,5 +145,3 @@ at_rule_namespace_error.css:6:1 parse ━━━━━━━━━━━━━━ │ ``` - - diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_page_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_page_error.css.snap index 779656c25516..cc2ddda4507c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_page_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_page_error.css.snap @@ -75,7 +75,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssPageAtRule { @@ -689,7 +689,7 @@ CssRoot { ``` 0: CSS_ROOT@0..625 0: (empty) - 1: CSS_RULE_LIST@0..622 + 1: CSS_ROOT_ITEM_LIST@0..622 0: CSS_AT_RULE@0..118 0: AT@0..1 "@" [] [] 1: CSS_PAGE_AT_RULE@1..118 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_property_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_property_error.css.snap index 39370f33710b..81a53516ab9c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_property_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_property_error.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -138,7 +138,7 @@ CssRoot { ``` 0: CSS_ROOT@0..96 0: (empty) - 1: CSS_RULE_LIST@0..95 + 1: CSS_ROOT_ITEM_LIST@0..95 0: CSS_AT_RULE@0..13 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_scope_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_scope_error.css.snap index c5f4bfcce190..71a799a6dbe9 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_scope_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_scope_error.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssScopeAtRule { @@ -204,7 +204,7 @@ CssRoot { ``` 0: CSS_ROOT@0..111 0: (empty) - 1: CSS_RULE_LIST@0..110 + 1: CSS_ROOT_ITEM_LIST@0..110 0: CSS_AT_RULE@0..42 0: AT@0..1 "@" [] [] 1: CSS_SCOPE_AT_RULE@1..42 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_and_condition_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_and_condition_error.css.snap index 5d286a8419c7..b74339d221f4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_and_condition_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_and_condition_error.css.snap @@ -42,7 +42,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..38 "@" [Comments("/* No valid condition ..."), Newline("\n")] [], rule: CssSupportsAtRule { @@ -413,7 +413,7 @@ CssRoot { ``` 0: CSS_ROOT@0..629 0: (empty) - 1: CSS_RULE_LIST@0..628 + 1: CSS_ROOT_ITEM_LIST@0..628 0: CSS_AT_RULE@0..69 0: AT@0..38 "@" [Comments("/* No valid condition ..."), Newline("\n")] [] 1: CSS_SUPPORTS_AT_RULE@38..69 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_invalid_after_support_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_invalid_after_support_error.css.snap index 41e484267e2a..b440da12010f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_invalid_after_support_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_invalid_after_support_error.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssSupportsAtRule { @@ -71,7 +71,7 @@ CssRoot { ``` 0: CSS_ROOT@0..41 0: (empty) - 1: CSS_RULE_LIST@0..40 + 1: CSS_ROOT_ITEM_LIST@0..40 0: CSS_AT_RULE@0..20 0: AT@0..1 "@" [] [] 1: CSS_SUPPORTS_AT_RULE@1..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_not_condition_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_not_condition_error.css.snap index 62b8571cc1f2..48b1fd19744f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_not_condition_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_not_condition_error.css.snap @@ -69,7 +69,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..39 "@" [Comments("/* missing parenthesi ..."), Newline("\n")] [], rule: CssSupportsAtRule { @@ -1083,7 +1083,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1519 0: (empty) - 1: CSS_RULE_LIST@0..1518 + 1: CSS_ROOT_ITEM_LIST@0..1518 0: CSS_AT_RULE@0..54 0: AT@0..39 "@" [Comments("/* missing parenthesi ..."), Newline("\n")] [] 1: CSS_SUPPORTS_AT_RULE@39..54 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_or_condition_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_or_condition_error.css.snap index 46b4da7ae027..dcbb3a595550 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_or_condition_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_or_condition_error.css.snap @@ -41,7 +41,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..37 "@" [Comments("/* No valid condition ..."), Newline("\n")] [], rule: CssSupportsAtRule { @@ -412,7 +412,7 @@ CssRoot { ``` 0: CSS_ROOT@0..614 0: (empty) - 1: CSS_RULE_LIST@0..613 + 1: CSS_ROOT_ITEM_LIST@0..613 0: CSS_AT_RULE@0..67 0: AT@0..37 "@" [Comments("/* No valid condition ..."), Newline("\n")] [] 1: CSS_SUPPORTS_AT_RULE@37..67 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/conditional_at_rule_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/conditional_at_rule_error.css.snap index de541af27103..7c569221e46e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/conditional_at_rule_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/conditional_at_rule_error.css.snap @@ -183,7 +183,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..3 "@" [Newline("\n"), Newline("\n")] [], rule: CssMediaAtRule { @@ -2195,7 +2195,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1596 0: (empty) - 1: CSS_RULE_LIST@0..1594 + 1: CSS_ROOT_ITEM_LIST@0..1594 0: CSS_AT_RULE@0..1594 0: AT@0..3 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_MEDIA_AT_RULE@3..1594 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/at_rule_value_disabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/at_rule_value_disabled.css.snap index 0e0c70b1142f..9ed8243dbcea 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/at_rule_value_disabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/at_rule_value_disabled.css.snap @@ -1,6 +1,5 @@ --- source: crates/biome_css_parser/tests/spec_test.rs -assertion_line: 169 expression: snapshot --- ## Input @@ -17,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssBogusRule { items: [ AT@0..1 "@" [] [], @@ -61,7 +60,7 @@ CssRoot { ``` 0: CSS_ROOT@0..118 0: (empty) - 1: CSS_RULE_LIST@0..117 + 1: CSS_ROOT_ITEM_LIST@0..117 0: CSS_BOGUS_RULE@0..30 0: AT@0..1 "@" [] [] 1: VALUE_KW@1..7 "value" [] [Whitespace(" ")] diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/enabled/at_rule_value_error_enabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/enabled/at_rule_value_error_enabled.css.snap index d943033c0d51..8b746dbaca0d 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/enabled/at_rule_value_error_enabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/value/enabled/at_rule_value_error_enabled.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssValueAtRule { @@ -53,7 +53,7 @@ CssRoot { ``` 0: CSS_ROOT@0..25 0: (empty) - 1: CSS_RULE_LIST@0..24 + 1: CSS_ROOT_ITEM_LIST@0..24 0: CSS_AT_RULE@0..8 0: AT@0..1 "@" [] [] 1: CSS_VALUE_AT_RULE@1..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/block/css_unfinished_block.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/block/css_unfinished_block.css.snap index eba90be0d6e8..ea1a45310b1e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/block/css_unfinished_block.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/block/css_unfinished_block.css.snap @@ -16,7 +16,7 @@ div } ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -73,7 +73,7 @@ CssRoot { ``` 0: CSS_ROOT@0..16 0: (empty) - 1: CSS_RULE_LIST@0..15 + 1: CSS_ROOT_ITEM_LIST@0..15 0: CSS_QUALIFIED_RULE@0..5 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPLEX_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/function/attr.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/function/attr.css.snap index 2bf67a187444..90239935bb78 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/function/attr.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/function/attr.css.snap @@ -44,7 +44,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -819,7 +819,7 @@ CssRoot { ``` 0: CSS_ROOT@0..928 0: (empty) - 1: CSS_RULE_LIST@0..927 + 1: CSS_ROOT_ITEM_LIST@0..927 0: CSS_QUALIFIED_RULE@0..927 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/function/if.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/function/if.css.snap index 6c6f71f9d42b..0ba2929acdb5 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/function/if.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/function/if.css.snap @@ -151,7 +151,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -3085,7 +3085,7 @@ CssRoot { ``` 0: CSS_ROOT@0..2567 0: (empty) - 1: CSS_RULE_LIST@0..2566 + 1: CSS_ROOT_ITEM_LIST@0..2566 0: CSS_QUALIFIED_RULE@0..55 0: CSS_SELECTOR_LIST@0..15 0: CSS_COMPOUND_SELECTOR@0..15 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/function/v_bind_disabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/function/v_bind_disabled.css.snap index 84916ccb2d33..0b5a4ff4a4d6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/function/v_bind_disabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/function/v_bind_disabled.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -88,7 +88,7 @@ CssRoot { ``` 0: CSS_ROOT@0..33 0: (empty) - 1: CSS_RULE_LIST@0..32 + 1: CSS_ROOT_ITEM_LIST@0..32 0: CSS_QUALIFIED_RULE@0..32 0: CSS_SELECTOR_LIST@0..5 0: CSS_COMPOUND_SELECTOR@0..5 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/property/color_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/property/color_error.css.snap index 0f3e56202ee5..5add87e2ed4d 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/property/color_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/property/color_error.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -101,7 +101,7 @@ CssRoot { ``` 0: CSS_ROOT@0..51 0: (empty) - 1: CSS_RULE_LIST@0..50 + 1: CSS_ROOT_ITEM_LIST@0..50 0: CSS_QUALIFIED_RULE@0..50 0: CSS_SELECTOR_LIST@0..20 0: CSS_COMPLEX_SELECTOR@0..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/property/composes.enabled/composes_error_enabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/property/composes.enabled/composes_error_enabled.css.snap index b540445b16ff..196b6dae20e1 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/property/composes.enabled/composes_error_enabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/property/composes.enabled/composes_error_enabled.css.snap @@ -33,7 +33,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -256,7 +256,7 @@ CssRoot { ``` 0: CSS_ROOT@0..210 0: (empty) - 1: CSS_RULE_LIST@0..209 + 1: CSS_ROOT_ITEM_LIST@0..209 0: CSS_QUALIFIED_RULE@0..19 0: CSS_SELECTOR_LIST@0..3 0: CSS_COMPOUND_SELECTOR@0..3 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/property/composes/disabled/composes_error_disabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/property/composes/disabled/composes_error_disabled.css.snap index 9332ca857cff..3819df49de7f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/property/composes/disabled/composes_error_disabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/property/composes/disabled/composes_error_disabled.css.snap @@ -1,6 +1,5 @@ --- source: crates/biome_css_parser/tests/spec_test.rs -assertion_line: 169 expression: snapshot --- ## Input @@ -26,7 +25,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -166,7 +165,7 @@ CssRoot { ``` 0: CSS_ROOT@0..150 0: (empty) - 1: CSS_RULE_LIST@0..149 + 1: CSS_ROOT_ITEM_LIST@0..149 0: CSS_QUALIFIED_RULE@0..26 0: CSS_SELECTOR_LIST@0..3 0: CSS_COMPOUND_SELECTOR@0..3 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/property/grid/grid_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/property/grid/grid_error.css.snap index 88bf7af2c849..7fef449a2128 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/property/grid/grid_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/property/grid/grid_error.css.snap @@ -18,7 +18,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -128,7 +128,7 @@ CssRoot { ``` 0: CSS_ROOT@0..102 0: (empty) - 1: CSS_RULE_LIST@0..101 + 1: CSS_ROOT_ITEM_LIST@0..101 0: CSS_QUALIFIED_RULE@0..101 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/property/property_generic_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/property/property_generic_error.css.snap index 2245e8a3f81f..22f135bb03f4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/property/property_generic_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/property/property_generic_error.css.snap @@ -18,7 +18,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -115,7 +115,7 @@ CssRoot { ``` 0: CSS_ROOT@0..66 0: (empty) - 1: CSS_RULE_LIST@0..66 + 1: CSS_ROOT_ITEM_LIST@0..66 0: CSS_QUALIFIED_RULE@0..66 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/property/unicode_range_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/property/unicode_range_error.css.snap index d6a91d2025e3..1e7da02bfeb8 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/property/unicode_range_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/property/unicode_range_error.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontFaceAtRule { @@ -176,7 +176,7 @@ CssRoot { ``` 0: CSS_ROOT@0..144 0: (empty) - 1: CSS_RULE_LIST@0..143 + 1: CSS_ROOT_ITEM_LIST@0..143 0: CSS_AT_RULE@0..143 0: AT@0..1 "@" [] [] 1: CSS_FONT_FACE_AT_RULE@1..143 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/relative_selector/relative_selector_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/relative_selector/relative_selector_error.css.snap index 54a3f59eca00..ef7ca4b6dd02 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/relative_selector/relative_selector_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/relative_selector/relative_selector_error.css.snap @@ -31,7 +31,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -274,7 +274,7 @@ CssRoot { ``` 0: CSS_ROOT@0..156 0: (empty) - 1: CSS_RULE_LIST@0..155 + 1: CSS_ROOT_ITEM_LIST@0..155 0: CSS_QUALIFIED_RULE@0..45 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss new file mode 100644 index 000000000000..925312f8a1ca --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss @@ -0,0 +1,14 @@ +// Invalid modifier - using unknown identifier instead of !default or !global +$color: red !important; + +// Invalid modifier - just a random word +$width: 100px !random; + +// Invalid modifier - typo in default +$height: 50vh !defalt; + +// Invalid modifier - typo in global +$font-size: 16px !globl; + +// Multiple invalid modifiers +$margin: 10px !wrong !invalid; diff --git a/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss.snap b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss.snap new file mode 100644 index 000000000000..5cf1e8374b43 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss.snap @@ -0,0 +1,342 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +// Invalid modifier - using unknown identifier instead of !default or !global +$color: red !important; + +// Invalid modifier - just a random word +$width: 100px !random; + +// Invalid modifier - typo in default +$height: 50vh !defalt; + +// Invalid modifier - typo in global +$font-size: 16px !globl; + +// Multiple invalid modifiers +$margin: 10px !wrong !invalid; + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + CssBogus { + items: [ + ScssIdentifier { + dollar_token: DOLLAR@0..79 "$" [Comments("// Invalid modifier - ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@79..84 "color" [] [], + }, + }, + COLON@84..86 ":" [] [Whitespace(" ")], + CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@86..90 "red" [] [Whitespace(" ")], + }, + ], + CssBogus { + items: [ + CssBogus { + items: [ + BANG@90..91 "!" [] [], + IMPORTANT_KW@91..100 "important" [] [], + ], + }, + ], + }, + SEMICOLON@100..101 ";" [] [], + ], + }, + CssBogus { + items: [ + ScssIdentifier { + dollar_token: DOLLAR@101..145 "$" [Newline("\n"), Newline("\n"), Comments("// Invalid modifier - ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@145..150 "width" [] [], + }, + }, + COLON@150..152 ":" [] [Whitespace(" ")], + CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@152..155 "100" [] [], + unit_token: IDENT@155..158 "px" [] [Whitespace(" ")], + }, + ], + CssBogus { + items: [ + CssBogus { + items: [ + BANG@158..159 "!" [] [], + IDENT@159..165 "random" [] [], + ], + }, + ], + }, + SEMICOLON@165..166 ";" [] [], + ], + }, + CssBogus { + items: [ + ScssIdentifier { + dollar_token: DOLLAR@166..207 "$" [Newline("\n"), Newline("\n"), Comments("// Invalid modifier - ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@207..213 "height" [] [], + }, + }, + COLON@213..215 ":" [] [Whitespace(" ")], + CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@215..217 "50" [] [], + unit_token: IDENT@217..220 "vh" [] [Whitespace(" ")], + }, + ], + CssBogus { + items: [ + CssBogus { + items: [ + BANG@220..221 "!" [] [], + IDENT@221..227 "defalt" [] [], + ], + }, + ], + }, + SEMICOLON@227..228 ";" [] [], + ], + }, + CssBogus { + items: [ + ScssIdentifier { + dollar_token: DOLLAR@228..268 "$" [Newline("\n"), Newline("\n"), Comments("// Invalid modifier - ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@268..277 "font-size" [] [], + }, + }, + COLON@277..279 ":" [] [Whitespace(" ")], + CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@279..281 "16" [] [], + unit_token: IDENT@281..284 "px" [] [Whitespace(" ")], + }, + ], + CssBogus { + items: [ + CssBogus { + items: [ + BANG@284..285 "!" [] [], + IDENT@285..290 "globl" [] [], + ], + }, + ], + }, + SEMICOLON@290..291 ";" [] [], + ], + }, + CssBogus { + items: [ + ScssIdentifier { + dollar_token: DOLLAR@291..324 "$" [Newline("\n"), Newline("\n"), Comments("// Multiple invalid m ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@324..330 "margin" [] [], + }, + }, + COLON@330..332 ":" [] [Whitespace(" ")], + CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@332..334 "10" [] [], + unit_token: IDENT@334..337 "px" [] [Whitespace(" ")], + }, + ], + CssBogus { + items: [ + CssBogus { + items: [ + BANG@337..338 "!" [] [], + IDENT@338..344 "wrong" [] [Whitespace(" ")], + ], + }, + CssBogus { + items: [ + BANG@344..345 "!" [] [], + IDENT@345..352 "invalid" [] [], + ], + }, + ], + }, + SEMICOLON@352..353 ";" [] [], + ], + }, + ], + eof_token: EOF@353..354 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..354 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..353 + 0: CSS_BOGUS@0..101 + 0: SCSS_IDENTIFIER@0..84 + 0: DOLLAR@0..79 "$" [Comments("// Invalid modifier - ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@79..84 + 0: IDENT@79..84 "color" [] [] + 1: COLON@84..86 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@86..90 + 0: CSS_IDENTIFIER@86..90 + 0: IDENT@86..90 "red" [] [Whitespace(" ")] + 3: CSS_BOGUS@90..100 + 0: CSS_BOGUS@90..100 + 0: BANG@90..91 "!" [] [] + 1: IMPORTANT_KW@91..100 "important" [] [] + 4: SEMICOLON@100..101 ";" [] [] + 1: CSS_BOGUS@101..166 + 0: SCSS_IDENTIFIER@101..150 + 0: DOLLAR@101..145 "$" [Newline("\n"), Newline("\n"), Comments("// Invalid modifier - ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@145..150 + 0: IDENT@145..150 "width" [] [] + 1: COLON@150..152 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@152..158 + 0: CSS_REGULAR_DIMENSION@152..158 + 0: CSS_NUMBER_LITERAL@152..155 "100" [] [] + 1: IDENT@155..158 "px" [] [Whitespace(" ")] + 3: CSS_BOGUS@158..165 + 0: CSS_BOGUS@158..165 + 0: BANG@158..159 "!" [] [] + 1: IDENT@159..165 "random" [] [] + 4: SEMICOLON@165..166 ";" [] [] + 2: CSS_BOGUS@166..228 + 0: SCSS_IDENTIFIER@166..213 + 0: DOLLAR@166..207 "$" [Newline("\n"), Newline("\n"), Comments("// Invalid modifier - ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@207..213 + 0: IDENT@207..213 "height" [] [] + 1: COLON@213..215 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@215..220 + 0: CSS_REGULAR_DIMENSION@215..220 + 0: CSS_NUMBER_LITERAL@215..217 "50" [] [] + 1: IDENT@217..220 "vh" [] [Whitespace(" ")] + 3: CSS_BOGUS@220..227 + 0: CSS_BOGUS@220..227 + 0: BANG@220..221 "!" [] [] + 1: IDENT@221..227 "defalt" [] [] + 4: SEMICOLON@227..228 ";" [] [] + 3: CSS_BOGUS@228..291 + 0: SCSS_IDENTIFIER@228..277 + 0: DOLLAR@228..268 "$" [Newline("\n"), Newline("\n"), Comments("// Invalid modifier - ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@268..277 + 0: IDENT@268..277 "font-size" [] [] + 1: COLON@277..279 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@279..284 + 0: CSS_REGULAR_DIMENSION@279..284 + 0: CSS_NUMBER_LITERAL@279..281 "16" [] [] + 1: IDENT@281..284 "px" [] [Whitespace(" ")] + 3: CSS_BOGUS@284..290 + 0: CSS_BOGUS@284..290 + 0: BANG@284..285 "!" [] [] + 1: IDENT@285..290 "globl" [] [] + 4: SEMICOLON@290..291 ";" [] [] + 4: CSS_BOGUS@291..353 + 0: SCSS_IDENTIFIER@291..330 + 0: DOLLAR@291..324 "$" [Newline("\n"), Newline("\n"), Comments("// Multiple invalid m ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@324..330 + 0: IDENT@324..330 "margin" [] [] + 1: COLON@330..332 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@332..337 + 0: CSS_REGULAR_DIMENSION@332..337 + 0: CSS_NUMBER_LITERAL@332..334 "10" [] [] + 1: IDENT@334..337 "px" [] [Whitespace(" ")] + 3: CSS_BOGUS@337..352 + 0: CSS_BOGUS@337..344 + 0: BANG@337..338 "!" [] [] + 1: IDENT@338..344 "wrong" [] [Whitespace(" ")] + 1: CSS_BOGUS@344..352 + 0: BANG@344..345 "!" [] [] + 1: IDENT@345..352 "invalid" [] [] + 4: SEMICOLON@352..353 ";" [] [] + 2: EOF@353..354 "" [Newline("\n")] [] + +``` + +## Diagnostics + +``` +invalid-modifier.scss:2:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `important` + + 1 │ // Invalid modifier - using unknown identifier instead of !default or !global + > 2 │ $color: red !important; + │ ^^^^^^^^^ + 3 │ + 4 │ // Invalid modifier - just a random word + + i Remove important + +invalid-modifier.scss:5:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `random` + + 4 │ // Invalid modifier - just a random word + > 5 │ $width: 100px !random; + │ ^^^^^^ + 6 │ + 7 │ // Invalid modifier - typo in default + + i Remove random + +invalid-modifier.scss:8:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `defalt` + + 7 │ // Invalid modifier - typo in default + > 8 │ $height: 50vh !defalt; + │ ^^^^^^ + 9 │ + 10 │ // Invalid modifier - typo in global + + i Remove defalt + +invalid-modifier.scss:11:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `globl` + + 10 │ // Invalid modifier - typo in global + > 11 │ $font-size: 16px !globl; + │ ^^^^^ + 12 │ + 13 │ // Multiple invalid modifiers + + i Remove globl + +invalid-modifier.scss:14:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `wrong` + + 13 │ // Multiple invalid modifiers + > 14 │ $margin: 10px !wrong !invalid; + │ ^^^^^ + 15 │ + + i Remove wrong + +invalid-modifier.scss:14:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `invalid` + + 13 │ // Multiple invalid modifiers + > 14 │ $margin: 10px !wrong !invalid; + │ ^^^^^^^ + 15 │ + + i Remove invalid + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss new file mode 100644 index 000000000000..ec29f0ef66cc --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss @@ -0,0 +1,8 @@ +// Exclamation mark but no modifier +$color: red !; + +// Exclamation mark with space but no modifier +$width: 100px ! ; + +// Exclamation mark at the end +$height: 50vh ! diff --git a/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss.snap b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss.snap new file mode 100644 index 000000000000..1e29ae7ad650 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss.snap @@ -0,0 +1,193 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +// Exclamation mark but no modifier +$color: red !; + +// Exclamation mark with space but no modifier +$width: 100px ! ; + +// Exclamation mark at the end +$height: 50vh ! + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@0..37 "$" [Comments("// Exclamation mark b ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@37..42 "color" [] [], + }, + }, + colon_token: COLON@42..44 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@44..48 "red" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@48..49 "!" [] [], + value: missing (required), + }, + ], + semicolon_token: SEMICOLON@49..50 ";" [] [], + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@50..100 "$" [Newline("\n"), Newline("\n"), Comments("// Exclamation mark w ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@100..105 "width" [] [], + }, + }, + colon_token: COLON@105..107 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@107..110 "100" [] [], + unit_token: IDENT@110..113 "px" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@113..115 "!" [] [Whitespace(" ")], + value: missing (required), + }, + ], + semicolon_token: SEMICOLON@115..116 ";" [] [], + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@116..150 "$" [Newline("\n"), Newline("\n"), Comments("// Exclamation mark a ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@150..156 "height" [] [], + }, + }, + colon_token: COLON@156..158 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@158..160 "50" [] [], + unit_token: IDENT@160..163 "vh" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@163..164 "!" [] [], + value: missing (required), + }, + ], + semicolon_token: missing (optional), + }, + ], + eof_token: EOF@164..165 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..165 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..164 + 0: SCSS_DECLARATION@0..50 + 0: SCSS_IDENTIFIER@0..42 + 0: DOLLAR@0..37 "$" [Comments("// Exclamation mark b ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@37..42 + 0: IDENT@37..42 "color" [] [] + 1: COLON@42..44 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@44..48 + 0: CSS_IDENTIFIER@44..48 + 0: IDENT@44..48 "red" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@48..49 + 0: SCSS_VARIABLE_MODIFIER@48..49 + 0: BANG@48..49 "!" [] [] + 1: (empty) + 4: SEMICOLON@49..50 ";" [] [] + 1: SCSS_DECLARATION@50..116 + 0: SCSS_IDENTIFIER@50..105 + 0: DOLLAR@50..100 "$" [Newline("\n"), Newline("\n"), Comments("// Exclamation mark w ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@100..105 + 0: IDENT@100..105 "width" [] [] + 1: COLON@105..107 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@107..113 + 0: CSS_REGULAR_DIMENSION@107..113 + 0: CSS_NUMBER_LITERAL@107..110 "100" [] [] + 1: IDENT@110..113 "px" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@113..115 + 0: SCSS_VARIABLE_MODIFIER@113..115 + 0: BANG@113..115 "!" [] [Whitespace(" ")] + 1: (empty) + 4: SEMICOLON@115..116 ";" [] [] + 2: SCSS_DECLARATION@116..164 + 0: SCSS_IDENTIFIER@116..156 + 0: DOLLAR@116..150 "$" [Newline("\n"), Newline("\n"), Comments("// Exclamation mark a ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@150..156 + 0: IDENT@150..156 "height" [] [] + 1: COLON@156..158 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@158..163 + 0: CSS_REGULAR_DIMENSION@158..163 + 0: CSS_NUMBER_LITERAL@158..160 "50" [] [] + 1: IDENT@160..163 "vh" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@163..164 + 0: SCSS_VARIABLE_MODIFIER@163..164 + 0: BANG@163..164 "!" [] [] + 1: (empty) + 4: (empty) + 2: EOF@164..165 "" [Newline("\n")] [] + +``` + +## Diagnostics + +``` +missing-modifier.scss:2:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `;` + + 1 │ // Exclamation mark but no modifier + > 2 │ $color: red !; + │ ^ + 3 │ + 4 │ // Exclamation mark with space but no modifier + + i Remove ; + +missing-modifier.scss:5:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead found `;` + + 4 │ // Exclamation mark with space but no modifier + > 5 │ $width: 100px ! ; + │ ^ + 6 │ + 7 │ // Exclamation mark at the end + + i Remove ; + +missing-modifier.scss:9:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × expected 'default', or 'global' but instead the file ends + + 7 │ // Exclamation mark at the end + 8 │ $height: 50vh ! + > 9 │ + │ + + i the file ends here + + 7 │ // Exclamation mark at the end + 8 │ $height: 50vh ! + > 9 │ + │ + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/attribute_selector.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/attribute_selector.css.snap index a511efe3de35..da909833c033 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/attribute_selector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/attribute_selector.css.snap @@ -20,7 +20,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -161,7 +161,7 @@ CssRoot { ``` 0: CSS_ROOT@0..66 0: (empty) - 1: CSS_RULE_LIST@0..65 + 1: CSS_ROOT_ITEM_LIST@0..65 0: CSS_QUALIFIED_RULE@0..11 0: CSS_SELECTOR_LIST@0..9 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/class_selector_err.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/class_selector_err.css.snap index bb7fec469e55..ca9b4f1e2fe0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/class_selector_err.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/class_selector_err.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -51,7 +51,7 @@ CssRoot { ``` 0: CSS_ROOT@0..12 0: (empty) - 1: CSS_RULE_LIST@0..11 + 1: CSS_ROOT_ITEM_LIST@0..11 0: CSS_QUALIFIED_RULE@0..11 0: CSS_SELECTOR_LIST@0..9 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/id_selector_err.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/id_selector_err.css.snap index cbda3705cc8e..57527705430f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/id_selector_err.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/id_selector_err.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -51,7 +51,7 @@ CssRoot { ``` 0: CSS_ROOT@0..12 0: (empty) - 1: CSS_RULE_LIST@0..11 + 1: CSS_ROOT_ITEM_LIST@0..11 0: CSS_QUALIFIED_RULE@0..11 0: CSS_SELECTOR_LIST@0..9 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/invalid_selector.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/invalid_selector.css.snap index 6d2a78cca21f..a0ae9dceb786 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/invalid_selector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/invalid_selector.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssBogusRule { items: [ BANG@0..1 "!" [] [], @@ -54,7 +54,7 @@ CssRoot { ``` 0: CSS_ROOT@0..16 0: (empty) - 1: CSS_RULE_LIST@0..15 + 1: CSS_ROOT_ITEM_LIST@0..15 0: CSS_BOGUS_RULE@0..1 0: BANG@0..1 "!" [] [] 1: CSS_QUALIFIED_RULE@1..15 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/missing_identifier.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/missing_identifier.css.snap index d1da9a391d9a..107f941b24d7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/missing_identifier.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/missing_identifier.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -56,7 +56,7 @@ CssRoot { ``` 0: CSS_ROOT@0..9 0: (empty) - 1: CSS_RULE_LIST@0..8 + 1: CSS_ROOT_ITEM_LIST@0..8 0: CSS_QUALIFIED_RULE@0..8 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector.css.snap index 7aaf21e12734..353b24a957e3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector.css.snap @@ -22,7 +22,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -347,7 +347,7 @@ CssRoot { ``` 0: CSS_ROOT@0..134 0: (empty) - 1: CSS_RULE_LIST@0..134 + 1: CSS_ROOT_ITEM_LIST@0..134 0: CSS_QUALIFIED_RULE@0..9 0: CSS_SELECTOR_LIST@0..7 0: CSS_COMPOUND_SELECTOR@0..7 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector_list.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector_list.css.snap index e5a6e3483f66..af0657167773 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector_list.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_compound_selector_list.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -383,7 +383,7 @@ CssRoot { ``` 0: CSS_ROOT@0..149 0: (empty) - 1: CSS_RULE_LIST@0..149 + 1: CSS_ROOT_ITEM_LIST@0..149 0: CSS_QUALIFIED_RULE@0..9 0: CSS_SELECTOR_LIST@0..7 0: CSS_COMPOUND_SELECTOR@0..7 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_error.css.snap index 94b800365016..c4d667465028 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_error.css.snap @@ -23,7 +23,7 @@ custom-selector:state("string") {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -432,7 +432,7 @@ CssRoot { ``` 0: CSS_ROOT@0..302 0: (empty) - 1: CSS_RULE_LIST@0..301 + 1: CSS_ROOT_ITEM_LIST@0..301 0: CSS_QUALIFIED_RULE@0..26 0: CSS_SELECTOR_LIST@0..24 0: CSS_COMPOUND_SELECTOR@0..24 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_list_error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_list_error.css.snap index ff3723be687e..c1bbe195f5fa 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_list_error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_custom_identifier_list_error.css.snap @@ -26,7 +26,7 @@ html:active-view-transition-type(first, "string??", second) { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -203,7 +203,7 @@ CssRoot { ``` 0: CSS_ROOT@0..219 0: (empty) - 1: CSS_RULE_LIST@0..218 + 1: CSS_ROOT_ITEM_LIST@0..218 0: CSS_QUALIFIED_RULE@0..38 0: CSS_SELECTOR_LIST@0..35 0: CSS_COMPOUND_SELECTOR@0..35 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_identifier.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_identifier.css.snap index 0c7aaade77f7..8a44532b16e7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_identifier.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_identifier.css.snap @@ -25,7 +25,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -382,7 +382,7 @@ CssRoot { ``` 0: CSS_ROOT@0..182 0: (empty) - 1: CSS_RULE_LIST@0..181 + 1: CSS_ROOT_ITEM_LIST@0..181 0: CSS_QUALIFIED_RULE@0..8 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_nth.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_nth.css.snap index dcf1345e985b..6d4f14822949 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_nth.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_nth.css.snap @@ -31,7 +31,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -821,7 +821,7 @@ CssRoot { ``` 0: CSS_ROOT@0..433 0: (empty) - 1: CSS_RULE_LIST@0..433 + 1: CSS_ROOT_ITEM_LIST@0..433 0: CSS_QUALIFIED_RULE@0..22 0: CSS_SELECTOR_LIST@0..20 0: CSS_COMPOUND_SELECTOR@0..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_relative_selector_list.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_relative_selector_list.css.snap index e0315a4cb774..e587af97ec0e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_relative_selector_list.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_relative_selector_list.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -405,7 +405,7 @@ CssRoot { ``` 0: CSS_ROOT@0..152 0: (empty) - 1: CSS_RULE_LIST@0..152 + 1: CSS_ROOT_ITEM_LIST@0..152 0: CSS_QUALIFIED_RULE@0..8 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/disabled/pseudo_class_function_selector_disabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/disabled/pseudo_class_function_selector_disabled.css.snap index 52375f42a51b..ec59ea1ff699 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/disabled/pseudo_class_function_selector_disabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/disabled/pseudo_class_function_selector_disabled.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -472,7 +472,7 @@ CssRoot { ``` 0: CSS_ROOT@0..196 0: (empty) - 1: CSS_RULE_LIST@0..196 + 1: CSS_ROOT_ITEM_LIST@0..196 0: CSS_QUALIFIED_RULE@0..22 0: CSS_SELECTOR_LIST@0..20 0: CSS_COMPOUND_SELECTOR@0..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/enabled/pseudo_class_function_selector_enabled.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/enabled/pseudo_class_function_selector_enabled.css.snap index 0b6a33692e51..ca4b69abaee9 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/enabled/pseudo_class_function_selector_enabled.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/enabled/pseudo_class_function_selector_enabled.css.snap @@ -20,7 +20,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -283,7 +283,7 @@ CssRoot { ``` 0: CSS_ROOT@0..117 0: (empty) - 1: CSS_RULE_LIST@0..117 + 1: CSS_ROOT_ITEM_LIST@0..117 0: CSS_QUALIFIED_RULE@0..11 0: CSS_SELECTOR_LIST@0..9 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector_list.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector_list.css.snap index 4fb51222f4d2..2232ae92e64c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector_list.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector_list.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -393,7 +393,7 @@ CssRoot { ``` 0: CSS_ROOT@0..170 0: (empty) - 1: CSS_RULE_LIST@0..170 + 1: CSS_ROOT_ITEM_LIST@0..170 0: CSS_QUALIFIED_RULE@0..10 0: CSS_SELECTOR_LIST@0..8 0: CSS_COMPOUND_SELECTOR@0..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_value_list.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_value_list.css.snap index 2bef420619ac..699920c9d113 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_value_list.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_value_list.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -262,7 +262,7 @@ CssRoot { ``` 0: CSS_ROOT@0..110 0: (empty) - 1: CSS_RULE_LIST@0..109 + 1: CSS_ROOT_ITEM_LIST@0..109 0: CSS_QUALIFIED_RULE@0..9 0: CSS_SELECTOR_LIST@0..7 0: CSS_COMPOUND_SELECTOR@0..7 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_identifier.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_identifier.css.snap index 162e4e0eaa67..c4ced4cd75bc 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_identifier.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_identifier.css.snap @@ -18,7 +18,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -119,7 +119,7 @@ CssRoot { ``` 0: CSS_ROOT@0..29 0: (empty) - 1: CSS_RULE_LIST@0..28 + 1: CSS_ROOT_ITEM_LIST@0..28 0: CSS_QUALIFIED_RULE@0..4 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element.css.snap index 3a1a8d5cce35..6f3c28554092 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -183,7 +183,7 @@ CssRoot { ``` 0: CSS_ROOT@0..79 0: (empty) - 1: CSS_RULE_LIST@0..78 + 1: CSS_ROOT_ITEM_LIST@0..78 0: CSS_QUALIFIED_RULE@0..5 0: CSS_SELECTOR_LIST@0..3 0: CSS_COMPOUND_SELECTOR@0..3 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_identifier.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_identifier.css.snap index ab111d645ee2..dde8003a3188 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_identifier.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_identifier.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -114,7 +114,7 @@ CssRoot { ``` 0: CSS_ROOT@0..55 0: (empty) - 1: CSS_RULE_LIST@0..54 + 1: CSS_ROOT_ITEM_LIST@0..54 0: CSS_QUALIFIED_RULE@0..25 0: CSS_SELECTOR_LIST@0..23 0: CSS_COMPOUND_SELECTOR@0..23 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_selector.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_selector.css.snap index d5b9942ff1a1..99ae4bd00489 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_selector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_element_function_selector.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -227,7 +227,7 @@ CssRoot { ``` 0: CSS_ROOT@0..92 0: (empty) - 1: CSS_RULE_LIST@0..91 + 1: CSS_ROOT_ITEM_LIST@0..91 0: CSS_QUALIFIED_RULE@0..10 0: CSS_SELECTOR_LIST@0..8 0: CSS_COMPOUND_SELECTOR@0..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/selector.error.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/selector.error.css.snap index 9b50c7b7c98d..68203177c0e2 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/selector.error.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/selector.error.css.snap @@ -29,7 +29,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -460,7 +460,7 @@ CssRoot { ``` 0: CSS_ROOT@0..233 0: (empty) - 1: CSS_RULE_LIST@0..232 + 1: CSS_ROOT_ITEM_LIST@0..232 0: CSS_QUALIFIED_RULE@0..20 0: CSS_SELECTOR_LIST@0..18 0: CSS_COMPLEX_SELECTOR@0..5 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/traling_comma.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/traling_comma.css.snap index 97384eecbb68..63ac76c2b8a4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/traling_comma.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/traling_comma.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -51,7 +51,7 @@ CssRoot { ``` 0: CSS_ROOT@0..16 0: (empty) - 1: CSS_RULE_LIST@0..15 + 1: CSS_ROOT_ITEM_LIST@0..15 0: CSS_QUALIFIED_RULE@0..15 0: CSS_SELECTOR_LIST@0..11 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/apply.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/apply.css.snap index 890848267201..28146d875062 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/apply.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/apply.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -67,7 +67,7 @@ CssRoot { ``` 0: CSS_ROOT@0..36 0: (empty) - 1: CSS_RULE_LIST@0..35 + 1: CSS_ROOT_ITEM_LIST@0..35 0: CSS_QUALIFIED_RULE@0..35 0: CSS_SELECTOR_LIST@0..5 0: CSS_COMPOUND_SELECTOR@0..5 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/config.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/config.css.snap index 2a17265565a1..7da29effdb05 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/config.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/config.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -38,7 +38,7 @@ CssRoot { ``` 0: CSS_ROOT@0..32 0: (empty) - 1: CSS_RULE_LIST@0..31 + 1: CSS_ROOT_ITEM_LIST@0..31 0: CSS_AT_RULE@0..31 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..31 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/custom-theme.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/custom-theme.css.snap index 2a673fbfec8f..fb80153cb234 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/custom-theme.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/custom-theme.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -76,7 +76,7 @@ CssRoot { ``` 0: CSS_ROOT@0..131 0: (empty) - 1: CSS_RULE_LIST@0..130 + 1: CSS_ROOT_ITEM_LIST@0..130 0: CSS_QUALIFIED_RULE@0..130 0: CSS_SELECTOR_LIST@0..112 0: CSS_COMPOUND_SELECTOR@0..112 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/plugin.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/plugin.css.snap index 662d69411dab..59ae1eaa0eec 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/plugin.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/plugin.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -38,7 +38,7 @@ CssRoot { ``` 0: CSS_ROOT@0..35 0: (empty) - 1: CSS_RULE_LIST@0..34 + 1: CSS_ROOT_ITEM_LIST@0..34 0: CSS_AT_RULE@0..34 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..34 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/reference.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/reference.css.snap index ca3d2143b08a..07d583250612 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/reference.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/reference.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -38,7 +38,7 @@ CssRoot { ``` 0: CSS_ROOT@0..24 0: (empty) - 1: CSS_RULE_LIST@0..23 + 1: CSS_ROOT_ITEM_LIST@0..23 0: CSS_AT_RULE@0..23 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..23 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/slot.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/slot.css.snap index f06b42446803..a4d8ccf42ddf 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/slot.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/slot.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -35,7 +35,7 @@ CssRoot { ``` 0: CSS_ROOT@0..7 0: (empty) - 1: CSS_RULE_LIST@0..6 + 1: CSS_ROOT_ITEM_LIST@0..6 0: CSS_AT_RULE@0..6 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/source.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/source.css.snap index 8207605bfdbb..49e0f0e8530e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/source.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/source.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -38,7 +38,7 @@ CssRoot { ``` 0: CSS_ROOT@0..46 0: (empty) - 1: CSS_RULE_LIST@0..45 + 1: CSS_ROOT_ITEM_LIST@0..45 0: CSS_AT_RULE@0..45 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..45 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/theme.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/theme.css.snap index f53a08a89219..2b954399c1a4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/theme.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/theme.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -60,7 +60,7 @@ CssRoot { ``` 0: CSS_ROOT@0..38 0: (empty) - 1: CSS_RULE_LIST@0..37 + 1: CSS_ROOT_ITEM_LIST@0..37 0: CSS_AT_RULE@0..37 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..37 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/utility.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/utility.css.snap index 60b5bf91f80b..7cb5f75b9a86 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/utility.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/utility.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssBogusAtRule { @@ -42,7 +42,7 @@ CssRoot { ``` 0: CSS_ROOT@0..23 0: (empty) - 1: CSS_RULE_LIST@0..22 + 1: CSS_ROOT_ITEM_LIST@0..22 0: CSS_AT_RULE@0..22 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..22 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/variant.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/variant.css.snap index e29a5aa3fa60..853de545ffa5 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/variant.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-disabled/variant.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -105,7 +105,7 @@ CssRoot { ``` 0: CSS_ROOT@0..79 0: (empty) - 1: CSS_RULE_LIST@0..78 + 1: CSS_ROOT_ITEM_LIST@0..78 0: CSS_QUALIFIED_RULE@0..78 0: CSS_SELECTOR_LIST@0..12 0: CSS_COMPOUND_SELECTOR@0..12 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/apply-missing-semicolon.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/apply-missing-semicolon.css.snap index 8df8fa0ca58a..6dccba30aa2e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/apply-missing-semicolon.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/apply-missing-semicolon.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -73,7 +73,7 @@ CssRoot { ``` 0: CSS_ROOT@0..88 0: (empty) - 1: CSS_RULE_LIST@0..87 + 1: CSS_ROOT_ITEM_LIST@0..87 0: CSS_AT_RULE@0..87 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..87 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css.snap index f2dce1a3e413..bc9a3803ab27 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options-2.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwPluginAtRule { @@ -74,7 +74,7 @@ CssRoot { ``` 0: CSS_ROOT@0..150 0: (empty) - 1: CSS_RULE_LIST@0..95 + 1: CSS_ROOT_ITEM_LIST@0..95 0: CSS_AT_RULE@0..93 0: AT@0..1 "@" [] [] 1: TW_PLUGIN_AT_RULE@1..93 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css.snap index efe87ecfba6d..04d59f8c8f2b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/plugin-with-invalid-options.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwPluginAtRule { @@ -111,7 +111,7 @@ CssRoot { ``` 0: CSS_ROOT@0..132 0: (empty) - 1: CSS_RULE_LIST@0..69 + 1: CSS_ROOT_ITEM_LIST@0..69 0: CSS_AT_RULE@0..67 0: AT@0..1 "@" [] [] 1: TW_PLUGIN_AT_RULE@1..67 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snap index 53f4bc064712..b4585675f2aa 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwSourceAtRule { @@ -45,7 +45,7 @@ CssRoot { ``` 0: CSS_ROOT@0..24 0: (empty) - 1: CSS_RULE_LIST@0..23 + 1: CSS_ROOT_ITEM_LIST@0..23 0: CSS_AT_RULE@0..9 0: AT@0..1 "@" [] [] 1: TW_SOURCE_AT_RULE@1..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-arbitrary.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-arbitrary.css.snap index 21880b6508c6..ce053af860e4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-arbitrary.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-arbitrary.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -85,7 +85,7 @@ CssRoot { ``` 0: CSS_ROOT@0..44 0: (empty) - 1: CSS_RULE_LIST@0..43 + 1: CSS_ROOT_ITEM_LIST@0..43 0: CSS_AT_RULE@0..43 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..43 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-incomplete.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-incomplete.css.snap index cfb03b5a0484..2c4255f72ca0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-incomplete.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/value-incomplete.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -79,7 +79,7 @@ CssRoot { ``` 0: CSS_ROOT@0..42 0: (empty) - 1: CSS_RULE_LIST@0..41 + 1: CSS_ROOT_ITEM_LIST@0..41 0: CSS_AT_RULE@0..41 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..41 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_charset.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_charset.css.snap index 3223a84efc4b..d15b0b492eae 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_charset.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_charset.css.snap @@ -2,7 +2,6 @@ source: crates/biome_css_parser/tests/spec_test.rs expression: snapshot --- - ## Input ```css @@ -17,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssCharsetAtRule { @@ -48,7 +47,7 @@ CssRoot { ``` 0: CSS_ROOT@0..42 0: (empty) - 1: CSS_RULE_LIST@0..41 + 1: CSS_ROOT_ITEM_LIST@0..41 0: CSS_AT_RULE@0..17 0: AT@0..1 "@" [] [] 1: CSS_CHARSET_AT_RULE@1..17 @@ -66,5 +65,3 @@ CssRoot { 2: EOF@41..42 "" [Newline("\n")] [] ``` - - diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_color_profile.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_color_profile.css.snap index bfa9ba82868f..14f3dd9d2f84 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_color_profile.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_color_profile.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssColorProfileAtRule { @@ -78,7 +78,7 @@ CssRoot { ``` 0: CSS_ROOT@0..96 0: (empty) - 1: CSS_RULE_LIST@0..95 + 1: CSS_ROOT_ITEM_LIST@0..95 0: CSS_AT_RULE@0..29 0: AT@0..1 "@" [] [] 1: CSS_COLOR_PROFILE_AT_RULE@1..29 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container.css.snap index 063fed4b95db..297baba281b4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container.css.snap @@ -52,7 +52,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssContainerAtRule { @@ -775,7 +775,7 @@ CssRoot { ``` 0: CSS_ROOT@0..892 0: (empty) - 1: CSS_RULE_LIST@0..891 + 1: CSS_ROOT_ITEM_LIST@0..891 0: CSS_AT_RULE@0..41 0: AT@0..1 "@" [] [] 1: CSS_CONTAINER_AT_RULE@1..41 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container_complex.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container_complex.css.snap index fa3f609bfa7a..58b31ff49e73 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container_complex.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container_complex.css.snap @@ -38,7 +38,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssContainerAtRule { @@ -1308,7 +1308,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1322 0: (empty) - 1: CSS_RULE_LIST@0..1321 + 1: CSS_ROOT_ITEM_LIST@0..1321 0: CSS_AT_RULE@0..38 0: AT@0..1 "@" [] [] 1: CSS_CONTAINER_AT_RULE@1..38 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_counter_style.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_counter_style.css.snap index c18bdc577a26..71c63d33f3ef 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_counter_style.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_counter_style.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssCounterStyleAtRule { @@ -42,7 +42,7 @@ CssRoot { ``` 0: CSS_ROOT@0..27 0: (empty) - 1: CSS_RULE_LIST@0..26 + 1: CSS_ROOT_ITEM_LIST@0..26 0: CSS_AT_RULE@0..26 0: AT@0..1 "@" [] [] 1: CSS_COUNTER_STYLE_AT_RULE@1..26 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_document.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_document.css.snap index 154ee8473139..fd0c9528db96 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_document.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_document.css.snap @@ -72,7 +72,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssDocumentAtRule { @@ -811,7 +811,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1235 0: (empty) - 1: CSS_RULE_LIST@0..1234 + 1: CSS_ROOT_ITEM_LIST@0..1234 0: CSS_AT_RULE@0..70 0: AT@0..1 "@" [] [] 1: CSS_DOCUMENT_AT_RULE@1..70 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_face.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_face.css.snap index 7c4380d9a66a..ee0bdd8593f3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_face.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_face.css.snap @@ -14,7 +14,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontFaceAtRule { @@ -38,7 +38,7 @@ CssRoot { ``` 0: CSS_ROOT@0..13 0: (empty) - 1: CSS_RULE_LIST@0..13 + 1: CSS_ROOT_ITEM_LIST@0..13 0: CSS_AT_RULE@0..13 0: AT@0..1 "@" [] [] 1: CSS_FONT_FACE_AT_RULE@1..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_feature_values.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_feature_values.css.snap index 01497c77f61b..2298ac872701 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_feature_values.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_feature_values.css.snap @@ -65,7 +65,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontFeatureValuesAtRule { @@ -719,7 +719,7 @@ CssRoot { ``` 0: CSS_ROOT@0..861 0: (empty) - 1: CSS_RULE_LIST@0..859 + 1: CSS_ROOT_ITEM_LIST@0..859 0: CSS_AT_RULE@0..31 0: AT@0..1 "@" [] [] 1: CSS_FONT_FEATURE_VALUES_AT_RULE@1..31 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css.snap index ad656407ea12..856367aaa918 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontPaletteValuesAtRule { @@ -59,7 +59,7 @@ CssRoot { ``` 0: CSS_ROOT@0..78 0: (empty) - 1: CSS_RULE_LIST@0..77 + 1: CSS_ROOT_ITEM_LIST@0..77 0: CSS_AT_RULE@0..33 0: AT@0..1 "@" [] [] 1: CSS_FONT_PALETTE_VALUES_AT_RULE@1..33 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_function.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_function.css.snap index 71bad0e02b79..95c5aa804557 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_function.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_function.css.snap @@ -118,7 +118,7 @@ p { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFunctionAtRule { @@ -2489,7 +2489,7 @@ CssRoot { ``` 0: CSS_ROOT@0..2112 0: (empty) - 1: CSS_RULE_LIST@0..2111 + 1: CSS_ROOT_ITEM_LIST@0..2111 0: CSS_AT_RULE@0..102 0: AT@0..1 "@" [] [] 1: CSS_FUNCTION_AT_RULE@1..102 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_import.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_import.css.snap index ea91c375de5b..1d0046d20229 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_import.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_import.css.snap @@ -180,7 +180,7 @@ st.css'); ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssImportAtRule { @@ -3986,7 +3986,7 @@ CssRoot { ``` 0: CSS_ROOT@0..6506 0: (empty) - 1: CSS_RULE_LIST@0..6505 + 1: CSS_ROOT_ITEM_LIST@0..6505 0: CSS_AT_RULE@0..27 0: AT@0..1 "@" [] [] 1: CSS_IMPORT_AT_RULE@1..27 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_keyframe.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_keyframe.css.snap index 6d9abb2e0d96..e231da3debe5 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_keyframe.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_keyframe.css.snap @@ -68,7 +68,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { @@ -730,7 +730,7 @@ CssRoot { ``` 0: CSS_ROOT@0..690 0: (empty) - 1: CSS_RULE_LIST@0..689 + 1: CSS_ROOT_ITEM_LIST@0..689 0: CSS_AT_RULE@0..28 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..28 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_layer.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_layer.css.snap index 45b4bca9fdb2..347803b38ec0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_layer.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_layer.css.snap @@ -88,7 +88,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssLayerAtRule { @@ -1194,7 +1194,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1388 0: (empty) - 1: CSS_RULE_LIST@0..1388 + 1: CSS_ROOT_ITEM_LIST@0..1388 0: CSS_AT_RULE@0..52 0: AT@0..1 "@" [] [] 1: CSS_LAYER_AT_RULE@1..52 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snap index 32b5e1ec80f8..afb4662c290e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snap @@ -135,7 +135,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssMediaAtRule { @@ -4089,7 +4089,7 @@ CssRoot { ``` 0: CSS_ROOT@0..4111 0: (empty) - 1: CSS_RULE_LIST@0..4111 + 1: CSS_ROOT_ITEM_LIST@0..4111 0: CSS_AT_RULE@0..17 0: AT@0..1 "@" [] [] 1: CSS_MEDIA_AT_RULE@1..17 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media_complex.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media_complex.css.snap index bc51bfa3a765..505371f3fd97 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media_complex.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media_complex.css.snap @@ -38,7 +38,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssMediaAtRule { @@ -910,7 +910,7 @@ CssRoot { ``` 0: CSS_ROOT@0..862 0: (empty) - 1: CSS_RULE_LIST@0..861 + 1: CSS_ROOT_ITEM_LIST@0..861 0: CSS_AT_RULE@0..9 0: AT@0..1 "@" [] [] 1: CSS_MEDIA_AT_RULE@1..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_namespace.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_namespace.css.snap index ff16784b5f9d..2f1b48bbfb25 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_namespace.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_namespace.css.snap @@ -2,7 +2,6 @@ source: crates/biome_css_parser/tests/spec_test.rs expression: snapshot --- - ## Input ```css @@ -23,7 +22,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssNamespaceAtRule { @@ -154,7 +153,7 @@ CssRoot { ``` 0: CSS_ROOT@0..316 0: (empty) - 1: CSS_RULE_LIST@0..315 + 1: CSS_ROOT_ITEM_LIST@0..315 0: CSS_AT_RULE@0..20 0: AT@0..1 "@" [] [] 1: CSS_NAMESPACE_AT_RULE@1..20 @@ -246,5 +245,3 @@ CssRoot { 2: EOF@315..316 "" [Newline("\n")] [] ``` - - diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page.css.snap index 6a6e3d810b0b..7c6877fa9fa3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page.css.snap @@ -89,7 +89,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssPageAtRule { @@ -1321,7 +1321,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1193 0: (empty) - 1: CSS_RULE_LIST@0..1192 + 1: CSS_ROOT_ITEM_LIST@0..1192 0: CSS_AT_RULE@0..8 0: AT@0..1 "@" [] [] 1: CSS_PAGE_AT_RULE@1..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page_complex.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page_complex.css.snap index 0f0175b5ea72..47f15c790452 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page_complex.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page_complex.css.snap @@ -137,7 +137,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssPageAtRule { @@ -1664,7 +1664,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1815 0: (empty) - 1: CSS_RULE_LIST@0..1814 + 1: CSS_ROOT_ITEM_LIST@0..1814 0: CSS_AT_RULE@0..1814 0: AT@0..1 "@" [] [] 1: CSS_PAGE_AT_RULE@1..1814 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_position_try.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_position_try.css.snap index b2f02dc42085..b9a6c9ef7cb6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_position_try.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_position_try.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssPositionTryAtRule { @@ -176,7 +176,7 @@ CssRoot { ``` 0: CSS_ROOT@0..196 0: (empty) - 1: CSS_RULE_LIST@0..195 + 1: CSS_ROOT_ITEM_LIST@0..195 0: CSS_AT_RULE@0..25 0: AT@0..1 "@" [] [] 1: CSS_POSITION_TRY_AT_RULE@1..25 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_property.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_property.css.snap index 73f2eaef4c96..521ee7e5367a 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_property.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_property.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssPropertyAtRule { @@ -43,7 +43,7 @@ CssRoot { ``` 0: CSS_ROOT@0..25 0: (empty) - 1: CSS_RULE_LIST@0..24 + 1: CSS_ROOT_ITEM_LIST@0..24 0: CSS_AT_RULE@0..24 0: AT@0..1 "@" [] [] 1: CSS_PROPERTY_AT_RULE@1..24 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_scope.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_scope.css.snap index 9ba6c30cd7ab..581a5917b447 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_scope.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_scope.css.snap @@ -69,7 +69,7 @@ img { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssScopeAtRule { @@ -805,7 +805,7 @@ CssRoot { ``` 0: CSS_ROOT@0..625 0: (empty) - 1: CSS_RULE_LIST@0..624 + 1: CSS_ROOT_ITEM_LIST@0..624 0: CSS_AT_RULE@0..87 0: AT@0..1 "@" [] [] 1: CSS_SCOPE_AT_RULE@1..87 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_starting_style.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_starting_style.css.snap index 58ecf3dd86aa..6b4adc1a3897 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_starting_style.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_starting_style.css.snap @@ -38,7 +38,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssStartingStyleAtRule { @@ -275,7 +275,7 @@ CssRoot { ``` 0: CSS_ROOT@0..264 0: (empty) - 1: CSS_RULE_LIST@0..263 + 1: CSS_ROOT_ITEM_LIST@0..263 0: CSS_AT_RULE@0..168 0: AT@0..1 "@" [] [] 1: CSS_STARTING_STYLE_AT_RULE@1..168 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports.css.snap index 5f6ca19f84f3..647e91e85640 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports.css.snap @@ -179,7 +179,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssSupportsAtRule { @@ -3507,7 +3507,7 @@ CssRoot { ``` 0: CSS_ROOT@0..3120 0: (empty) - 1: CSS_RULE_LIST@0..3119 + 1: CSS_ROOT_ITEM_LIST@0..3119 0: CSS_AT_RULE@0..56 0: AT@0..1 "@" [] [] 1: CSS_SUPPORTS_AT_RULE@1..56 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports_complex.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports_complex.css.snap index e35b17e921bf..2fd17730438b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports_complex.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports_complex.css.snap @@ -20,7 +20,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssSupportsAtRule { @@ -531,7 +531,7 @@ CssRoot { ``` 0: CSS_ROOT@0..514 0: (empty) - 1: CSS_RULE_LIST@0..513 + 1: CSS_ROOT_ITEM_LIST@0..513 0: CSS_AT_RULE@0..30 0: AT@0..1 "@" [] [] 1: CSS_SUPPORTS_AT_RULE@1..30 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_unknown.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_unknown.css.snap index aca9909f0fe7..0b841cdcf05c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_unknown.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_unknown.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -121,7 +121,7 @@ CssRoot { ``` 0: CSS_ROOT@0..108 0: (empty) - 1: CSS_RULE_LIST@0..107 + 1: CSS_ROOT_ITEM_LIST@0..107 0: CSS_QUALIFIED_RULE@0..59 0: CSS_SELECTOR_LIST@0..11 0: CSS_COMPOUND_SELECTOR@0..11 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_view_transition.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_view_transition.css.snap index 57012a143c6d..3da806402635 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_view_transition.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_view_transition.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssViewTransitionAtRule { @@ -74,7 +74,7 @@ CssRoot { ``` 0: CSS_ROOT@0..63 0: (empty) - 1: CSS_RULE_LIST@0..62 + 1: CSS_ROOT_ITEM_LIST@0..62 0: CSS_AT_RULE@0..20 0: AT@0..1 "@" [] [] 1: CSS_VIEW_TRANSITION_AT_RULE@1..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/keyframes/at_rule_keyframe_css_modules.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/keyframes/at_rule_keyframe_css_modules.css.snap index 79e67fa4765a..af1d5e4a62d7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/keyframes/at_rule_keyframe_css_modules.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/keyframes/at_rule_keyframe_css_modules.css.snap @@ -24,7 +24,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { @@ -231,7 +231,7 @@ CssRoot { ``` 0: CSS_ROOT@0..264 0: (empty) - 1: CSS_RULE_LIST@0..263 + 1: CSS_ROOT_ITEM_LIST@0..263 0: CSS_AT_RULE@0..18 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..18 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/value/at_rule_value.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/value/at_rule_value.css.snap index fdc079ab3ae4..2734615b4c31 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/value/at_rule_value.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/value/at_rule_value.css.snap @@ -29,7 +29,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..74 "@" [Comments("/* my-component.css */"), Newline("\n"), Comments("/* alias paths for ot ..."), Newline("\n")] [], rule: CssValueAtRule { @@ -320,7 +320,7 @@ CssRoot { ``` 0: CSS_ROOT@0..639 0: (empty) - 1: CSS_RULE_LIST@0..638 + 1: CSS_ROOT_ITEM_LIST@0..638 0: CSS_AT_RULE@0..103 0: AT@0..74 "@" [Comments("/* my-component.css */"), Newline("\n"), Comments("/* alias paths for ot ..."), Newline("\n")] [] 1: CSS_VALUE_AT_RULE@74..103 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/class_selector.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/class_selector.css.snap index a4a2a42c39b0..bf71ff9fde12 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/class_selector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/class_selector.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -47,7 +47,7 @@ CssRoot { ``` 0: CSS_ROOT@0..11 0: (empty) - 1: CSS_RULE_LIST@0..10 + 1: CSS_ROOT_ITEM_LIST@0..10 0: CSS_QUALIFIED_RULE@0..10 0: CSS_SELECTOR_LIST@0..8 0: CSS_COMPOUND_SELECTOR@0..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/declaration_emty.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/declaration_emty.css.snap index 1540965a1955..9855e73ffe28 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/declaration_emty.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/declaration_emty.css.snap @@ -60,7 +60,7 @@ b { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -518,7 +518,7 @@ CssRoot { ``` 0: CSS_ROOT@0..308 0: (empty) - 1: CSS_RULE_LIST@0..308 + 1: CSS_ROOT_ITEM_LIST@0..308 0: CSS_QUALIFIED_RULE@0..47 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/declaration_list.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/declaration_list.css.snap index 338baed19722..59983f9ad659 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/declaration_list.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/declaration_list.css.snap @@ -69,7 +69,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -780,7 +780,7 @@ CssRoot { ``` 0: CSS_ROOT@0..522 0: (empty) - 1: CSS_RULE_LIST@0..521 + 1: CSS_ROOT_ITEM_LIST@0..521 0: CSS_QUALIFIED_RULE@0..41 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/dimension.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/dimension.css.snap index c82e61d10605..341e52f19f40 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/dimension.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/dimension.css.snap @@ -94,7 +94,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -1481,7 +1481,7 @@ CssRoot { ``` 0: CSS_ROOT@0..979 0: (empty) - 1: CSS_RULE_LIST@0..979 + 1: CSS_ROOT_ITEM_LIST@0..979 0: CSS_QUALIFIED_RULE@0..917 0: CSS_SELECTOR_LIST@0..10 0: CSS_COMPOUND_SELECTOR@0..10 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/empty.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/empty.css.snap index eeb43ddf6f84..e806c2dd21c9 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/empty.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/empty.css.snap @@ -2,7 +2,6 @@ source: crates/biome_css_parser/tests/spec_test.rs expression: snapshot --- - ## Input ```css @@ -15,7 +14,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [], + items: CssRootItemList [], eof_token: EOF@0..0 "" [] [], } ``` @@ -25,9 +24,7 @@ CssRoot { ``` 0: CSS_ROOT@0..0 0: (empty) - 1: CSS_RULE_LIST@0..0 + 1: CSS_ROOT_ITEM_LIST@0..0 2: EOF@0..0 "" [] [] ``` - - diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/attr.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/attr.css.snap index 507afd09ca13..1f76e4ac7708 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/attr.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/attr.css.snap @@ -72,7 +72,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -1812,7 +1812,7 @@ CssRoot { ``` 0: CSS_ROOT@0..2140 0: (empty) - 1: CSS_RULE_LIST@0..2139 + 1: CSS_ROOT_ITEM_LIST@0..2139 0: CSS_QUALIFIED_RULE@0..2139 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/calc.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/calc.css.snap index b9de28609c52..6aa49e424c34 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/calc.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/calc.css.snap @@ -162,7 +162,7 @@ div { width: calc(50% - ( ( 4% ) * 0.5 ) ); } ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -5003,7 +5003,7 @@ CssRoot { ``` 0: CSS_ROOT@0..3559 0: (empty) - 1: CSS_RULE_LIST@0..3559 + 1: CSS_ROOT_ITEM_LIST@0..3559 0: CSS_QUALIFIED_RULE@0..42 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/if.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/if.css.snap index 373928eaa415..8b0b53e52124 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/if.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/if.css.snap @@ -449,7 +449,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -9288,7 +9288,7 @@ CssRoot { ``` 0: CSS_ROOT@0..9001 0: (empty) - 1: CSS_RULE_LIST@0..9000 + 1: CSS_ROOT_ITEM_LIST@0..9000 0: CSS_QUALIFIED_RULE@0..62 0: CSS_SELECTOR_LIST@0..13 0: CSS_COMPOUND_SELECTOR@0..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/linear-gradient.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/linear-gradient.css.snap index 87c9ce534753..302f26189b55 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/linear-gradient.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/linear-gradient.css.snap @@ -28,7 +28,7 @@ a { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -792,7 +792,7 @@ CssRoot { ``` 0: CSS_ROOT@0..748 0: (empty) - 1: CSS_RULE_LIST@0..748 + 1: CSS_ROOT_ITEM_LIST@0..748 0: CSS_QUALIFIED_RULE@0..748 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/rgb.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/rgb.css.snap index 031b4a3c4c59..a28188918001 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/rgb.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/rgb.css.snap @@ -22,7 +22,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -299,7 +299,7 @@ CssRoot { ``` 0: CSS_ROOT@0..202 0: (empty) - 1: CSS_RULE_LIST@0..201 + 1: CSS_ROOT_ITEM_LIST@0..201 0: CSS_QUALIFIED_RULE@0..80 0: CSS_SELECTOR_LIST@0..7 0: CSS_COMPOUND_SELECTOR@0..7 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/unknow.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/unknow.css.snap index c0a5ef7ef789..d8e3a3619050 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/unknow.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/unknow.css.snap @@ -18,7 +18,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -148,7 +148,7 @@ CssRoot { ``` 0: CSS_ROOT@0..78 0: (empty) - 1: CSS_RULE_LIST@0..78 + 1: CSS_ROOT_ITEM_LIST@0..78 0: CSS_QUALIFIED_RULE@0..78 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/url.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/url.css.snap index 1ff4a942299a..32ffc1e3ef73 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/url.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/url.css.snap @@ -62,7 +62,7 @@ a { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -710,7 +710,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1251 0: (empty) - 1: CSS_RULE_LIST@0..1251 + 1: CSS_ROOT_ITEM_LIST@0..1251 0: CSS_QUALIFIED_RULE@0..1251 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/function/var.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/function/var.css.snap index acb69fca26ad..d41404903624 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/function/var.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/function/var.css.snap @@ -18,7 +18,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -156,7 +156,7 @@ CssRoot { ``` 0: CSS_ROOT@0..77 0: (empty) - 1: CSS_RULE_LIST@0..77 + 1: CSS_ROOT_ITEM_LIST@0..77 0: CSS_QUALIFIED_RULE@0..77 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/grit_metavariable/metavar.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/grit_metavariable/metavar.css.snap index 588aaab38415..c5151e63d290 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/grit_metavariable/metavar.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/grit_metavariable/metavar.css.snap @@ -28,7 +28,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -167,7 +167,7 @@ CssRoot { ``` 0: CSS_ROOT@0..98 0: (empty) - 1: CSS_RULE_LIST@0..98 + 1: CSS_ROOT_ITEM_LIST@0..98 0: CSS_QUALIFIED_RULE@0..28 0: CSS_SELECTOR_LIST@0..5 0: CSS_COMPOUND_SELECTOR@0..5 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/conditional_at_rule.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/conditional_at_rule.css.snap index 7e3b409e5daa..773f04caf060 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/conditional_at_rule.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/conditional_at_rule.css.snap @@ -187,7 +187,7 @@ span { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -2304,7 +2304,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1776 0: (empty) - 1: CSS_RULE_LIST@0..1775 + 1: CSS_ROOT_ITEM_LIST@0..1775 0: CSS_QUALIFIED_RULE@0..332 0: CSS_SELECTOR_LIST@0..5 0: CSS_COMPOUND_SELECTOR@0..5 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/multiple_amp.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/multiple_amp.css.snap index 392810ecde96..5855e8d221c7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/multiple_amp.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/multiple_amp.css.snap @@ -27,7 +27,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -209,7 +209,7 @@ CssRoot { ``` 0: CSS_ROOT@0..95 0: (empty) - 1: CSS_RULE_LIST@0..94 + 1: CSS_ROOT_ITEM_LIST@0..94 0: CSS_QUALIFIED_RULE@0..94 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting.css.snap index 0245eca675a9..130ae85365b6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting.css.snap @@ -190,7 +190,7 @@ article { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -3174,7 +3174,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1956 0: (empty) - 1: CSS_RULE_LIST@0..1955 + 1: CSS_ROOT_ITEM_LIST@0..1955 0: CSS_QUALIFIED_RULE@0..219 0: CSS_SELECTOR_LIST@0..17 0: CSS_COMPOUND_SELECTOR@0..17 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting_1.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting_1.css.snap index facae34866d2..d16568ca7134 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting_1.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting_1.css.snap @@ -24,7 +24,7 @@ main { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -176,7 +176,7 @@ CssRoot { ``` 0: CSS_ROOT@0..91 0: (empty) - 1: CSS_RULE_LIST@0..90 + 1: CSS_ROOT_ITEM_LIST@0..90 0: CSS_QUALIFIED_RULE@0..90 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/composes/composes.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/composes/composes.css.snap index 7f132ba0cb9e..3599d37b7736 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/composes/composes.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/composes/composes.css.snap @@ -33,7 +33,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -275,7 +275,7 @@ CssRoot { ``` 0: CSS_ROOT@0..254 0: (empty) - 1: CSS_RULE_LIST@0..253 + 1: CSS_ROOT_ITEM_LIST@0..253 0: CSS_QUALIFIED_RULE@0..26 0: CSS_SELECTOR_LIST@0..3 0: CSS_COMPOUND_SELECTOR@0..3 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/grid.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/grid.css.snap index 689d84c6769d..e7cf7b7eeecd 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/grid.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/grid.css.snap @@ -24,7 +24,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -259,7 +259,7 @@ CssRoot { ``` 0: CSS_ROOT@0..258 0: (empty) - 1: CSS_RULE_LIST@0..257 + 1: CSS_ROOT_ITEM_LIST@0..257 0: CSS_QUALIFIED_RULE@0..65 0: CSS_SELECTOR_LIST@0..12 0: CSS_COMPOUND_SELECTOR@0..12 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/property-with-emoji.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/property-with-emoji.css.snap index 669d534ad0e6..6391693aa1ac 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/property-with-emoji.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/property-with-emoji.css.snap @@ -19,7 +19,7 @@ p { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -133,7 +133,7 @@ CssRoot { ``` 0: CSS_ROOT@0..94 0: (empty) - 1: CSS_RULE_LIST@0..94 + 1: CSS_ROOT_ITEM_LIST@0..94 0: CSS_QUALIFIED_RULE@0..94 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_all.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_all.css.snap index 2de680fe90e5..a2afc301ea24 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_all.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_all.css.snap @@ -30,7 +30,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -291,7 +291,7 @@ CssRoot { ``` 0: CSS_ROOT@0..335 0: (empty) - 1: CSS_RULE_LIST@0..335 + 1: CSS_ROOT_ITEM_LIST@0..335 0: CSS_QUALIFIED_RULE@0..335 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_border.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_border.css.snap index 4db40cca3f1f..11652b24a6c4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_border.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_border.css.snap @@ -63,7 +63,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -774,7 +774,7 @@ CssRoot { ``` 0: CSS_ROOT@0..973 0: (empty) - 1: CSS_RULE_LIST@0..972 + 1: CSS_ROOT_ITEM_LIST@0..972 0: CSS_QUALIFIED_RULE@0..972 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_generic.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_generic.css.snap index bed437952a87..411ebe7a25a2 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_generic.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_generic.css.snap @@ -41,7 +41,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -545,7 +545,7 @@ CssRoot { ``` 0: CSS_ROOT@0..878 0: (empty) - 1: CSS_RULE_LIST@0..878 + 1: CSS_ROOT_ITEM_LIST@0..878 0: CSS_QUALIFIED_RULE@0..878 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_z-index.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_z-index.css.snap index de394e5c696e..57e8a60348b0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/property_z-index.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/property_z-index.css.snap @@ -41,7 +41,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -404,7 +404,7 @@ CssRoot { ``` 0: CSS_ROOT@0..528 0: (empty) - 1: CSS_RULE_LIST@0..527 + 1: CSS_ROOT_ITEM_LIST@0..527 0: CSS_QUALIFIED_RULE@0..527 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/property/unicode_range.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/property/unicode_range.css.snap index 19d506e52199..79fe1e210116 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/property/unicode_range.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/property/unicode_range.css.snap @@ -45,7 +45,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssFontFaceAtRule { @@ -812,7 +812,7 @@ CssRoot { ``` 0: CSS_ROOT@0..944 0: (empty) - 1: CSS_RULE_LIST@0..943 + 1: CSS_ROOT_ITEM_LIST@0..943 0: CSS_AT_RULE@0..90 0: AT@0..1 "@" [] [] 1: CSS_FONT_FACE_AT_RULE@1..90 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/line.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/line.scss new file mode 100644 index 000000000000..38d3feb81cdd --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/line.scss @@ -0,0 +1,9 @@ +foo {a: 1 // flang } + } + +.foo bar[val="//"] { + baz: bang; //} +} + + + diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/line.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/line.scss.snap new file mode 100644 index 000000000000..1ab751ff56d4 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/line.scss.snap @@ -0,0 +1,220 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +foo {a: 1 // flang } + } + +.foo bar[val="//"] { + baz: bang; //} +} + + + + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: CssTypeSelector { + namespace: missing (optional), + ident: CssIdentifier { + value_token: IDENT@0..4 "foo" [] [Whitespace(" ")], + }, + }, + sub_selectors: CssSubSelectorList [], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@4..5 "{" [] [], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@5..6 "a" [] [], + }, + colon_token: COLON@6..8 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssNumber { + value_token: CSS_NUMBER_LITERAL@8..21 "1" [] [Whitespace(" "), Comments("// flang }")], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: missing (optional), + }, + ], + r_curly_token: R_CURLY@21..26 "}" [Newline("\n"), Whitespace(" ")] [], + }, + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssComplexSelector { + left: CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@26..29 "." [Newline("\n"), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@29..32 "foo" [] [], + }, + }, + ], + }, + combinator: CSS_SPACE_LITERAL@32..33 " " [] [], + right: CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: CssTypeSelector { + namespace: missing (optional), + ident: CssIdentifier { + value_token: IDENT@33..36 "bar" [] [], + }, + }, + sub_selectors: CssSubSelectorList [ + CssAttributeSelector { + l_brack_token: L_BRACK@36..37 "[" [] [], + name: CssAttributeName { + namespace: missing (optional), + name: CssIdentifier { + value_token: IDENT@37..40 "val" [] [], + }, + }, + matcher: CssAttributeMatcher { + operator: EQ@40..41 "=" [] [], + value: CssAttributeMatcherValue { + name: CssString { + value_token: CSS_STRING_LITERAL@41..45 "\"//\"" [] [], + }, + }, + modifier: missing (optional), + }, + r_brack_token: R_BRACK@45..47 "]" [] [Whitespace(" ")], + }, + ], + }, + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@47..48 "{" [] [], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@48..54 "baz" [Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@54..56 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@56..60 "bang" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@60..65 ";" [] [Whitespace(" "), Comments("//}")], + }, + ], + r_curly_token: R_CURLY@65..67 "}" [Newline("\n")] [], + }, + }, + ], + eof_token: EOF@67..71 "" [Newline("\n"), Newline("\n"), Newline("\n"), Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..71 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..67 + 0: CSS_QUALIFIED_RULE@0..26 + 0: CSS_SELECTOR_LIST@0..4 + 0: CSS_COMPOUND_SELECTOR@0..4 + 0: CSS_NESTED_SELECTOR_LIST@0..0 + 1: CSS_TYPE_SELECTOR@0..4 + 0: (empty) + 1: CSS_IDENTIFIER@0..4 + 0: IDENT@0..4 "foo" [] [Whitespace(" ")] + 2: CSS_SUB_SELECTOR_LIST@4..4 + 1: CSS_DECLARATION_OR_RULE_BLOCK@4..26 + 0: L_CURLY@4..5 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@5..21 + 0: CSS_DECLARATION_WITH_SEMICOLON@5..21 + 0: CSS_DECLARATION@5..21 + 0: CSS_GENERIC_PROPERTY@5..21 + 0: CSS_IDENTIFIER@5..6 + 0: IDENT@5..6 "a" [] [] + 1: COLON@6..8 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@8..21 + 0: CSS_NUMBER@8..21 + 0: CSS_NUMBER_LITERAL@8..21 "1" [] [Whitespace(" "), Comments("// flang }")] + 1: (empty) + 1: (empty) + 2: R_CURLY@21..26 "}" [Newline("\n"), Whitespace(" ")] [] + 1: CSS_QUALIFIED_RULE@26..67 + 0: CSS_SELECTOR_LIST@26..47 + 0: CSS_COMPLEX_SELECTOR@26..47 + 0: CSS_COMPOUND_SELECTOR@26..32 + 0: CSS_NESTED_SELECTOR_LIST@26..26 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@26..32 + 0: CSS_CLASS_SELECTOR@26..32 + 0: DOT@26..29 "." [Newline("\n"), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@29..32 + 0: IDENT@29..32 "foo" [] [] + 1: CSS_SPACE_LITERAL@32..33 " " [] [] + 2: CSS_COMPOUND_SELECTOR@33..47 + 0: CSS_NESTED_SELECTOR_LIST@33..33 + 1: CSS_TYPE_SELECTOR@33..36 + 0: (empty) + 1: CSS_IDENTIFIER@33..36 + 0: IDENT@33..36 "bar" [] [] + 2: CSS_SUB_SELECTOR_LIST@36..47 + 0: CSS_ATTRIBUTE_SELECTOR@36..47 + 0: L_BRACK@36..37 "[" [] [] + 1: CSS_ATTRIBUTE_NAME@37..40 + 0: (empty) + 1: CSS_IDENTIFIER@37..40 + 0: IDENT@37..40 "val" [] [] + 2: CSS_ATTRIBUTE_MATCHER@40..45 + 0: EQ@40..41 "=" [] [] + 1: CSS_ATTRIBUTE_MATCHER_VALUE@41..45 + 0: CSS_STRING@41..45 + 0: CSS_STRING_LITERAL@41..45 "\"//\"" [] [] + 2: (empty) + 3: R_BRACK@45..47 "]" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@47..67 + 0: L_CURLY@47..48 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@48..65 + 0: CSS_DECLARATION_WITH_SEMICOLON@48..65 + 0: CSS_DECLARATION@48..60 + 0: CSS_GENERIC_PROPERTY@48..60 + 0: CSS_IDENTIFIER@48..54 + 0: IDENT@48..54 "baz" [Newline("\n"), Whitespace(" ")] [] + 1: COLON@54..56 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@56..60 + 0: CSS_IDENTIFIER@56..60 + 0: IDENT@56..60 "bang" [] [] + 1: (empty) + 1: SEMICOLON@60..65 ";" [] [Whitespace(" "), Comments("//}")] + 2: R_CURLY@65..67 "}" [Newline("\n")] [] + 2: EOF@67..71 "" [Newline("\n"), Newline("\n"), Newline("\n"), Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss new file mode 100644 index 000000000000..5af7e108a20a --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss @@ -0,0 +1,38 @@ +/* Standard CSS multiline comment + in SCSS context */ +$var: value; + +/* Comment before selector */ +.foo { + color: red; +} + +/* Multi-line comment + with multiple lines + and more content */ +$another-var: blue; + +// SCSS line comment +$line-comment: true; + +/* Nested /* comment */ attempt */ +.nested { + /* Comment inside rule */ + background: white; +} + +/* Comment with special chars: @#$%^&*() */ +$special: 10px; + +/* + * Comment before mixin + */ +@mixin test-mixin { + /* Comment inside mixin */ + margin: 0; +} + +/* Comment at end of file */ + + + diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss.snap new file mode 100644 index 000000000000..0c35b3187c19 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss.snap @@ -0,0 +1,365 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +/* Standard CSS multiline comment + in SCSS context */ +$var: value; + +/* Comment before selector */ +.foo { + color: red; +} + +/* Multi-line comment + with multiple lines + and more content */ +$another-var: blue; + +// SCSS line comment +$line-comment: true; + +/* Nested /* comment */ attempt */ +.nested { + /* Comment inside rule */ + background: white; +} + +/* Comment with special chars: @#$%^&*() */ +$special: 10px; + +/* + * Comment before mixin + */ +@mixin test-mixin { + /* Comment inside mixin */ + margin: 0; +} + +/* Comment at end of file */ + + + + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@0..57 "$" [Comments("/* Standard CSS multi ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@57..60 "var" [] [], + }, + }, + colon_token: COLON@60..62 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@62..67 "value" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@67..68 ";" [] [], + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@68..101 "." [Newline("\n"), Newline("\n"), Comments("/* Comment before sel ..."), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@101..105 "foo" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@105..106 "{" [] [], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@106..114 "color" [Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@114..116 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@116..119 "red" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@119..120 ";" [] [], + }, + ], + r_curly_token: R_CURLY@120..122 "}" [Newline("\n")] [], + }, + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@122..193 "$" [Newline("\n"), Newline("\n"), Comments("/* Multi-line comment ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@193..204 "another-var" [] [], + }, + }, + colon_token: COLON@204..206 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@206..210 "blue" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@210..211 ";" [] [], + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@211..235 "$" [Newline("\n"), Newline("\n"), Comments("// SCSS line comment"), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@235..247 "line-comment" [] [], + }, + }, + colon_token: COLON@247..249 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@249..253 "true" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@253..254 ";" [] [], + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@254..292 "." [Newline("\n"), Newline("\n"), Comments("/* Nested /* comment ..."), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@292..299 "nested" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@299..300 "{" [] [], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@300..341 "background" [Newline("\n"), Whitespace(" "), Comments("/* Comment inside rul ..."), Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@341..343 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@343..348 "white" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@348..349 ";" [] [], + }, + ], + r_curly_token: R_CURLY@349..351 "}" [Newline("\n")] [], + }, + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@351..398 "$" [Newline("\n"), Newline("\n"), Comments("/* Comment with speci ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@398..405 "special" [] [], + }, + }, + colon_token: COLON@405..407 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@407..409 "10" [] [], + unit_token: IDENT@409..411 "px" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@411..412 ";" [] [], + }, + CssAtRule { + at_token: AT@412..446 "@" [Newline("\n"), Newline("\n"), Comments("/*\n * Comment before ..."), Newline("\n")] [], + rule: CssUnknownBlockAtRule { + name: CssIdentifier { + value_token: IDENT@446..452 "mixin" [] [Whitespace(" ")], + }, + components: CssUnknownAtRuleComponentList { + items: [ + IDENT@452..463 "test-mixin" [] [Whitespace(" ")], + ], + }, + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@463..464 "{" [] [], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@464..502 "margin" [Newline("\n"), Whitespace(" "), Comments("/* Comment inside mix ..."), Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@502..504 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssNumber { + value_token: CSS_NUMBER_LITERAL@504..505 "0" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@505..506 ";" [] [], + }, + ], + r_curly_token: R_CURLY@506..508 "}" [Newline("\n")] [], + }, + }, + }, + ], + eof_token: EOF@508..542 "" [Newline("\n"), Newline("\n"), Comments("/* Comment at end of ..."), Newline("\n"), Newline("\n"), Newline("\n"), Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..542 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..508 + 0: SCSS_DECLARATION@0..68 + 0: SCSS_IDENTIFIER@0..60 + 0: DOLLAR@0..57 "$" [Comments("/* Standard CSS multi ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@57..60 + 0: IDENT@57..60 "var" [] [] + 1: COLON@60..62 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@62..67 + 0: CSS_IDENTIFIER@62..67 + 0: IDENT@62..67 "value" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@67..67 + 4: SEMICOLON@67..68 ";" [] [] + 1: CSS_QUALIFIED_RULE@68..122 + 0: CSS_SELECTOR_LIST@68..105 + 0: CSS_COMPOUND_SELECTOR@68..105 + 0: CSS_NESTED_SELECTOR_LIST@68..68 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@68..105 + 0: CSS_CLASS_SELECTOR@68..105 + 0: DOT@68..101 "." [Newline("\n"), Newline("\n"), Comments("/* Comment before sel ..."), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@101..105 + 0: IDENT@101..105 "foo" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@105..122 + 0: L_CURLY@105..106 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@106..120 + 0: CSS_DECLARATION_WITH_SEMICOLON@106..120 + 0: CSS_DECLARATION@106..119 + 0: CSS_GENERIC_PROPERTY@106..119 + 0: CSS_IDENTIFIER@106..114 + 0: IDENT@106..114 "color" [Newline("\n"), Whitespace(" ")] [] + 1: COLON@114..116 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@116..119 + 0: CSS_IDENTIFIER@116..119 + 0: IDENT@116..119 "red" [] [] + 1: (empty) + 1: SEMICOLON@119..120 ";" [] [] + 2: R_CURLY@120..122 "}" [Newline("\n")] [] + 2: SCSS_DECLARATION@122..211 + 0: SCSS_IDENTIFIER@122..204 + 0: DOLLAR@122..193 "$" [Newline("\n"), Newline("\n"), Comments("/* Multi-line comment ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@193..204 + 0: IDENT@193..204 "another-var" [] [] + 1: COLON@204..206 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@206..210 + 0: CSS_IDENTIFIER@206..210 + 0: IDENT@206..210 "blue" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@210..210 + 4: SEMICOLON@210..211 ";" [] [] + 3: SCSS_DECLARATION@211..254 + 0: SCSS_IDENTIFIER@211..247 + 0: DOLLAR@211..235 "$" [Newline("\n"), Newline("\n"), Comments("// SCSS line comment"), Newline("\n")] [] + 1: CSS_IDENTIFIER@235..247 + 0: IDENT@235..247 "line-comment" [] [] + 1: COLON@247..249 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@249..253 + 0: CSS_IDENTIFIER@249..253 + 0: IDENT@249..253 "true" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@253..253 + 4: SEMICOLON@253..254 ";" [] [] + 4: CSS_QUALIFIED_RULE@254..351 + 0: CSS_SELECTOR_LIST@254..299 + 0: CSS_COMPOUND_SELECTOR@254..299 + 0: CSS_NESTED_SELECTOR_LIST@254..254 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@254..299 + 0: CSS_CLASS_SELECTOR@254..299 + 0: DOT@254..292 "." [Newline("\n"), Newline("\n"), Comments("/* Nested /* comment ..."), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@292..299 + 0: IDENT@292..299 "nested" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@299..351 + 0: L_CURLY@299..300 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@300..349 + 0: CSS_DECLARATION_WITH_SEMICOLON@300..349 + 0: CSS_DECLARATION@300..348 + 0: CSS_GENERIC_PROPERTY@300..348 + 0: CSS_IDENTIFIER@300..341 + 0: IDENT@300..341 "background" [Newline("\n"), Whitespace(" "), Comments("/* Comment inside rul ..."), Newline("\n"), Whitespace(" ")] [] + 1: COLON@341..343 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@343..348 + 0: CSS_IDENTIFIER@343..348 + 0: IDENT@343..348 "white" [] [] + 1: (empty) + 1: SEMICOLON@348..349 ";" [] [] + 2: R_CURLY@349..351 "}" [Newline("\n")] [] + 5: SCSS_DECLARATION@351..412 + 0: SCSS_IDENTIFIER@351..405 + 0: DOLLAR@351..398 "$" [Newline("\n"), Newline("\n"), Comments("/* Comment with speci ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@398..405 + 0: IDENT@398..405 "special" [] [] + 1: COLON@405..407 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@407..411 + 0: CSS_REGULAR_DIMENSION@407..411 + 0: CSS_NUMBER_LITERAL@407..409 "10" [] [] + 1: IDENT@409..411 "px" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@411..411 + 4: SEMICOLON@411..412 ";" [] [] + 6: CSS_AT_RULE@412..508 + 0: AT@412..446 "@" [Newline("\n"), Newline("\n"), Comments("/*\n * Comment before ..."), Newline("\n")] [] + 1: CSS_UNKNOWN_BLOCK_AT_RULE@446..508 + 0: CSS_IDENTIFIER@446..452 + 0: IDENT@446..452 "mixin" [] [Whitespace(" ")] + 1: CSS_UNKNOWN_AT_RULE_COMPONENT_LIST@452..463 + 0: IDENT@452..463 "test-mixin" [] [Whitespace(" ")] + 2: CSS_DECLARATION_OR_RULE_BLOCK@463..508 + 0: L_CURLY@463..464 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@464..506 + 0: CSS_DECLARATION_WITH_SEMICOLON@464..506 + 0: CSS_DECLARATION@464..505 + 0: CSS_GENERIC_PROPERTY@464..505 + 0: CSS_IDENTIFIER@464..502 + 0: IDENT@464..502 "margin" [Newline("\n"), Whitespace(" "), Comments("/* Comment inside mix ..."), Newline("\n"), Whitespace(" ")] [] + 1: COLON@502..504 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@504..505 + 0: CSS_NUMBER@504..505 + 0: CSS_NUMBER_LITERAL@504..505 "0" [] [] + 1: (empty) + 1: SEMICOLON@505..506 ";" [] [] + 2: R_CURLY@506..508 "}" [Newline("\n")] [] + 2: EOF@508..542 "" [Newline("\n"), Newline("\n"), Comments("/* Comment at end of ..."), Newline("\n"), Newline("\n"), Newline("\n"), Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss new file mode 100644 index 000000000000..98ed41e4fad5 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss @@ -0,0 +1,25 @@ +/* Outer comment + /* Inner nested comment */ + Still in outer comment +*/ +.simple { color: red; } + +/* Level 1 + /* Level 2 + /* Level 3 */ + */ +*/ +.deep { background: blue; } + +/* Start /* nested /* deeply */ nested */ end */ +$var: value; + +/* Outer + /* Inner with newline + */ + Back to outer +*/ +.test { margin: 0; } + + + diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss.snap new file mode 100644 index 000000000000..6effa8c8021d --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss.snap @@ -0,0 +1,275 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +/* Outer comment + /* Inner nested comment */ + Still in outer comment +*/ +.simple { color: red; } + +/* Level 1 + /* Level 2 + /* Level 3 */ + */ +*/ +.deep { background: blue; } + +/* Start /* nested /* deeply */ nested */ end */ +$var: value; + +/* Outer + /* Inner with newline + */ + Back to outer +*/ +.test { margin: 0; } + + + + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@0..77 "." [Comments("/* Outer comment\n / ..."), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@77..84 "simple" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@84..86 "{" [] [Whitespace(" ")], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@86..91 "color" [] [], + }, + colon_token: COLON@91..93 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@93..96 "red" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@96..98 ";" [] [Whitespace(" ")], + }, + ], + r_curly_token: R_CURLY@98..99 "}" [] [], + }, + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@99..156 "." [Newline("\n"), Newline("\n"), Comments("/* Level 1\n /* Leve ..."), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@156..161 "deep" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@161..163 "{" [] [Whitespace(" ")], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@163..173 "background" [] [], + }, + colon_token: COLON@173..175 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@175..179 "blue" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@179..181 ";" [] [Whitespace(" ")], + }, + ], + r_curly_token: R_CURLY@181..182 "}" [] [], + }, + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@182..234 "$" [Newline("\n"), Newline("\n"), Comments("/* Start /* nested /* ..."), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@234..237 "var" [] [], + }, + }, + colon_token: COLON@237..239 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@239..244 "value" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@244..245 ";" [] [], + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@245..308 "." [Newline("\n"), Newline("\n"), Comments("/* Outer\n /* Inner ..."), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@308..313 "test" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@313..315 "{" [] [Whitespace(" ")], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@315..321 "margin" [] [], + }, + colon_token: COLON@321..323 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssNumber { + value_token: CSS_NUMBER_LITERAL@323..324 "0" [] [], + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@324..326 ";" [] [Whitespace(" ")], + }, + ], + r_curly_token: R_CURLY@326..327 "}" [] [], + }, + }, + ], + eof_token: EOF@327..331 "" [Newline("\n"), Newline("\n"), Newline("\n"), Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..331 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..327 + 0: CSS_QUALIFIED_RULE@0..99 + 0: CSS_SELECTOR_LIST@0..84 + 0: CSS_COMPOUND_SELECTOR@0..84 + 0: CSS_NESTED_SELECTOR_LIST@0..0 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@0..84 + 0: CSS_CLASS_SELECTOR@0..84 + 0: DOT@0..77 "." [Comments("/* Outer comment\n / ..."), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@77..84 + 0: IDENT@77..84 "simple" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@84..99 + 0: L_CURLY@84..86 "{" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_LIST@86..98 + 0: CSS_DECLARATION_WITH_SEMICOLON@86..98 + 0: CSS_DECLARATION@86..96 + 0: CSS_GENERIC_PROPERTY@86..96 + 0: CSS_IDENTIFIER@86..91 + 0: IDENT@86..91 "color" [] [] + 1: COLON@91..93 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@93..96 + 0: CSS_IDENTIFIER@93..96 + 0: IDENT@93..96 "red" [] [] + 1: (empty) + 1: SEMICOLON@96..98 ";" [] [Whitespace(" ")] + 2: R_CURLY@98..99 "}" [] [] + 1: CSS_QUALIFIED_RULE@99..182 + 0: CSS_SELECTOR_LIST@99..161 + 0: CSS_COMPOUND_SELECTOR@99..161 + 0: CSS_NESTED_SELECTOR_LIST@99..99 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@99..161 + 0: CSS_CLASS_SELECTOR@99..161 + 0: DOT@99..156 "." [Newline("\n"), Newline("\n"), Comments("/* Level 1\n /* Leve ..."), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@156..161 + 0: IDENT@156..161 "deep" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@161..182 + 0: L_CURLY@161..163 "{" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_LIST@163..181 + 0: CSS_DECLARATION_WITH_SEMICOLON@163..181 + 0: CSS_DECLARATION@163..179 + 0: CSS_GENERIC_PROPERTY@163..179 + 0: CSS_IDENTIFIER@163..173 + 0: IDENT@163..173 "background" [] [] + 1: COLON@173..175 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@175..179 + 0: CSS_IDENTIFIER@175..179 + 0: IDENT@175..179 "blue" [] [] + 1: (empty) + 1: SEMICOLON@179..181 ";" [] [Whitespace(" ")] + 2: R_CURLY@181..182 "}" [] [] + 2: SCSS_DECLARATION@182..245 + 0: SCSS_IDENTIFIER@182..237 + 0: DOLLAR@182..234 "$" [Newline("\n"), Newline("\n"), Comments("/* Start /* nested /* ..."), Newline("\n")] [] + 1: CSS_IDENTIFIER@234..237 + 0: IDENT@234..237 "var" [] [] + 1: COLON@237..239 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@239..244 + 0: CSS_IDENTIFIER@239..244 + 0: IDENT@239..244 "value" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@244..244 + 4: SEMICOLON@244..245 ";" [] [] + 3: CSS_QUALIFIED_RULE@245..327 + 0: CSS_SELECTOR_LIST@245..313 + 0: CSS_COMPOUND_SELECTOR@245..313 + 0: CSS_NESTED_SELECTOR_LIST@245..245 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@245..313 + 0: CSS_CLASS_SELECTOR@245..313 + 0: DOT@245..308 "." [Newline("\n"), Newline("\n"), Comments("/* Outer\n /* Inner ..."), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@308..313 + 0: IDENT@308..313 "test" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@313..327 + 0: L_CURLY@313..315 "{" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_LIST@315..326 + 0: CSS_DECLARATION_WITH_SEMICOLON@315..326 + 0: CSS_DECLARATION@315..324 + 0: CSS_GENERIC_PROPERTY@315..324 + 0: CSS_IDENTIFIER@315..321 + 0: IDENT@315..321 "margin" [] [] + 1: COLON@321..323 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@323..324 + 0: CSS_NUMBER@323..324 + 0: CSS_NUMBER_LITERAL@323..324 "0" [] [] + 1: (empty) + 1: SEMICOLON@324..326 ";" [] [Whitespace(" ")] + 2: R_CURLY@326..327 "}" [] [] + 2: EOF@327..331 "" [Newline("\n"), Newline("\n"), Newline("\n"), Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss new file mode 100644 index 000000000000..6bd3db87cbe3 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss @@ -0,0 +1,19 @@ +// Global flag usage +$global-var: initial; + +.component { + // Override global variable + $global-var: modified !global; + + // Combined flags + $another-var: value !default !global; + $third-var: value !global !default; + + color: $global-var; +} + +// Global flag with important (SCSS allows both) +.important-test { + $important-var: red !global; + color: $important-var !important; +} diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss.snap new file mode 100644 index 000000000000..d211ce50dcbd --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss.snap @@ -0,0 +1,374 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +// Global flag usage +$global-var: initial; + +.component { + // Override global variable + $global-var: modified !global; + + // Combined flags + $another-var: value !default !global; + $third-var: value !global !default; + + color: $global-var; +} + +// Global flag with important (SCSS allows both) +.important-test { + $important-var: red !global; + color: $important-var !important; +} + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@0..22 "$" [Comments("// Global flag usage"), Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@22..32 "global-var" [] [], + }, + }, + colon_token: COLON@32..34 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@34..41 "initial" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@41..42 ";" [] [], + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@42..45 "." [Newline("\n"), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@45..55 "component" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@55..56 "{" [] [], + items: CssDeclarationOrRuleList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@56..90 "$" [Newline("\n"), Whitespace(" "), Comments("// Override global va ..."), Newline("\n"), Whitespace(" ")] [], + name: CssIdentifier { + value_token: IDENT@90..100 "global-var" [] [], + }, + }, + colon_token: COLON@100..102 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@102..111 "modified" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@111..112 "!" [] [], + value: GLOBAL_KW@112..118 "global" [] [], + }, + ], + semicolon_token: SEMICOLON@118..119 ";" [] [], + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@119..144 "$" [Newline("\n"), Newline("\n"), Whitespace(" "), Comments("// Combined flags"), Newline("\n"), Whitespace(" ")] [], + name: CssIdentifier { + value_token: IDENT@144..155 "another-var" [] [], + }, + }, + colon_token: COLON@155..157 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@157..163 "value" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@163..164 "!" [] [], + value: DEFAULT_KW@164..172 "default" [] [Whitespace(" ")], + }, + ScssVariableModifier { + excl_token: BANG@172..173 "!" [] [], + value: GLOBAL_KW@173..179 "global" [] [], + }, + ], + semicolon_token: SEMICOLON@179..180 ";" [] [], + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@180..184 "$" [Newline("\n"), Whitespace(" ")] [], + name: CssIdentifier { + value_token: IDENT@184..193 "third-var" [] [], + }, + }, + colon_token: COLON@193..195 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@195..201 "value" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@201..202 "!" [] [], + value: GLOBAL_KW@202..209 "global" [] [Whitespace(" ")], + }, + ScssVariableModifier { + excl_token: BANG@209..210 "!" [] [], + value: DEFAULT_KW@210..217 "default" [] [], + }, + ], + semicolon_token: SEMICOLON@217..218 ";" [] [], + }, + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@218..227 "color" [Newline("\n"), Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@227..229 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + ScssIdentifier { + dollar_token: DOLLAR@229..230 "$" [] [], + name: CssIdentifier { + value_token: IDENT@230..240 "global-var" [] [], + }, + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@240..241 ";" [] [], + }, + ], + r_curly_token: R_CURLY@241..243 "}" [Newline("\n")] [], + }, + }, + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@243..295 "." [Newline("\n"), Newline("\n"), Comments("// Global flag with i ..."), Newline("\n")] [], + name: CssCustomIdentifier { + value_token: IDENT@295..310 "important-test" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@310..311 "{" [] [], + items: CssDeclarationOrRuleList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@311..315 "$" [Newline("\n"), Whitespace(" ")] [], + name: CssIdentifier { + value_token: IDENT@315..328 "important-var" [] [], + }, + }, + colon_token: COLON@328..330 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@330..334 "red" [] [Whitespace(" ")], + }, + ], + modifiers: ScssVariableModifierList [ + ScssVariableModifier { + excl_token: BANG@334..335 "!" [] [], + value: GLOBAL_KW@335..341 "global" [] [], + }, + ], + semicolon_token: SEMICOLON@341..342 ";" [] [], + }, + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@342..350 "color" [Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@350..352 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + ScssIdentifier { + dollar_token: DOLLAR@352..353 "$" [] [], + name: CssIdentifier { + value_token: IDENT@353..367 "important-var" [] [Whitespace(" ")], + }, + }, + ], + }, + important: CssDeclarationImportant { + excl_token: BANG@367..368 "!" [] [], + important_token: IMPORTANT_KW@368..377 "important" [] [], + }, + }, + semicolon_token: SEMICOLON@377..378 ";" [] [], + }, + ], + r_curly_token: R_CURLY@378..380 "}" [Newline("\n")] [], + }, + }, + ], + eof_token: EOF@380..381 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..381 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..380 + 0: SCSS_DECLARATION@0..42 + 0: SCSS_IDENTIFIER@0..32 + 0: DOLLAR@0..22 "$" [Comments("// Global flag usage"), Newline("\n")] [] + 1: CSS_IDENTIFIER@22..32 + 0: IDENT@22..32 "global-var" [] [] + 1: COLON@32..34 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@34..41 + 0: CSS_IDENTIFIER@34..41 + 0: IDENT@34..41 "initial" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@41..41 + 4: SEMICOLON@41..42 ";" [] [] + 1: CSS_QUALIFIED_RULE@42..243 + 0: CSS_SELECTOR_LIST@42..55 + 0: CSS_COMPOUND_SELECTOR@42..55 + 0: CSS_NESTED_SELECTOR_LIST@42..42 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@42..55 + 0: CSS_CLASS_SELECTOR@42..55 + 0: DOT@42..45 "." [Newline("\n"), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@45..55 + 0: IDENT@45..55 "component" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@55..243 + 0: L_CURLY@55..56 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@56..241 + 0: SCSS_DECLARATION@56..119 + 0: SCSS_IDENTIFIER@56..100 + 0: DOLLAR@56..90 "$" [Newline("\n"), Whitespace(" "), Comments("// Override global va ..."), Newline("\n"), Whitespace(" ")] [] + 1: CSS_IDENTIFIER@90..100 + 0: IDENT@90..100 "global-var" [] [] + 1: COLON@100..102 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@102..111 + 0: CSS_IDENTIFIER@102..111 + 0: IDENT@102..111 "modified" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@111..118 + 0: SCSS_VARIABLE_MODIFIER@111..118 + 0: BANG@111..112 "!" [] [] + 1: GLOBAL_KW@112..118 "global" [] [] + 4: SEMICOLON@118..119 ";" [] [] + 1: SCSS_DECLARATION@119..180 + 0: SCSS_IDENTIFIER@119..155 + 0: DOLLAR@119..144 "$" [Newline("\n"), Newline("\n"), Whitespace(" "), Comments("// Combined flags"), Newline("\n"), Whitespace(" ")] [] + 1: CSS_IDENTIFIER@144..155 + 0: IDENT@144..155 "another-var" [] [] + 1: COLON@155..157 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@157..163 + 0: CSS_IDENTIFIER@157..163 + 0: IDENT@157..163 "value" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@163..179 + 0: SCSS_VARIABLE_MODIFIER@163..172 + 0: BANG@163..164 "!" [] [] + 1: DEFAULT_KW@164..172 "default" [] [Whitespace(" ")] + 1: SCSS_VARIABLE_MODIFIER@172..179 + 0: BANG@172..173 "!" [] [] + 1: GLOBAL_KW@173..179 "global" [] [] + 4: SEMICOLON@179..180 ";" [] [] + 2: SCSS_DECLARATION@180..218 + 0: SCSS_IDENTIFIER@180..193 + 0: DOLLAR@180..184 "$" [Newline("\n"), Whitespace(" ")] [] + 1: CSS_IDENTIFIER@184..193 + 0: IDENT@184..193 "third-var" [] [] + 1: COLON@193..195 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@195..201 + 0: CSS_IDENTIFIER@195..201 + 0: IDENT@195..201 "value" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@201..217 + 0: SCSS_VARIABLE_MODIFIER@201..209 + 0: BANG@201..202 "!" [] [] + 1: GLOBAL_KW@202..209 "global" [] [Whitespace(" ")] + 1: SCSS_VARIABLE_MODIFIER@209..217 + 0: BANG@209..210 "!" [] [] + 1: DEFAULT_KW@210..217 "default" [] [] + 4: SEMICOLON@217..218 ";" [] [] + 3: CSS_DECLARATION_WITH_SEMICOLON@218..241 + 0: CSS_DECLARATION@218..240 + 0: CSS_GENERIC_PROPERTY@218..240 + 0: CSS_IDENTIFIER@218..227 + 0: IDENT@218..227 "color" [Newline("\n"), Newline("\n"), Whitespace(" ")] [] + 1: COLON@227..229 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@229..240 + 0: SCSS_IDENTIFIER@229..240 + 0: DOLLAR@229..230 "$" [] [] + 1: CSS_IDENTIFIER@230..240 + 0: IDENT@230..240 "global-var" [] [] + 1: (empty) + 1: SEMICOLON@240..241 ";" [] [] + 2: R_CURLY@241..243 "}" [Newline("\n")] [] + 2: CSS_QUALIFIED_RULE@243..380 + 0: CSS_SELECTOR_LIST@243..310 + 0: CSS_COMPOUND_SELECTOR@243..310 + 0: CSS_NESTED_SELECTOR_LIST@243..243 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@243..310 + 0: CSS_CLASS_SELECTOR@243..310 + 0: DOT@243..295 "." [Newline("\n"), Newline("\n"), Comments("// Global flag with i ..."), Newline("\n")] [] + 1: CSS_CUSTOM_IDENTIFIER@295..310 + 0: IDENT@295..310 "important-test" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@310..380 + 0: L_CURLY@310..311 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@311..378 + 0: SCSS_DECLARATION@311..342 + 0: SCSS_IDENTIFIER@311..328 + 0: DOLLAR@311..315 "$" [Newline("\n"), Whitespace(" ")] [] + 1: CSS_IDENTIFIER@315..328 + 0: IDENT@315..328 "important-var" [] [] + 1: COLON@328..330 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@330..334 + 0: CSS_IDENTIFIER@330..334 + 0: IDENT@330..334 "red" [] [Whitespace(" ")] + 3: SCSS_VARIABLE_MODIFIER_LIST@334..341 + 0: SCSS_VARIABLE_MODIFIER@334..341 + 0: BANG@334..335 "!" [] [] + 1: GLOBAL_KW@335..341 "global" [] [] + 4: SEMICOLON@341..342 ";" [] [] + 1: CSS_DECLARATION_WITH_SEMICOLON@342..378 + 0: CSS_DECLARATION@342..377 + 0: CSS_GENERIC_PROPERTY@342..367 + 0: CSS_IDENTIFIER@342..350 + 0: IDENT@342..350 "color" [Newline("\n"), Whitespace(" ")] [] + 1: COLON@350..352 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@352..367 + 0: SCSS_IDENTIFIER@352..367 + 0: DOLLAR@352..353 "$" [] [] + 1: CSS_IDENTIFIER@353..367 + 0: IDENT@353..367 "important-var" [] [Whitespace(" ")] + 1: CSS_DECLARATION_IMPORTANT@367..377 + 0: BANG@367..368 "!" [] [] + 1: IMPORTANT_KW@368..377 "important" [] [] + 1: SEMICOLON@377..378 ";" [] [] + 2: R_CURLY@378..380 "}" [Newline("\n")] [] + 2: EOF@380..381 "" [Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/important.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/important.scss new file mode 100644 index 000000000000..9f6f44b42450 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/important.scss @@ -0,0 +1,3 @@ +a { + padding: 1px !important; +} diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/important.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/important.scss.snap new file mode 100644 index 000000000000..6cb366938b8d --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/important.scss.snap @@ -0,0 +1,102 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +a { + padding: 1px !important; +} + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: CssTypeSelector { + namespace: missing (optional), + ident: CssIdentifier { + value_token: IDENT@0..2 "a" [] [Whitespace(" ")], + }, + }, + sub_selectors: CssSubSelectorList [], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@2..3 "{" [] [], + items: CssDeclarationOrRuleList [ + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@3..13 "padding" [Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@13..15 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@15..16 "1" [] [], + unit_token: IDENT@16..19 "px" [] [Whitespace(" ")], + }, + ], + }, + important: CssDeclarationImportant { + excl_token: BANG@19..20 "!" [] [], + important_token: IMPORTANT_KW@20..29 "important" [] [], + }, + }, + semicolon_token: SEMICOLON@29..30 ";" [] [], + }, + ], + r_curly_token: R_CURLY@30..32 "}" [Newline("\n")] [], + }, + }, + ], + eof_token: EOF@32..33 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..33 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..32 + 0: CSS_QUALIFIED_RULE@0..32 + 0: CSS_SELECTOR_LIST@0..2 + 0: CSS_COMPOUND_SELECTOR@0..2 + 0: CSS_NESTED_SELECTOR_LIST@0..0 + 1: CSS_TYPE_SELECTOR@0..2 + 0: (empty) + 1: CSS_IDENTIFIER@0..2 + 0: IDENT@0..2 "a" [] [Whitespace(" ")] + 2: CSS_SUB_SELECTOR_LIST@2..2 + 1: CSS_DECLARATION_OR_RULE_BLOCK@2..32 + 0: L_CURLY@2..3 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@3..30 + 0: CSS_DECLARATION_WITH_SEMICOLON@3..30 + 0: CSS_DECLARATION@3..29 + 0: CSS_GENERIC_PROPERTY@3..19 + 0: CSS_IDENTIFIER@3..13 + 0: IDENT@3..13 "padding" [Newline("\n"), Whitespace(" ")] [] + 1: COLON@13..15 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@15..19 + 0: CSS_REGULAR_DIMENSION@15..19 + 0: CSS_NUMBER_LITERAL@15..16 "1" [] [] + 1: IDENT@16..19 "px" [] [Whitespace(" ")] + 1: CSS_DECLARATION_IMPORTANT@19..29 + 0: BANG@19..20 "!" [] [] + 1: IMPORTANT_KW@20..29 "important" [] [] + 1: SEMICOLON@29..30 ";" [] [] + 2: R_CURLY@30..32 "}" [Newline("\n")] [] + 2: EOF@32..33 "" [Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss new file mode 100644 index 000000000000..1506cc1dd155 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss @@ -0,0 +1,2 @@ +ns.$var: value; + diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss.snap new file mode 100644 index 000000000000..60be8b9fad9f --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss.snap @@ -0,0 +1,70 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +ns.$var: value; + + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + ScssDeclaration { + name: ScssNamespacedIdentifier { + namespace: CssIdentifier { + value_token: IDENT@0..2 "ns" [] [], + }, + dot_token: DOT@2..3 "." [] [], + name: ScssIdentifier { + dollar_token: DOLLAR@3..4 "$" [] [], + name: CssIdentifier { + value_token: IDENT@4..7 "var" [] [], + }, + }, + }, + colon_token: COLON@7..9 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@9..14 "value" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@14..15 ";" [] [], + }, + ], + eof_token: EOF@15..17 "" [Newline("\n"), Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..17 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..15 + 0: SCSS_DECLARATION@0..15 + 0: SCSS_NAMESPACED_IDENTIFIER@0..7 + 0: CSS_IDENTIFIER@0..2 + 0: IDENT@0..2 "ns" [] [] + 1: DOT@2..3 "." [] [] + 2: SCSS_IDENTIFIER@3..7 + 0: DOLLAR@3..4 "$" [] [] + 1: CSS_IDENTIFIER@4..7 + 0: IDENT@4..7 "var" [] [] + 1: COLON@7..9 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@9..14 + 0: CSS_IDENTIFIER@9..14 + 0: IDENT@9..14 "value" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@14..14 + 4: SEMICOLON@14..15 ";" [] [] + 2: EOF@15..17 "" [Newline("\n"), Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss new file mode 100644 index 000000000000..9894838a0973 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss @@ -0,0 +1,4 @@ +.button { + $padding: 12px; + padding: $padding; +} diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss.snap new file mode 100644 index 000000000000..1497e5f42298 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss.snap @@ -0,0 +1,133 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +.button { + $padding: 12px; + padding: $padding; +} + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + CssQualifiedRule { + prelude: CssSelectorList [ + CssCompoundSelector { + nesting_selectors: CssNestedSelectorList [], + simple_selector: missing (optional), + sub_selectors: CssSubSelectorList [ + CssClassSelector { + dot_token: DOT@0..1 "." [] [], + name: CssCustomIdentifier { + value_token: IDENT@1..8 "button" [] [Whitespace(" ")], + }, + }, + ], + }, + ], + block: CssDeclarationOrRuleBlock { + l_curly_token: L_CURLY@8..9 "{" [] [], + items: CssDeclarationOrRuleList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@9..13 "$" [Newline("\n"), Whitespace(" ")] [], + name: CssIdentifier { + value_token: IDENT@13..20 "padding" [] [], + }, + }, + colon_token: COLON@20..22 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@22..24 "12" [] [], + unit_token: IDENT@24..26 "px" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@26..27 ";" [] [], + }, + CssDeclarationWithSemicolon { + declaration: CssDeclaration { + property: CssGenericProperty { + name: CssIdentifier { + value_token: IDENT@27..37 "padding" [Newline("\n"), Whitespace(" ")] [], + }, + colon_token: COLON@37..39 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + ScssIdentifier { + dollar_token: DOLLAR@39..40 "$" [] [], + name: CssIdentifier { + value_token: IDENT@40..47 "padding" [] [], + }, + }, + ], + }, + important: missing (optional), + }, + semicolon_token: SEMICOLON@47..48 ";" [] [], + }, + ], + r_curly_token: R_CURLY@48..50 "}" [Newline("\n")] [], + }, + }, + ], + eof_token: EOF@50..51 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..51 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..50 + 0: CSS_QUALIFIED_RULE@0..50 + 0: CSS_SELECTOR_LIST@0..8 + 0: CSS_COMPOUND_SELECTOR@0..8 + 0: CSS_NESTED_SELECTOR_LIST@0..0 + 1: (empty) + 2: CSS_SUB_SELECTOR_LIST@0..8 + 0: CSS_CLASS_SELECTOR@0..8 + 0: DOT@0..1 "." [] [] + 1: CSS_CUSTOM_IDENTIFIER@1..8 + 0: IDENT@1..8 "button" [] [Whitespace(" ")] + 1: CSS_DECLARATION_OR_RULE_BLOCK@8..50 + 0: L_CURLY@8..9 "{" [] [] + 1: CSS_DECLARATION_OR_RULE_LIST@9..48 + 0: SCSS_DECLARATION@9..27 + 0: SCSS_IDENTIFIER@9..20 + 0: DOLLAR@9..13 "$" [Newline("\n"), Whitespace(" ")] [] + 1: CSS_IDENTIFIER@13..20 + 0: IDENT@13..20 "padding" [] [] + 1: COLON@20..22 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@22..26 + 0: CSS_REGULAR_DIMENSION@22..26 + 0: CSS_NUMBER_LITERAL@22..24 "12" [] [] + 1: IDENT@24..26 "px" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@26..26 + 4: SEMICOLON@26..27 ";" [] [] + 1: CSS_DECLARATION_WITH_SEMICOLON@27..48 + 0: CSS_DECLARATION@27..47 + 0: CSS_GENERIC_PROPERTY@27..47 + 0: CSS_IDENTIFIER@27..37 + 0: IDENT@27..37 "padding" [Newline("\n"), Whitespace(" ")] [] + 1: COLON@37..39 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@39..47 + 0: SCSS_IDENTIFIER@39..47 + 0: DOLLAR@39..40 "$" [] [] + 1: CSS_IDENTIFIER@40..47 + 0: IDENT@40..47 "padding" [] [] + 1: (empty) + 1: SEMICOLON@47..48 ";" [] [] + 2: R_CURLY@48..50 "}" [Newline("\n")] [] + 2: EOF@50..51 "" [Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss new file mode 100644 index 000000000000..e79188716117 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss @@ -0,0 +1,2 @@ +$color: red; +$size: 10px diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss.snap b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss.snap new file mode 100644 index 000000000000..950d4cc7ccd2 --- /dev/null +++ b/crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss.snap @@ -0,0 +1,89 @@ +--- +source: crates/biome_css_parser/tests/spec_test.rs +expression: snapshot +--- +## Input + +```css +$color: red; +$size: 10px + +``` + + +## AST + +``` +CssRoot { + bom_token: missing (optional), + items: CssRootItemList [ + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@0..1 "$" [] [], + name: CssIdentifier { + value_token: IDENT@1..6 "color" [] [], + }, + }, + colon_token: COLON@6..8 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssIdentifier { + value_token: IDENT@8..11 "red" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: SEMICOLON@11..12 ";" [] [], + }, + ScssDeclaration { + name: ScssIdentifier { + dollar_token: DOLLAR@12..14 "$" [Newline("\n")] [], + name: CssIdentifier { + value_token: IDENT@14..18 "size" [] [], + }, + }, + colon_token: COLON@18..20 ":" [] [Whitespace(" ")], + value: CssGenericComponentValueList [ + CssRegularDimension { + value_token: CSS_NUMBER_LITERAL@20..22 "10" [] [], + unit_token: IDENT@22..24 "px" [] [], + }, + ], + modifiers: ScssVariableModifierList [], + semicolon_token: missing (optional), + }, + ], + eof_token: EOF@24..25 "" [Newline("\n")] [], +} +``` + +## CST + +``` +0: CSS_ROOT@0..25 + 0: (empty) + 1: CSS_ROOT_ITEM_LIST@0..24 + 0: SCSS_DECLARATION@0..12 + 0: SCSS_IDENTIFIER@0..6 + 0: DOLLAR@0..1 "$" [] [] + 1: CSS_IDENTIFIER@1..6 + 0: IDENT@1..6 "color" [] [] + 1: COLON@6..8 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@8..11 + 0: CSS_IDENTIFIER@8..11 + 0: IDENT@8..11 "red" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@11..11 + 4: SEMICOLON@11..12 ";" [] [] + 1: SCSS_DECLARATION@12..24 + 0: SCSS_IDENTIFIER@12..18 + 0: DOLLAR@12..14 "$" [Newline("\n")] [] + 1: CSS_IDENTIFIER@14..18 + 0: IDENT@14..18 "size" [] [] + 1: COLON@18..20 ":" [] [Whitespace(" ")] + 2: CSS_GENERIC_COMPONENT_VALUE_LIST@20..24 + 0: CSS_REGULAR_DIMENSION@20..24 + 0: CSS_NUMBER_LITERAL@20..22 "10" [] [] + 1: IDENT@22..24 "px" [] [] + 3: SCSS_VARIABLE_MODIFIER_LIST@24..24 + 4: (empty) + 2: EOF@24..25 "" [Newline("\n")] [] + +``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/attribute.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/attribute.css.snap index eef26270cbf3..931e603b0e94 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/attribute.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/attribute.css.snap @@ -62,7 +62,7 @@ a[href='te"s"t'] {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -1681,7 +1681,7 @@ CssRoot { ``` 0: CSS_ROOT@0..953 0: (empty) - 1: CSS_RULE_LIST@0..952 + 1: CSS_ROOT_ITEM_LIST@0..952 0: CSS_QUALIFIED_RULE@0..10 0: CSS_SELECTOR_LIST@0..8 0: CSS_COMPOUND_SELECTOR@0..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/class.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/class.css.snap index ff6d04e033fd..c0a577c59e39 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/class.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/class.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -75,7 +75,7 @@ CssRoot { ``` 0: CSS_ROOT@0..34 0: (empty) - 1: CSS_RULE_LIST@0..33 + 1: CSS_ROOT_ITEM_LIST@0..33 0: CSS_QUALIFIED_RULE@0..33 0: CSS_SELECTOR_LIST@0..29 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/complex.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/complex.css.snap index ee7018bc9e93..8dcbbb745d49 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/complex.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/complex.css.snap @@ -51,7 +51,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -661,7 +661,7 @@ CssRoot { ``` 0: CSS_ROOT@0..299 0: (empty) - 1: CSS_RULE_LIST@0..298 + 1: CSS_ROOT_ITEM_LIST@0..298 0: CSS_QUALIFIED_RULE@0..14 0: CSS_SELECTOR_LIST@0..12 0: CSS_COMPLEX_SELECTOR@0..12 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/id.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/id.css.snap index a6f40464fec9..1885662d94c7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/id.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/id.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -75,7 +75,7 @@ CssRoot { ``` 0: CSS_ROOT@0..34 0: (empty) - 1: CSS_RULE_LIST@0..33 + 1: CSS_ROOT_ITEM_LIST@0..33 0: CSS_QUALIFIED_RULE@0..33 0: CSS_SELECTOR_LIST@0..29 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_an_plus_b.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_an_plus_b.css.snap index 9cf5b8abb256..600bb8c408e6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_an_plus_b.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_an_plus_b.css.snap @@ -122,7 +122,7 @@ tr:nth-child(even of :not([hidden])) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -4103,7 +4103,7 @@ CssRoot { ``` 0: CSS_ROOT@0..2195 0: (empty) - 1: CSS_RULE_LIST@0..2194 + 1: CSS_ROOT_ITEM_LIST@0..2194 0: CSS_QUALIFIED_RULE@0..19 0: CSS_SELECTOR_LIST@0..17 0: CSS_COMPOUND_SELECTOR@0..17 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_any.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_any.css.snap index e6f559cf2e96..2d28c8c61099 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_any.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_any.css.snap @@ -32,7 +32,7 @@ h1:-webkit-any(.h1class, #bar) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -964,7 +964,7 @@ CssRoot { ``` 0: CSS_ROOT@0..554 0: (empty) - 1: CSS_RULE_LIST@0..553 + 1: CSS_ROOT_ITEM_LIST@0..553 0: CSS_QUALIFIED_RULE@0..25 0: CSS_SELECTOR_LIST@0..23 0: CSS_COMPOUND_SELECTOR@0..23 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_basic.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_basic.css.snap index 560ddbec84b4..2df5e9fcb4d0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_basic.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_basic.css.snap @@ -33,7 +33,7 @@ a:hOvEr {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -805,7 +805,7 @@ CssRoot { ``` 0: CSS_ROOT@0..490 0: (empty) - 1: CSS_RULE_LIST@0..489 + 1: CSS_ROOT_ITEM_LIST@0..489 0: CSS_QUALIFIED_RULE@0..8 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_current.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_current.css.snap index 2c68cfe3d61f..1b6307c2663d 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_current.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_current.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -182,7 +182,7 @@ CssRoot { ``` 0: CSS_ROOT@0..59 0: (empty) - 1: CSS_RULE_LIST@0..58 + 1: CSS_ROOT_ITEM_LIST@0..58 0: CSS_QUALIFIED_RULE@0..26 0: CSS_SELECTOR_LIST@0..24 0: CSS_COMPOUND_SELECTOR@0..24 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_dir.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_dir.css.snap index 9437c913efcf..9678c33d8984 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_dir.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_dir.css.snap @@ -20,7 +20,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -214,7 +214,7 @@ CssRoot { ``` 0: CSS_ROOT@0..101 0: (empty) - 1: CSS_RULE_LIST@0..100 + 1: CSS_ROOT_ITEM_LIST@0..100 0: CSS_QUALIFIED_RULE@0..12 0: CSS_SELECTOR_LIST@0..10 0: CSS_COMPOUND_SELECTOR@0..10 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier.css.snap index 4707b0392912..f5195803e525 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier.css.snap @@ -17,7 +17,7 @@ custom-selector::part(checkbox):state(checked) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -161,7 +161,7 @@ CssRoot { ``` 0: CSS_ROOT@0..118 0: (empty) - 1: CSS_RULE_LIST@0..117 + 1: CSS_ROOT_ITEM_LIST@0..117 0: CSS_QUALIFIED_RULE@0..33 0: CSS_SELECTOR_LIST@0..31 0: CSS_COMPOUND_SELECTOR@0..31 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier_list.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier_list.css.snap index 82ebba3095a0..f2bd17c8ffb0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier_list.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_function_custom_identifier_list.css.snap @@ -16,7 +16,7 @@ html:active-view-transition-type(backwards, forwards, backwards, forwards) { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -74,7 +74,7 @@ CssRoot { ``` 0: CSS_ROOT@0..79 0: (empty) - 1: CSS_RULE_LIST@0..78 + 1: CSS_ROOT_ITEM_LIST@0..78 0: CSS_QUALIFIED_RULE@0..78 0: CSS_SELECTOR_LIST@0..75 0: CSS_COMPOUND_SELECTOR@0..75 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_future.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_future.css.snap index a578b42649b5..f5d95b573814 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_future.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_future.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -182,7 +182,7 @@ CssRoot { ``` 0: CSS_ROOT@0..57 0: (empty) - 1: CSS_RULE_LIST@0..56 + 1: CSS_ROOT_ITEM_LIST@0..56 0: CSS_QUALIFIED_RULE@0..25 0: CSS_SELECTOR_LIST@0..23 0: CSS_COMPOUND_SELECTOR@0..23 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_has.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_has.css.snap index 43577ab828fc..52db069205c2 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_has.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_has.css.snap @@ -25,7 +25,7 @@ a:has(> img) .div {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -762,7 +762,7 @@ CssRoot { ``` 0: CSS_ROOT@0..304 0: (empty) - 1: CSS_RULE_LIST@0..303 + 1: CSS_ROOT_ITEM_LIST@0..303 0: CSS_QUALIFIED_RULE@0..15 0: CSS_SELECTOR_LIST@0..13 0: CSS_COMPOUND_SELECTOR@0..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host.css.snap index 51aab80b2f32..d5e6112718bf 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -216,7 +216,7 @@ CssRoot { ``` 0: CSS_ROOT@0..124 0: (empty) - 1: CSS_RULE_LIST@0..123 + 1: CSS_ROOT_ITEM_LIST@0..123 0: CSS_QUALIFIED_RULE@0..33 0: CSS_SELECTOR_LIST@0..31 0: CSS_COMPOUND_SELECTOR@0..31 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host_context.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host_context.css.snap index e595ab295b77..b19ddb8615a3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host_context.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_host_context.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -148,7 +148,7 @@ CssRoot { ``` 0: CSS_ROOT@0..74 0: (empty) - 1: CSS_RULE_LIST@0..73 + 1: CSS_ROOT_ITEM_LIST@0..73 0: CSS_QUALIFIED_RULE@0..20 0: CSS_SELECTOR_LIST@0..18 0: CSS_COMPOUND_SELECTOR@0..18 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_ident.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_ident.css.snap index f5c2414404b2..97d3a2a2d07a 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_ident.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_ident.css.snap @@ -22,7 +22,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -217,7 +217,7 @@ CssRoot { ``` 0: CSS_ROOT@0..101 0: (empty) - 1: CSS_RULE_LIST@0..100 + 1: CSS_ROOT_ITEM_LIST@0..100 0: CSS_QUALIFIED_RULE@0..17 0: CSS_SELECTOR_LIST@0..15 0: CSS_COMPOUND_SELECTOR@0..15 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_is.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_is.css.snap index 9e8bd16ff0f5..9e37d2afe0fa 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_is.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_is.css.snap @@ -30,7 +30,7 @@ a:is(:not(:hover)) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -1339,7 +1339,7 @@ CssRoot { ``` 0: CSS_ROOT@0..552 0: (empty) - 1: CSS_RULE_LIST@0..551 + 1: CSS_ROOT_ITEM_LIST@0..551 0: CSS_QUALIFIED_RULE@0..13 0: CSS_SELECTOR_LIST@0..11 0: CSS_COMPLEX_SELECTOR@0..11 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_lang.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_lang.css.snap index a72c33ef4326..b989b8650fcb 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_lang.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_lang.css.snap @@ -22,7 +22,7 @@ html:lang(de, fr) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -333,7 +333,7 @@ CssRoot { ``` 0: CSS_ROOT@0..155 0: (empty) - 1: CSS_RULE_LIST@0..154 + 1: CSS_ROOT_ITEM_LIST@0..154 0: CSS_QUALIFIED_RULE@0..17 0: CSS_SELECTOR_LIST@0..15 0: CSS_COMPOUND_SELECTOR@0..15 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_matches.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_matches.css.snap index ede36708cfde..41d8b107925e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_matches.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_matches.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -138,7 +138,7 @@ CssRoot { ``` 0: CSS_ROOT@0..42 0: (empty) - 1: CSS_RULE_LIST@0..41 + 1: CSS_ROOT_ITEM_LIST@0..41 0: CSS_QUALIFIED_RULE@0..18 0: CSS_SELECTOR_LIST@0..16 0: CSS_COMPLEX_SELECTOR@0..16 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module/pseudo_class_module.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module/pseudo_class_module.css.snap index c8647fdc2001..8c2d3c862404 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module/pseudo_class_module.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module/pseudo_class_module.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -208,7 +208,7 @@ CssRoot { ``` 0: CSS_ROOT@0..79 0: (empty) - 1: CSS_RULE_LIST@0..78 + 1: CSS_ROOT_ITEM_LIST@0..78 0: CSS_QUALIFIED_RULE@0..22 0: CSS_SELECTOR_LIST@0..20 0: CSS_COMPOUND_SELECTOR@0..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_not.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_not.css.snap index e8897db14e2c..e11fa618e679 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_not.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_not.css.snap @@ -40,7 +40,7 @@ ul li:not(:first-of-type) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -1462,7 +1462,7 @@ CssRoot { ``` 0: CSS_ROOT@0..589 0: (empty) - 1: CSS_RULE_LIST@0..588 + 1: CSS_ROOT_ITEM_LIST@0..588 0: CSS_QUALIFIED_RULE@0..10 0: CSS_SELECTOR_LIST@0..8 0: CSS_COMPOUND_SELECTOR@0..8 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_past.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_past.css.snap index 49ec65d1d8c4..4432ecc4fe9b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_past.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_past.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -182,7 +182,7 @@ CssRoot { ``` 0: CSS_ROOT@0..53 0: (empty) - 1: CSS_RULE_LIST@0..52 + 1: CSS_ROOT_ITEM_LIST@0..52 0: CSS_QUALIFIED_RULE@0..23 0: CSS_SELECTOR_LIST@0..21 0: CSS_COMPOUND_SELECTOR@0..21 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_state.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_state.css.snap index 4707b0392912..f5195803e525 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_state.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_state.css.snap @@ -17,7 +17,7 @@ custom-selector::part(checkbox):state(checked) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -161,7 +161,7 @@ CssRoot { ``` 0: CSS_ROOT@0..118 0: (empty) - 1: CSS_RULE_LIST@0..117 + 1: CSS_ROOT_ITEM_LIST@0..117 0: CSS_QUALIFIED_RULE@0..33 0: CSS_SELECTOR_LIST@0..31 0: CSS_COMPOUND_SELECTOR@0..31 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_where.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_where.css.snap index 859d33bd6b35..832c0b17ea35 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_where.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_where.css.snap @@ -25,7 +25,7 @@ a:where(:not(:hover)) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -854,7 +854,7 @@ CssRoot { ``` 0: CSS_ROOT@0..361 0: (empty) - 1: CSS_RULE_LIST@0..360 + 1: CSS_ROOT_ITEM_LIST@0..360 0: CSS_QUALIFIED_RULE@0..16 0: CSS_SELECTOR_LIST@0..14 0: CSS_COMPLEX_SELECTOR@0..14 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/basic.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/basic.css.snap index 2265c35f9b53..a281b34ede24 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/basic.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/basic.css.snap @@ -48,7 +48,7 @@ a, b > .foo::before {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -647,7 +647,7 @@ CssRoot { ``` 0: CSS_ROOT@0..393 0: (empty) - 1: CSS_RULE_LIST@0..392 + 1: CSS_ROOT_ITEM_LIST@0..392 0: CSS_QUALIFIED_RULE@0..11 0: CSS_SELECTOR_LIST@0..9 0: CSS_COMPOUND_SELECTOR@0..9 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue-region.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue-region.css.snap index 2ba082a913bb..1f0fdfa04b82 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue-region.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue-region.css.snap @@ -17,7 +17,7 @@ video::cue-region( #scroll ) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -140,7 +140,7 @@ CssRoot { ``` 0: CSS_ROOT@0..87 0: (empty) - 1: CSS_RULE_LIST@0..86 + 1: CSS_ROOT_ITEM_LIST@0..86 0: CSS_QUALIFIED_RULE@0..20 0: CSS_SELECTOR_LIST@0..18 0: CSS_COMPOUND_SELECTOR@0..18 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue.css.snap index 95999ca64c90..cc9d592a7fb4 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/cue.css.snap @@ -20,7 +20,7 @@ video::cue(#cue1) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -274,7 +274,7 @@ CssRoot { ``` 0: CSS_ROOT@0..119 0: (empty) - 1: CSS_RULE_LIST@0..118 + 1: CSS_ROOT_ITEM_LIST@0..118 0: CSS_QUALIFIED_RULE@0..8 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..6 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/escaped.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/escaped.css.snap index 1534e5cafd41..839ccdc7a531 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/escaped.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/escaped.css.snap @@ -15,7 +15,7 @@ div::bef\ore {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -54,7 +54,7 @@ CssRoot { ``` 0: CSS_ROOT@0..16 0: (empty) - 1: CSS_RULE_LIST@0..15 + 1: CSS_ROOT_ITEM_LIST@0..15 0: CSS_QUALIFIED_RULE@0..15 0: CSS_SELECTOR_LIST@0..13 0: CSS_COMPOUND_SELECTOR@0..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/highlight.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/highlight.css.snap index 7dfdc8bb6bc8..41cb77058d61 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/highlight.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/highlight.css.snap @@ -22,7 +22,7 @@ div::highlight(foo) { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -127,7 +127,7 @@ CssRoot { ``` 0: CSS_ROOT@0..74 0: (empty) - 1: CSS_RULE_LIST@0..73 + 1: CSS_ROOT_ITEM_LIST@0..73 0: CSS_QUALIFIED_RULE@0..23 0: CSS_SELECTOR_LIST@0..20 0: CSS_COMPOUND_SELECTOR@0..20 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/part.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/part.css.snap index 575b2b5e7fb6..2ffa8c4b9a73 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/part.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/part.css.snap @@ -17,7 +17,7 @@ tabbed-custom-element::part(range-start range-end) {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -136,7 +136,7 @@ CssRoot { ``` 0: CSS_ROOT@0..138 0: (empty) - 1: CSS_RULE_LIST@0..137 + 1: CSS_ROOT_ITEM_LIST@0..137 0: CSS_QUALIFIED_RULE@0..38 0: CSS_SELECTOR_LIST@0..36 0: CSS_COMPOUND_SELECTOR@0..36 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/presudo_complex.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/presudo_complex.css.snap index 771ca2a8e25d..10e32603a5d7 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/presudo_complex.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/presudo_complex.css.snap @@ -20,7 +20,7 @@ video::cue(b) div {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssComplexSelector { @@ -309,7 +309,7 @@ CssRoot { ``` 0: CSS_ROOT@0..131 0: (empty) - 1: CSS_RULE_LIST@0..130 + 1: CSS_ROOT_ITEM_LIST@0..130 0: CSS_QUALIFIED_RULE@0..15 0: CSS_SELECTOR_LIST@0..13 0: CSS_COMPLEX_SELECTOR@0..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/slotted.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/slotted.css.snap index 2419d3005fc2..8ee17538ea34 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/slotted.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_element/slotted.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -168,7 +168,7 @@ CssRoot { ``` 0: CSS_ROOT@0..80 0: (empty) - 1: CSS_RULE_LIST@0..79 + 1: CSS_ROOT_ITEM_LIST@0..79 0: CSS_QUALIFIED_RULE@0..15 0: CSS_SELECTOR_LIST@0..13 0: CSS_COMPOUND_SELECTOR@0..13 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/subselector.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/subselector.css.snap index 3e54d498f355..71226c56ac9f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/subselector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/subselector.css.snap @@ -19,7 +19,7 @@ div.class.content#id#id, *.class.content#id#id1, .class.content#id#id1 {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -264,7 +264,7 @@ CssRoot { ``` 0: CSS_ROOT@0..153 0: (empty) - 1: CSS_RULE_LIST@0..152 + 1: CSS_ROOT_ITEM_LIST@0..152 0: CSS_QUALIFIED_RULE@0..26 0: CSS_SELECTOR_LIST@0..24 0: CSS_COMPOUND_SELECTOR@0..24 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/type.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/type.css.snap index 74a13ef27322..45be857e210b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/type.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/type.css.snap @@ -18,7 +18,7 @@ foo|h1 {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -131,7 +131,7 @@ CssRoot { ``` 0: CSS_ROOT@0..35 0: (empty) - 1: CSS_RULE_LIST@0..34 + 1: CSS_ROOT_ITEM_LIST@0..34 0: CSS_QUALIFIED_RULE@0..9 0: CSS_SELECTOR_LIST@0..7 0: CSS_COMPOUND_SELECTOR@0..3 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/universal.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/universal.css.snap index f9e533fb26b6..d24879d038ce 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/universal.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/universal.css.snap @@ -17,7 +17,7 @@ foo|* {} ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -100,7 +100,7 @@ CssRoot { ``` 0: CSS_ROOT@0..25 0: (empty) - 1: CSS_RULE_LIST@0..24 + 1: CSS_ROOT_ITEM_LIST@0..24 0: CSS_QUALIFIED_RULE@0..8 0: CSS_SELECTOR_LIST@0..6 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/snippet/eof_optional_semicolon.styled.css b/crates/biome_css_parser/tests/css_test_suite/ok/snippet/eof_optional_semicolon.styled.css deleted file mode 100644 index 1fdee7c93d52..000000000000 --- a/crates/biome_css_parser/tests/css_test_suite/ok/snippet/eof_optional_semicolon.styled.css +++ /dev/null @@ -1,3 +0,0 @@ -/* The last semicolon can be omitted when it's embedded in JS. */ -background-color: blue; -color: red diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/snippet/eof_optional_semicolon.styled.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/snippet/eof_optional_semicolon.styled.css.snap deleted file mode 100644 index 6a9b56fa9ec8..000000000000 --- a/crates/biome_css_parser/tests/css_test_suite/ok/snippet/eof_optional_semicolon.styled.css.snap +++ /dev/null @@ -1,88 +0,0 @@ ---- -source: crates/biome_css_parser/tests/spec_test.rs -expression: snapshot ---- -## Input - -```css -/* The last semicolon can be omitted when it's embedded in JS. */ -background-color: blue; -color: red - -``` - - -## AST - -``` -CssSnippetRoot { - items: CssDeclarationOrRuleList [ - CssDeclarationWithSemicolon { - declaration: CssDeclaration { - property: CssGenericProperty { - name: CssIdentifier { - value_token: IDENT@0..82 "background-color" [Comments("/* The last semicolon ..."), Newline("\n")] [], - }, - colon_token: COLON@82..84 ":" [] [Whitespace(" ")], - value: CssGenericComponentValueList [ - CssIdentifier { - value_token: IDENT@84..88 "blue" [] [], - }, - ], - }, - important: missing (optional), - }, - semicolon_token: SEMICOLON@88..89 ";" [] [], - }, - CssDeclarationWithSemicolon { - declaration: CssDeclaration { - property: CssGenericProperty { - name: CssIdentifier { - value_token: IDENT@89..95 "color" [Newline("\n")] [], - }, - colon_token: COLON@95..97 ":" [] [Whitespace(" ")], - value: CssGenericComponentValueList [ - CssIdentifier { - value_token: IDENT@97..100 "red" [] [], - }, - ], - }, - important: missing (optional), - }, - semicolon_token: missing (optional), - }, - ], - eof_token: EOF@100..101 "" [Newline("\n")] [], -} -``` - -## CST - -``` -0: CSS_SNIPPET_ROOT@0..101 - 0: CSS_DECLARATION_OR_RULE_LIST@0..100 - 0: CSS_DECLARATION_WITH_SEMICOLON@0..89 - 0: CSS_DECLARATION@0..88 - 0: CSS_GENERIC_PROPERTY@0..88 - 0: CSS_IDENTIFIER@0..82 - 0: IDENT@0..82 "background-color" [Comments("/* The last semicolon ..."), Newline("\n")] [] - 1: COLON@82..84 ":" [] [Whitespace(" ")] - 2: CSS_GENERIC_COMPONENT_VALUE_LIST@84..88 - 0: CSS_IDENTIFIER@84..88 - 0: IDENT@84..88 "blue" [] [] - 1: (empty) - 1: SEMICOLON@88..89 ";" [] [] - 1: CSS_DECLARATION_WITH_SEMICOLON@89..100 - 0: CSS_DECLARATION@89..100 - 0: CSS_GENERIC_PROPERTY@89..100 - 0: CSS_IDENTIFIER@89..95 - 0: IDENT@89..95 "color" [Newline("\n")] [] - 1: COLON@95..97 ":" [] [Whitespace(" ")] - 2: CSS_GENERIC_COMPONENT_VALUE_LIST@97..100 - 0: CSS_IDENTIFIER@97..100 - 0: IDENT@97..100 "red" [] [] - 1: (empty) - 1: (empty) - 1: EOF@100..101 "" [Newline("\n")] [] - -``` diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/alpha_function.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/alpha_function.css.snap index eda443a7f94d..bf3e71009fe1 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/alpha_function.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/alpha_function.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -198,7 +198,7 @@ CssRoot { ``` 0: CSS_ROOT@0..122 0: (empty) - 1: CSS_RULE_LIST@0..121 + 1: CSS_ROOT_ITEM_LIST@0..121 0: CSS_QUALIFIED_RULE@0..58 0: CSS_SELECTOR_LIST@0..18 0: CSS_COMPOUND_SELECTOR@0..18 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/apply.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/apply.css.snap index eebf3c529370..d013ed039196 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/apply.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/apply.css.snap @@ -45,7 +45,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..24 "@" [Comments("/* @apply directive */"), Newline("\n")] [], rule: TwApplyAtRule { @@ -242,7 +242,7 @@ CssRoot { ``` 0: CSS_ROOT@0..734 0: (empty) - 1: CSS_RULE_LIST@0..733 + 1: CSS_ROOT_ITEM_LIST@0..733 0: CSS_AT_RULE@0..48 0: AT@0..24 "@" [Comments("/* @apply directive */"), Newline("\n")] [] 1: TW_APPLY_AT_RULE@24..48 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/config.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/config.css.snap index bd841cec606f..12b097abc15f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/config.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/config.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwConfigAtRule { @@ -36,7 +36,7 @@ CssRoot { ``` 0: CSS_ROOT@0..32 0: (empty) - 1: CSS_RULE_LIST@0..31 + 1: CSS_ROOT_ITEM_LIST@0..31 0: CSS_AT_RULE@0..31 0: AT@0..1 "@" [] [] 1: TW_CONFIG_AT_RULE@1..31 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/block-slot.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/block-slot.css.snap index 1841f8b4e66c..be268417abd1 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/block-slot.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/block-slot.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwCustomVariantAtRule { @@ -120,7 +120,7 @@ CssRoot { ``` 0: CSS_ROOT@0..85 0: (empty) - 1: CSS_RULE_LIST@0..84 + 1: CSS_ROOT_ITEM_LIST@0..84 0: CSS_AT_RULE@0..84 0: AT@0..1 "@" [] [] 1: TW_CUSTOM_VARIANT_AT_RULE@1..84 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/dark.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/dark.css.snap index 9f42534937d2..6321a0f1e907 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/dark.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/dark.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwCustomVariantAtRule { @@ -87,7 +87,7 @@ CssRoot { ``` 0: CSS_ROOT@0..38 0: (empty) - 1: CSS_RULE_LIST@0..37 + 1: CSS_ROOT_ITEM_LIST@0..37 0: CSS_AT_RULE@0..37 0: AT@0..1 "@" [] [] 1: TW_CUSTOM_VARIANT_AT_RULE@1..37 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules-simple.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules-simple.css.snap index a215a61f9a22..f9436455ec7c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules-simple.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules-simple.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwCustomVariantAtRule { @@ -136,7 +136,7 @@ CssRoot { ``` 0: CSS_ROOT@0..141 0: (empty) - 1: CSS_RULE_LIST@0..140 + 1: CSS_ROOT_ITEM_LIST@0..140 0: CSS_AT_RULE@0..52 0: AT@0..1 "@" [] [] 1: TW_CUSTOM_VARIANT_AT_RULE@1..52 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules.css.snap index c92603c00988..f55d83788820 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules.css.snap @@ -77,7 +77,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwCustomVariantAtRule { @@ -2196,7 +2196,7 @@ CssRoot { ``` 0: CSS_ROOT@0..3777 0: (empty) - 1: CSS_RULE_LIST@0..3776 + 1: CSS_ROOT_ITEM_LIST@0..3776 0: CSS_AT_RULE@0..52 0: AT@0..1 "@" [] [] 1: TW_CUSTOM_VARIANT_AT_RULE@1..52 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-multiple-selectors.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-multiple-selectors.css.snap index b5e7e969f144..a3b0c41c52ba 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-multiple-selectors.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-multiple-selectors.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwCustomVariantAtRule { @@ -156,7 +156,7 @@ CssRoot { ``` 0: CSS_ROOT@0..83 0: (empty) - 1: CSS_RULE_LIST@0..82 + 1: CSS_ROOT_ITEM_LIST@0..82 0: CSS_AT_RULE@0..36 0: AT@0..1 "@" [] [] 1: TW_CUSTOM_VARIANT_AT_RULE@1..36 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand.css.snap index 2cc4cd17d60e..341bbafad8f8 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwCustomVariantAtRule { @@ -100,7 +100,7 @@ CssRoot { ``` 0: CSS_ROOT@0..69 0: (empty) - 1: CSS_RULE_LIST@0..68 + 1: CSS_ROOT_ITEM_LIST@0..68 0: CSS_AT_RULE@0..68 0: AT@0..1 "@" [] [] 1: TW_CUSTOM_VARIANT_AT_RULE@1..68 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css.snap index 0c1c58d8ea16..e74cb022aae3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options-2.css.snap @@ -30,7 +30,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwPluginAtRule { @@ -343,7 +343,7 @@ CssRoot { ``` 0: CSS_ROOT@0..369 0: (empty) - 1: CSS_RULE_LIST@0..368 + 1: CSS_ROOT_ITEM_LIST@0..368 0: CSS_AT_RULE@0..368 0: AT@0..1 "@" [] [] 1: TW_PLUGIN_AT_RULE@1..368 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css.snap index e117c136a438..46764818d955 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin-with-options.css.snap @@ -23,7 +23,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwPluginAtRule { @@ -134,7 +134,7 @@ CssRoot { ``` 0: CSS_ROOT@0..114 0: (empty) - 1: CSS_RULE_LIST@0..113 + 1: CSS_ROOT_ITEM_LIST@0..113 0: CSS_AT_RULE@0..55 0: AT@0..1 "@" [] [] 1: TW_PLUGIN_AT_RULE@1..55 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin.css.snap index babbdd905ff2..709d767f70f2 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/plugin.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwPluginAtRule { @@ -37,7 +37,7 @@ CssRoot { ``` 0: CSS_ROOT@0..35 0: (empty) - 1: CSS_RULE_LIST@0..34 + 1: CSS_ROOT_ITEM_LIST@0..34 0: CSS_AT_RULE@0..34 0: AT@0..1 "@" [] [] 1: TW_PLUGIN_AT_RULE@1..34 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/reference.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/reference.css.snap index 0214a14a069e..b803dcb99280 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/reference.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/reference.css.snap @@ -42,7 +42,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..28 "@" [Comments("/* @reference directi ..."), Newline("\n")] [], rule: TwReferenceAtRule { @@ -153,7 +153,7 @@ CssRoot { ``` 0: CSS_ROOT@0..726 0: (empty) - 1: CSS_RULE_LIST@0..725 + 1: CSS_ROOT_ITEM_LIST@0..725 0: CSS_AT_RULE@0..50 0: AT@0..28 "@" [Comments("/* @reference directi ..."), Newline("\n")] [] 1: TW_REFERENCE_AT_RULE@28..50 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap index 6c71315b4468..2ccb9a1c7cbc 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap @@ -161,7 +161,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssImportAtRule { @@ -4443,7 +4443,7 @@ CssRoot { ``` 0: CSS_ROOT@0..4464 0: (empty) - 1: CSS_RULE_LIST@0..4463 + 1: CSS_ROOT_ITEM_LIST@0..4463 0: CSS_AT_RULE@0..22 0: AT@0..1 "@" [] [] 1: CSS_IMPORT_AT_RULE@1..22 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snap index 1c2a55db26ef..64b80355ba2d 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snap @@ -40,7 +40,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..49 "@" [Comments("/* Simple Tailwind CS ..."), Newline("\n"), Newline("\n")] [], rule: TwThemeAtRule { @@ -358,7 +358,7 @@ CssRoot { ``` 0: CSS_ROOT@0..381 0: (empty) - 1: CSS_RULE_LIST@0..380 + 1: CSS_ROOT_ITEM_LIST@0..380 0: CSS_AT_RULE@0..110 0: AT@0..49 "@" [Comments("/* Simple Tailwind CS ..."), Newline("\n"), Newline("\n")] [] 1: TW_THEME_AT_RULE@49..110 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css.snap index 70feda62bc68..c153a1a54f59 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css.snap @@ -16,7 +16,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwSourceAtRule { @@ -59,7 +59,7 @@ CssRoot { ``` 0: CSS_ROOT@0..62 0: (empty) - 1: CSS_RULE_LIST@0..61 + 1: CSS_ROOT_ITEM_LIST@0..61 0: CSS_AT_RULE@0..28 0: AT@0..1 "@" [] [] 1: TW_SOURCE_AT_RULE@1..28 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snap index f43a040e4fbc..560dc6251a4d 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwSourceAtRule { @@ -37,7 +37,7 @@ CssRoot { ``` 0: CSS_ROOT@0..38 0: (empty) - 1: CSS_RULE_LIST@0..37 + 1: CSS_ROOT_ITEM_LIST@0..37 0: CSS_AT_RULE@0..37 0: AT@0..1 "@" [] [] 1: TW_SOURCE_AT_RULE@1..37 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snap index be4e23e876c6..98c59aebb0f5 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snap @@ -15,7 +15,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwSourceAtRule { @@ -37,7 +37,7 @@ CssRoot { ``` 0: CSS_ROOT@0..46 0: (empty) - 1: CSS_RULE_LIST@0..45 + 1: CSS_ROOT_ITEM_LIST@0..45 0: CSS_AT_RULE@0..45 0: AT@0..1 "@" [] [] 1: TW_SOURCE_AT_RULE@1..45 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/spacing_function.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/spacing_function.css.snap index 67fc27643afd..5ac1ffb5b25b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/spacing_function.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/spacing_function.css.snap @@ -88,7 +88,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -1853,7 +1853,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1596 0: (empty) - 1: CSS_RULE_LIST@0..1595 + 1: CSS_ROOT_ITEM_LIST@0..1595 0: CSS_QUALIFIED_RULE@0..112 0: CSS_SELECTOR_LIST@0..47 0: CSS_COMPOUND_SELECTOR@0..47 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/custom-theme.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/custom-theme.css.snap index 17ce1524f374..5f3bf7aa81b9 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/custom-theme.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/custom-theme.css.snap @@ -19,7 +19,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..84 "@" [Comments("/* From tailwind docs ..."), Newline("\n"), Newline("\n")] [], rule: TwThemeAtRule { @@ -64,7 +64,7 @@ CssRoot { ``` 0: CSS_ROOT@0..109 0: (empty) - 1: CSS_RULE_LIST@0..108 + 1: CSS_ROOT_ITEM_LIST@0..108 0: CSS_AT_RULE@0..108 0: AT@0..84 "@" [Comments("/* From tailwind docs ..."), Newline("\n"), Newline("\n")] [] 1: TW_THEME_AT_RULE@84..108 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-keyframes.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-keyframes.css.snap index f68f38071a37..fa8a6f3c795b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-keyframes.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-keyframes.css.snap @@ -25,7 +25,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwThemeAtRule { @@ -139,7 +139,7 @@ CssRoot { ``` 0: CSS_ROOT@0..132 0: (empty) - 1: CSS_RULE_LIST@0..131 + 1: CSS_ROOT_ITEM_LIST@0..131 0: CSS_AT_RULE@0..131 0: AT@0..1 "@" [] [] 1: TW_THEME_AT_RULE@1..131 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-name.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-name.css.snap index a6c5925002dc..fbed12d47540 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-name.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-name.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwThemeAtRule { @@ -61,7 +61,7 @@ CssRoot { ``` 0: CSS_ROOT@0..29 0: (empty) - 1: CSS_RULE_LIST@0..28 + 1: CSS_ROOT_ITEM_LIST@0..28 0: CSS_AT_RULE@0..28 0: AT@0..1 "@" [] [] 1: TW_THEME_AT_RULE@1..28 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-star-vars.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-star-vars.css.snap index a8196d6732c3..a6b325d501e6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-star-vars.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme-with-star-vars.css.snap @@ -18,7 +18,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwThemeAtRule { @@ -84,7 +84,7 @@ CssRoot { ``` 0: CSS_ROOT@0..55 0: (empty) - 1: CSS_RULE_LIST@0..54 + 1: CSS_ROOT_ITEM_LIST@0..54 0: CSS_AT_RULE@0..54 0: AT@0..1 "@" [] [] 1: TW_THEME_AT_RULE@1..54 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme.css.snap index 7a5720a8ed77..d18e121f22b0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/theme/theme.css.snap @@ -32,7 +32,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..24 "@" [Comments("/* @theme directive */"), Newline("\n")] [], rule: TwThemeAtRule { @@ -331,7 +331,7 @@ CssRoot { ``` 0: CSS_ROOT@0..375 0: (empty) - 1: CSS_RULE_LIST@0..374 + 1: CSS_ROOT_ITEM_LIST@0..374 0: CSS_AT_RULE@0..143 0: AT@0..24 "@" [Comments("/* @theme directive */"), Newline("\n")] [] 1: TW_THEME_AT_RULE@24..143 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/tw-import.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/tw-import.css.snap index 0e5d3955a779..33967f785db0 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/tw-import.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/tw-import.css.snap @@ -20,7 +20,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: CssImportAtRule { @@ -181,7 +181,7 @@ CssRoot { ``` 0: CSS_ROOT@0..374 0: (empty) - 1: CSS_RULE_LIST@0..373 + 1: CSS_ROOT_ITEM_LIST@0..373 0: CSS_AT_RULE@0..87 0: AT@0..1 "@" [] [] 1: CSS_IMPORT_AT_RULE@1..87 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/arbitrary-star.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/arbitrary-star.css.snap index 9ac604ae9b73..ffd0525a8777 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/arbitrary-star.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/arbitrary-star.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -85,7 +85,7 @@ CssRoot { ``` 0: CSS_ROOT@0..44 0: (empty) - 1: CSS_RULE_LIST@0..43 + 1: CSS_ROOT_ITEM_LIST@0..43 0: CSS_AT_RULE@0..43 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..43 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/enhanced-value-function.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/enhanced-value-function.css.snap index b651a48444b9..8403761bfe8e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/enhanced-value-function.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/enhanced-value-function.css.snap @@ -47,7 +47,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..61 "@" [Comments("/* Test enhanced --va ..."), Newline("\n")] [], rule: TwUtilityAtRule { @@ -575,7 +575,7 @@ CssRoot { ``` 0: CSS_ROOT@0..712 0: (empty) - 1: CSS_RULE_LIST@0..711 + 1: CSS_ROOT_ITEM_LIST@0..711 0: CSS_AT_RULE@0..115 0: AT@0..61 "@" [Comments("/* Test enhanced --va ..."), Newline("\n")] [] 1: TW_UTILITY_AT_RULE@61..115 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/modifier.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/modifier.css.snap index a3f064c42efc..23edd2f2374c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/modifier.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/modifier.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -99,7 +99,7 @@ CssRoot { ``` 0: CSS_ROOT@0..69 0: (empty) - 1: CSS_RULE_LIST@0..68 + 1: CSS_ROOT_ITEM_LIST@0..68 0: CSS_AT_RULE@0..68 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..68 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/px-functional.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/px-functional.css.snap index 6efac948a82d..ed97b0c72cd6 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/px-functional.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/px-functional.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -83,7 +83,7 @@ CssRoot { ``` 0: CSS_ROOT@0..64 0: (empty) - 1: CSS_RULE_LIST@0..63 + 1: CSS_ROOT_ITEM_LIST@0..63 0: CSS_AT_RULE@0..63 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..63 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/simple-utility.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/simple-utility.css.snap index 7704207d78ec..510d8a62d7a5 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/simple-utility.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/simple-utility.css.snap @@ -37,7 +37,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -376,7 +376,7 @@ CssRoot { ``` 0: CSS_ROOT@0..323 0: (empty) - 1: CSS_RULE_LIST@0..322 + 1: CSS_ROOT_ITEM_LIST@0..322 0: CSS_AT_RULE@0..88 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..88 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/value-literals.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/value-literals.css.snap index 803060bf10a5..e1ad5c1afca3 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/value-literals.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/value-literals.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -99,7 +99,7 @@ CssRoot { ``` 0: CSS_ROOT@0..70 0: (empty) - 1: CSS_RULE_LIST@0..69 + 1: CSS_ROOT_ITEM_LIST@0..69 0: CSS_AT_RULE@0..69 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..69 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-param.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-param.css.snap index 44bbde2cf868..49756cb0b0d9 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-param.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-param.css.snap @@ -17,7 +17,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -83,7 +83,7 @@ CssRoot { ``` 0: CSS_ROOT@0..53 0: (empty) - 1: CSS_RULE_LIST@0..52 + 1: CSS_ROOT_ITEM_LIST@0..52 0: CSS_AT_RULE@0..52 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..52 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-sub-block.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-sub-block.css.snap index 64bbd6d8b25f..1003f5d8d481 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-sub-block.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/utility/with-sub-block.css.snap @@ -21,7 +21,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwUtilityAtRule { @@ -117,7 +117,7 @@ CssRoot { ``` 0: CSS_ROOT@0..88 0: (empty) - 1: CSS_RULE_LIST@0..87 + 1: CSS_ROOT_ITEM_LIST@0..87 0: CSS_AT_RULE@0..87 0: AT@0..1 "@" [] [] 1: TW_UTILITY_AT_RULE@1..87 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/variant.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/variant.css.snap index 3c839d91250c..a23b796cca8e 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/variant.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/tailwind/variant.css.snap @@ -28,7 +28,7 @@ expression: snapshot ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssAtRule { at_token: AT@0..1 "@" [] [], rule: TwVariantAtRule { @@ -174,7 +174,7 @@ CssRoot { ``` 0: CSS_ROOT@0..156 0: (empty) - 1: CSS_RULE_LIST@0..155 + 1: CSS_ROOT_ITEM_LIST@0..155 0: CSS_AT_RULE@0..52 0: AT@0..1 "@" [] [] 1: TW_VARIANT_AT_RULE@1..52 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/values/number.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/values/number.css.snap index 329a014a01b7..e8b7dfcd26ad 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/values/number.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/values/number.css.snap @@ -82,7 +82,7 @@ a { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -1117,7 +1117,7 @@ CssRoot { ``` 0: CSS_ROOT@0..713 0: (empty) - 1: CSS_RULE_LIST@0..712 + 1: CSS_ROOT_ITEM_LIST@0..712 0: CSS_QUALIFIED_RULE@0..712 0: CSS_SELECTOR_LIST@0..2 0: CSS_COMPOUND_SELECTOR@0..2 diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/values/url_value.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/values/url_value.css.snap index d180d78cd918..eff5f510c148 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/values/url_value.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/values/url_value.css.snap @@ -54,7 +54,7 @@ div { ``` CssRoot { bom_token: missing (optional), - rules: CssRuleList [ + items: CssRootItemList [ CssQualifiedRule { prelude: CssSelectorList [ CssCompoundSelector { @@ -738,7 +738,7 @@ CssRoot { ``` 0: CSS_ROOT@0..1291 0: (empty) - 1: CSS_RULE_LIST@0..1290 + 1: CSS_ROOT_ITEM_LIST@0..1290 0: CSS_QUALIFIED_RULE@0..1290 0: CSS_SELECTOR_LIST@0..4 0: CSS_COMPOUND_SELECTOR@0..4 diff --git a/crates/biome_css_parser/tests/spec_test.rs b/crates/biome_css_parser/tests/spec_test.rs index 40e6a9723e95..7281dd5e80bf 100644 --- a/crates/biome_css_parser/tests/spec_test.rs +++ b/crates/biome_css_parser/tests/spec_test.rs @@ -38,6 +38,10 @@ pub fn run(test_case: &str, _snapshot_name: &str, test_directory: &str, outcome_ .expect("Expected test to have a file name") .to_str() .expect("File name to be valid UTF8"); + let extension = test_case_path + .extension() + .and_then(|ext| ext.to_str()) + .unwrap_or_default(); let content = fs::read_to_string(test_case_path) .expect("Expected test path to be a readable file in UTF8 encoding"); @@ -91,7 +95,12 @@ pub fn run(test_case: &str, _snapshot_name: &str, test_directory: &str, outcome_ } } - let mut source_type = CssFileSource::css(); + let mut source_type = if extension == "scss" { + CssFileSource::scss() + } else { + CssFileSource::css() + }; + if file_name.ends_with(".styled.css") { source_type = source_type.with_embedding_kind(EmbeddingKind::Styled); } diff --git a/crates/biome_css_parser/tests/spec_tests.rs b/crates/biome_css_parser/tests/spec_tests.rs index ea2890d73882..e7c918831dbf 100644 --- a/crates/biome_css_parser/tests/spec_tests.rs +++ b/crates/biome_css_parser/tests/spec_tests.rs @@ -1,4 +1,4 @@ mod spec_test; -tests_macros::gen_tests! {"tests/css_test_suite/ok/**/*.css", crate::spec_test::run, "ok"} -tests_macros::gen_tests! {"tests/css_test_suite/error/**/*.css", crate::spec_test::run, "error"} +tests_macros::gen_tests! {"tests/css_test_suite/ok/**/*.{css,scss}", crate::spec_test::run, "ok"} +tests_macros::gen_tests! {"tests/css_test_suite/error/**/*.{css,scss}", crate::spec_test::run, "error"} diff --git a/crates/biome_css_syntax/src/file_source.rs b/crates/biome_css_syntax/src/file_source.rs index 88308712f1e3..53358892361c 100644 --- a/crates/biome_css_syntax/src/file_source.rs +++ b/crates/biome_css_syntax/src/file_source.rs @@ -40,6 +40,7 @@ pub enum EmbeddingHtmlKind { )] #[serde(rename_all = "camelCase")] pub struct CssFileSource { + language: CssFileLanguage, variant: CssVariant, /// Used to mark if the CSS is embedded inside some particular files. This affects the parsing. @@ -47,7 +48,29 @@ pub struct CssFileSource { embedding_kind: EmbeddingKind, } -/// The style of CSS contained in the file. +/// The language of the stylesheet. +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[derive( + Debug, Clone, Default, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize, +)] +#[serde(rename_all = "camelCase")] +pub enum CssFileLanguage { + #[default] + Css, + Scss, +} + +impl CssFileLanguage { + pub const fn is_css(&self) -> bool { + matches!(self, Self::Css) + } + + pub const fn is_scss(&self) -> bool { + matches!(self, Self::Scss) + } +} + +/// Extra CSS features enabled for the file. /// /// Currently, Biome aims to be compatible with /// the latest Recommendation level standards. @@ -70,6 +93,15 @@ pub enum CssVariant { impl CssFileSource { pub fn css() -> Self { Self { + language: CssFileLanguage::Css, + variant: CssVariant::Standard, + embedding_kind: EmbeddingKind::None, + } + } + + pub fn scss() -> Self { + Self { + language: CssFileLanguage::Scss, variant: CssVariant::Standard, embedding_kind: EmbeddingKind::None, } @@ -77,6 +109,7 @@ impl CssFileSource { pub fn tailwind_css() -> Self { Self { + language: CssFileLanguage::Css, variant: CssVariant::TailwindCss, embedding_kind: EmbeddingKind::None, } @@ -84,6 +117,7 @@ impl CssFileSource { pub fn new_css_modules() -> Self { Self { + language: CssFileLanguage::Css, variant: CssVariant::CssModules, embedding_kind: EmbeddingKind::None, } @@ -108,6 +142,14 @@ impl CssFileSource { self } + pub fn is_css(&self) -> bool { + self.language.is_css() + } + + pub fn is_scss(&self) -> bool { + self.language.is_scss() + } + pub fn is_css_modules(&self) -> bool { self.variant == CssVariant::CssModules } @@ -147,6 +189,7 @@ impl CssFileSource { // We assume the file extension is normalized to lowercase match extension { "css" => Ok(Self::css()), + "scss" => Ok(Self::scss()), "module.css" => Ok(Self::new_css_modules()), _ => Err(FileSourceError::UnknownExtension), } @@ -161,6 +204,7 @@ impl CssFileSource { pub fn try_from_language_id(language_id: &str) -> Result { match language_id { "css" => Ok(Self::css()), + "scss" => Ok(Self::scss()), "tailwindcss" => Ok(Self::tailwind_css()), _ => Err(FileSourceError::UnknownLanguageId), } diff --git a/crates/biome_css_syntax/src/generated/kind.rs b/crates/biome_css_syntax/src/generated/kind.rs index d1113f95dfe5..712c7e956f06 100644 --- a/crates/biome_css_syntax/src/generated/kind.rs +++ b/crates/biome_css_syntax/src/generated/kind.rs @@ -23,6 +23,7 @@ pub enum CssSyntaxKind { L_ANGLE, R_ANGLE, TILDE, + DOLLAR, HASH, AMP, PIPE, @@ -275,6 +276,7 @@ pub enum CssSyntaxKind { MULTILINE_COMMENT, GRIT_METAVARIABLE, CSS_ROOT, + CSS_ROOT_ITEM_LIST, CSS_SNIPPET_ROOT, CSS_RULE_LIST, CSS_QUALIFIED_RULE, @@ -532,6 +534,11 @@ pub enum CssSyntaxKind { CSS_FUNCTION_PARAMETER_DEFAULT_VALUE, CSS_FUNCTION_PARAMETER_LIST, CSS_RETURNS_STATEMENT, + SCSS_DECLARATION, + SCSS_NAMESPACED_IDENTIFIER, + SCSS_VARIABLE_MODIFIER_LIST, + SCSS_VARIABLE_MODIFIER, + SCSS_IDENTIFIER, TW_THEME_AT_RULE, TW_UTILITY_AT_RULE, TW_VARIANT_AT_RULE, @@ -605,6 +612,7 @@ impl CssSyntaxKind { | L_ANGLE | R_ANGLE | TILDE + | DOLLAR | HASH | AMP | PIPE @@ -657,7 +665,8 @@ impl CssSyntaxKind { pub const fn is_list(self) -> bool { matches!( self, - CSS_RULE_LIST + CSS_ROOT_ITEM_LIST + | CSS_RULE_LIST | CSS_SELECTOR_LIST | CSS_DECLARATION_OR_RULE_LIST | CSS_DECLARATION_OR_AT_RULE_LIST @@ -700,6 +709,7 @@ impl CssSyntaxKind { | CSS_VALUE_AT_RULE_PROPERTY_LIST | CSS_VALUE_AT_RULE_IMPORT_SPECIFIER_LIST | CSS_FUNCTION_PARAMETER_LIST + | SCSS_VARIABLE_MODIFIER_LIST | TW_APPLY_CLASS_LIST | CSS_UNKNOWN_AT_RULE_COMPONENT_LIST ) @@ -925,6 +935,7 @@ impl CssSyntaxKind { L_ANGLE => "<", R_ANGLE => ">", TILDE => "~", + DOLLAR => "$", HASH => "#", AMP => "&", PIPE => "|", @@ -1167,4 +1178,4 @@ impl CssSyntaxKind { } #[doc = r" Utility macro for creating a SyntaxKind through simple macro syntax"] #[macro_export] -macro_rules ! T { [;] => { $ crate :: CssSyntaxKind :: SEMICOLON } ; [,] => { $ crate :: CssSyntaxKind :: COMMA } ; ['('] => { $ crate :: CssSyntaxKind :: L_PAREN } ; [')'] => { $ crate :: CssSyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: CssSyntaxKind :: L_CURLY } ; ['}'] => { $ crate :: CssSyntaxKind :: R_CURLY } ; ['['] => { $ crate :: CssSyntaxKind :: L_BRACK } ; [']'] => { $ crate :: CssSyntaxKind :: R_BRACK } ; [<] => { $ crate :: CssSyntaxKind :: L_ANGLE } ; [>] => { $ crate :: CssSyntaxKind :: R_ANGLE } ; [~] => { $ crate :: CssSyntaxKind :: TILDE } ; [#] => { $ crate :: CssSyntaxKind :: HASH } ; [&] => { $ crate :: CssSyntaxKind :: AMP } ; [|] => { $ crate :: CssSyntaxKind :: PIPE } ; [||] => { $ crate :: CssSyntaxKind :: PIPE2 } ; [+] => { $ crate :: CssSyntaxKind :: PLUS } ; [*] => { $ crate :: CssSyntaxKind :: STAR } ; [/] => { $ crate :: CssSyntaxKind :: SLASH } ; [^] => { $ crate :: CssSyntaxKind :: CARET } ; [%] => { $ crate :: CssSyntaxKind :: PERCENT } ; [.] => { $ crate :: CssSyntaxKind :: DOT } ; [:] => { $ crate :: CssSyntaxKind :: COLON } ; [::] => { $ crate :: CssSyntaxKind :: COLON2 } ; [=] => { $ crate :: CssSyntaxKind :: EQ } ; [!] => { $ crate :: CssSyntaxKind :: BANG } ; [!=] => { $ crate :: CssSyntaxKind :: NEQ } ; [-] => { $ crate :: CssSyntaxKind :: MINUS } ; [<=] => { $ crate :: CssSyntaxKind :: LTEQ } ; [>=] => { $ crate :: CssSyntaxKind :: GTEQ } ; [+=] => { $ crate :: CssSyntaxKind :: PLUSEQ } ; [|=] => { $ crate :: CssSyntaxKind :: PIPEEQ } ; [&=] => { $ crate :: CssSyntaxKind :: AMPEQ } ; [^=] => { $ crate :: CssSyntaxKind :: CARETEQ } ; [/=] => { $ crate :: CssSyntaxKind :: SLASHEQ } ; [*=] => { $ crate :: CssSyntaxKind :: STAREQ } ; [%=] => { $ crate :: CssSyntaxKind :: PERCENTEQ } ; [@] => { $ crate :: CssSyntaxKind :: AT } ; ["$="] => { $ crate :: CssSyntaxKind :: DOLLAR_EQ } ; [~=] => { $ crate :: CssSyntaxKind :: TILDE_EQ } ; [-->] => { $ crate :: CssSyntaxKind :: CDC } ; [] => { $ crate :: CssSyntaxKind :: CDC } ; [