diff --git a/crates/biome_css_factory/src/generated/node_factory.rs b/crates/biome_css_factory/src/generated/node_factory.rs index 36e2eb1e7908..dae73513eb50 100644 --- a/crates/biome_css_factory/src/generated/node_factory.rs +++ b/crates/biome_css_factory/src/generated/node_factory.rs @@ -143,7 +143,7 @@ pub fn css_charset_at_rule( ], )) } -pub fn css_class_selector(dot_token: SyntaxToken, name: CssIdentifier) -> CssClassSelector { +pub fn css_class_selector(dot_token: SyntaxToken, name: CssCustomIdentifier) -> CssClassSelector { CssClassSelector::unwrap_cast(SyntaxNode::new_detached( CssSyntaxKind::CSS_CLASS_SELECTOR, [ @@ -163,7 +163,7 @@ pub fn css_color(hash_token: SyntaxToken, value_token: SyntaxToken) -> CssColor } pub fn css_color_profile_at_rule( color_profile_token: SyntaxToken, - name: CssIdentifier, + name: CssCustomIdentifier, block: AnyCssDeclarationListBlock, ) -> CssColorProfileAtRule { CssColorProfileAtRule::unwrap_cast(SyntaxNode::new_detached( @@ -253,10 +253,10 @@ pub struct CssContainerAtRuleBuilder { container_token: SyntaxToken, query: AnyCssContainerQuery, block: AnyCssRuleListBlock, - name: Option, + name: Option, } impl CssContainerAtRuleBuilder { - pub fn with_name(mut self, name: CssIdentifier) -> Self { + pub fn with_name(mut self, name: CssCustomIdentifier) -> Self { self.name = Some(name); self } @@ -399,7 +399,7 @@ pub fn css_container_style_query_in_parens( } pub fn css_counter_style_at_rule( counter_style_token: SyntaxToken, - name: CssIdentifier, + name: CssCustomIdentifier, block: AnyCssDeclarationListBlock, ) -> CssCounterStyleAtRule { CssCounterStyleAtRule::unwrap_cast(SyntaxNode::new_detached( @@ -411,10 +411,16 @@ pub fn css_counter_style_at_rule( ], )) } -pub fn css_custom_property(value: CssIdentifier) -> CssCustomProperty { - CssCustomProperty::unwrap_cast(SyntaxNode::new_detached( - CssSyntaxKind::CSS_CUSTOM_PROPERTY, - [Some(SyntaxElement::Node(value.into_syntax()))], +pub fn css_custom_identifier(value_token: SyntaxToken) -> CssCustomIdentifier { + CssCustomIdentifier::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::CSS_CUSTOM_IDENTIFIER, + [Some(SyntaxElement::Token(value_token))], + )) +} +pub fn css_dashed_identifier(value_token: SyntaxToken) -> CssDashedIdentifier { + CssDashedIdentifier::unwrap_cast(SyntaxNode::new_detached( + CssSyntaxKind::CSS_DASHED_IDENTIFIER, + [Some(SyntaxElement::Token(value_token))], )) } pub fn css_declaration( @@ -519,7 +525,7 @@ pub fn css_font_face_at_rule( } pub fn css_font_palette_values_at_rule( font_palette_values_token: SyntaxToken, - name: CssIdentifier, + name: CssDashedIdentifier, block: AnyCssDeclarationListBlock, ) -> CssFontPaletteValuesAtRule { CssFontPaletteValuesAtRule::unwrap_cast(SyntaxNode::new_detached( @@ -531,7 +537,7 @@ pub fn css_font_palette_values_at_rule( ], )) } -pub fn css_id_selector(hash_token: SyntaxToken, name: CssIdentifier) -> CssIdSelector { +pub fn css_id_selector(hash_token: SyntaxToken, name: CssCustomIdentifier) -> CssIdSelector { CssIdSelector::unwrap_cast(SyntaxNode::new_detached( CssSyntaxKind::CSS_ID_SELECTOR, [ @@ -870,10 +876,10 @@ pub fn css_page_selector(pseudos: CssPageSelectorPseudoList) -> CssPageSelectorB } pub struct CssPageSelectorBuilder { pseudos: CssPageSelectorPseudoList, - ty: Option, + ty: Option, } impl CssPageSelectorBuilder { - pub fn with_ty(mut self, ty: CssIdentifier) -> Self { + pub fn with_ty(mut self, ty: CssCustomIdentifier) -> Self { self.ty = Some(ty); self } @@ -1733,58 +1739,6 @@ pub fn css_url_value_raw(value_token: SyntaxToken) -> CssUrlValueRaw { [Some(SyntaxElement::Token(value_token))], )) } -pub fn css_var_function( - var_token: SyntaxToken, - l_paren_token: SyntaxToken, - property: CssCustomProperty, - r_paren_token: SyntaxToken, -) -> CssVarFunctionBuilder { - CssVarFunctionBuilder { - var_token, - l_paren_token, - property, - r_paren_token, - value: None, - } -} -pub struct CssVarFunctionBuilder { - var_token: SyntaxToken, - l_paren_token: SyntaxToken, - property: CssCustomProperty, - r_paren_token: SyntaxToken, - value: Option, -} -impl CssVarFunctionBuilder { - pub fn with_value(mut self, value: CssVarFunctionValue) -> Self { - self.value = Some(value); - self - } - pub fn build(self) -> CssVarFunction { - CssVarFunction::unwrap_cast(SyntaxNode::new_detached( - CssSyntaxKind::CSS_VAR_FUNCTION, - [ - Some(SyntaxElement::Token(self.var_token)), - Some(SyntaxElement::Token(self.l_paren_token)), - Some(SyntaxElement::Node(self.property.into_syntax())), - self.value - .map(|token| SyntaxElement::Node(token.into_syntax())), - Some(SyntaxElement::Token(self.r_paren_token)), - ], - )) - } -} -pub fn css_var_function_value( - comma_token: SyntaxToken, - value: CssIdentifier, -) -> CssVarFunctionValue { - CssVarFunctionValue::unwrap_cast(SyntaxNode::new_detached( - CssSyntaxKind::CSS_VAR_FUNCTION_VALUE, - [ - Some(SyntaxElement::Token(comma_token)), - Some(SyntaxElement::Node(value.into_syntax())), - ], - )) -} pub fn css_component_value_list(items: I) -> CssComponentValueList 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 b035af1b5da2..11720a2f22fa 100644 --- a/crates/biome_css_factory/src/generated/syntax_factory.rs +++ b/crates/biome_css_factory/src/generated/syntax_factory.rs @@ -255,7 +255,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssCustomIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -307,7 +307,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssCustomIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -442,7 +442,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssCustomIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -772,7 +772,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssCustomIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -793,12 +793,31 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.into_node(CSS_COUNTER_STYLE_AT_RULE, children) } - CSS_CUSTOM_PROPERTY => { + CSS_CUSTOM_IDENTIFIER => { let mut elements = (&children).into_iter(); let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if element.kind() == IDENT { + slots.mark_present(); + current_element = elements.next(); + } + } + slots.next_slot(); + if current_element.is_some() { + return RawSyntaxNode::new( + CSS_CUSTOM_IDENTIFIER.to_bogus(), + children.into_iter().map(Some), + ); + } + slots.into_node(CSS_CUSTOM_IDENTIFIER, children) + } + CSS_DASHED_IDENTIFIER => { + let mut elements = (&children).into_iter(); + let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default(); + let mut current_element = elements.next(); + if let Some(element) = ¤t_element { + if element.kind() == IDENT { slots.mark_present(); current_element = elements.next(); } @@ -806,11 +825,11 @@ impl SyntaxFactory for CssSyntaxFactory { slots.next_slot(); if current_element.is_some() { return RawSyntaxNode::new( - CSS_CUSTOM_PROPERTY.to_bogus(), + CSS_DASHED_IDENTIFIER.to_bogus(), children.into_iter().map(Some), ); } - slots.into_node(CSS_CUSTOM_PROPERTY, children) + slots.into_node(CSS_DASHED_IDENTIFIER, children) } CSS_DECLARATION => { let mut elements = (&children).into_iter(); @@ -1008,7 +1027,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssDashedIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1041,7 +1060,7 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.next_slot(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssCustomIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -1801,7 +1820,7 @@ impl SyntaxFactory for CssSyntaxFactory { let mut slots: RawNodeSlots<2usize> = RawNodeSlots::default(); let mut current_element = elements.next(); if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { + if CssCustomIdentifier::can_cast(element.kind()) { slots.mark_present(); current_element = elements.next(); } @@ -3512,79 +3531,6 @@ impl SyntaxFactory for CssSyntaxFactory { } slots.into_node(CSS_URL_VALUE_RAW, children) } - CSS_VAR_FUNCTION => { - 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 { - if element.kind() == T![var] { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if let Some(element) = ¤t_element { - if element.kind() == T!['('] { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if let Some(element) = ¤t_element { - if CssCustomProperty::can_cast(element.kind()) { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if let Some(element) = ¤t_element { - if CssVarFunctionValue::can_cast(element.kind()) { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if let Some(element) = ¤t_element { - if element.kind() == T![')'] { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if current_element.is_some() { - return RawSyntaxNode::new( - CSS_VAR_FUNCTION.to_bogus(), - children.into_iter().map(Some), - ); - } - slots.into_node(CSS_VAR_FUNCTION, children) - } - CSS_VAR_FUNCTION_VALUE => { - 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 { - if element.kind() == T ! [,] { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if let Some(element) = ¤t_element { - if CssIdentifier::can_cast(element.kind()) { - slots.mark_present(); - current_element = elements.next(); - } - } - slots.next_slot(); - if current_element.is_some() { - return RawSyntaxNode::new( - CSS_VAR_FUNCTION_VALUE.to_bogus(), - children.into_iter().map(Some), - ); - } - slots.into_node(CSS_VAR_FUNCTION_VALUE, children) - } CSS_COMPONENT_VALUE_LIST => { Self::make_node_list_syntax(kind, children, AnyCssValue::can_cast) } diff --git a/crates/biome_css_formatter/src/css/any/declaration_name.rs b/crates/biome_css_formatter/src/css/any/declaration_name.rs index 16e331b2e737..c6c721710b7b 100644 --- a/crates/biome_css_formatter/src/css/any/declaration_name.rs +++ b/crates/biome_css_formatter/src/css/any/declaration_name.rs @@ -9,7 +9,7 @@ impl FormatRule for FormatAnyCssDeclarationName { fn fmt(&self, node: &AnyCssDeclarationName, f: &mut CssFormatter) -> FormatResult<()> { match node { AnyCssDeclarationName::CssIdentifier(node) => node.format().fmt(f), - AnyCssDeclarationName::CssCustomProperty(node) => node.format().fmt(f), + AnyCssDeclarationName::CssDashedIdentifier(node) => node.format().fmt(f), } } } diff --git a/crates/biome_css_formatter/src/css/any/keyframe_name.rs b/crates/biome_css_formatter/src/css/any/keyframe_name.rs index b5f7ac318176..1733dc2290df 100644 --- a/crates/biome_css_formatter/src/css/any/keyframe_name.rs +++ b/crates/biome_css_formatter/src/css/any/keyframe_name.rs @@ -8,7 +8,7 @@ impl FormatRule for FormatAnyCssKeyframeName { type Context = CssFormatContext; fn fmt(&self, node: &AnyCssKeyframeName, f: &mut CssFormatter) -> FormatResult<()> { match node { - AnyCssKeyframeName::CssIdentifier(node) => node.format().fmt(f), + AnyCssKeyframeName::CssCustomIdentifier(node) => node.format().fmt(f), AnyCssKeyframeName::CssString(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 8f681735952b..c020b62b19c7 100644 --- a/crates/biome_css_formatter/src/css/any/value.rs +++ b/crates/biome_css_formatter/src/css/any/value.rs @@ -9,12 +9,13 @@ impl FormatRule for FormatAnyCssValue { fn fmt(&self, node: &AnyCssValue, f: &mut CssFormatter) -> FormatResult<()> { match node { AnyCssValue::CssIdentifier(node) => node.format().fmt(f), + AnyCssValue::CssCustomIdentifier(node) => node.format().fmt(f), + AnyCssValue::CssDashedIdentifier(node) => node.format().fmt(f), AnyCssValue::CssString(node) => node.format().fmt(f), AnyCssValue::CssNumber(node) => node.format().fmt(f), AnyCssValue::AnyCssDimension(node) => node.format().fmt(f), AnyCssValue::CssRatio(node) => node.format().fmt(f), AnyCssValue::AnyCssFunction(node) => node.format().fmt(f), - AnyCssValue::CssCustomProperty(node) => node.format().fmt(f), AnyCssValue::CssColor(node) => node.format().fmt(f), } } diff --git a/crates/biome_css_formatter/src/css/auxiliary/custom_identifier.rs b/crates/biome_css_formatter/src/css/auxiliary/custom_identifier.rs new file mode 100644 index 000000000000..c4dcb79870e1 --- /dev/null +++ b/crates/biome_css_formatter/src/css/auxiliary/custom_identifier.rs @@ -0,0 +1,13 @@ +use crate::prelude::*; +use biome_css_syntax::{CssCustomIdentifier, CssCustomIdentifierFields}; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatCssCustomIdentifier; +impl FormatNodeRule for FormatCssCustomIdentifier { + fn fmt_fields(&self, node: &CssCustomIdentifier, f: &mut CssFormatter) -> FormatResult<()> { + let CssCustomIdentifierFields { value_token } = node.as_fields(); + + write!(f, [value_token.format()]) + } +} diff --git a/crates/biome_css_formatter/src/css/auxiliary/custom_property.rs b/crates/biome_css_formatter/src/css/auxiliary/custom_property.rs deleted file mode 100644 index ed1b0f0785da..000000000000 --- a/crates/biome_css_formatter/src/css/auxiliary/custom_property.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::prelude::*; -use biome_css_syntax::{CssCustomProperty, CssCustomPropertyFields}; -use biome_formatter::write; - -#[derive(Debug, Clone, Default)] -pub(crate) struct FormatCssCustomProperty; -impl FormatNodeRule for FormatCssCustomProperty { - fn fmt_fields(&self, node: &CssCustomProperty, f: &mut CssFormatter) -> FormatResult<()> { - let CssCustomPropertyFields { value } = node.as_fields(); - - write!(f, [value.format()]) - } -} diff --git a/crates/biome_css_formatter/src/css/auxiliary/dashed_identifier.rs b/crates/biome_css_formatter/src/css/auxiliary/dashed_identifier.rs new file mode 100644 index 000000000000..931736e68a8b --- /dev/null +++ b/crates/biome_css_formatter/src/css/auxiliary/dashed_identifier.rs @@ -0,0 +1,13 @@ +use crate::prelude::*; +use biome_css_syntax::{CssDashedIdentifier, CssDashedIdentifierFields}; +use biome_formatter::write; + +#[derive(Debug, Clone, Default)] +pub(crate) struct FormatCssDashedIdentifier; +impl FormatNodeRule for FormatCssDashedIdentifier { + fn fmt_fields(&self, node: &CssDashedIdentifier, f: &mut CssFormatter) -> FormatResult<()> { + let CssDashedIdentifierFields { value_token } = node.as_fields(); + + write!(f, [value_token.format()]) + } +} diff --git a/crates/biome_css_formatter/src/css/auxiliary/identifier.rs b/crates/biome_css_formatter/src/css/auxiliary/identifier.rs index cdfc59c43c21..17d0b9e758ff 100644 --- a/crates/biome_css_formatter/src/css/auxiliary/identifier.rs +++ b/crates/biome_css_formatter/src/css/auxiliary/identifier.rs @@ -1,40 +1,14 @@ -use crate::{prelude::*, utils::string_utils::FormatTokenAsLowercase}; +use crate::prelude::*; use biome_css_syntax::{CssIdentifier, CssIdentifierFields}; -use biome_formatter::{write, FormatRuleWithOptions}; - -#[derive(Default, Debug)] -pub(crate) struct FormatCssIdentifierOptions { - /// Whether the formatter should rewrite the identifier using lowercase - /// letters. - pub(crate) forced_lowercase: bool, -} - -impl FormatRuleWithOptions for FormatCssIdentifier { - type Options = FormatCssIdentifierOptions; - - fn with_options(mut self, options: Self::Options) -> Self { - self.forced_lowercase = options.forced_lowercase; - self - } -} +use biome_formatter::write; #[derive(Debug, Clone, Default)] -pub(crate) struct FormatCssIdentifier { - forced_lowercase: bool, -} +pub(crate) struct FormatCssIdentifier; impl FormatNodeRule for FormatCssIdentifier { fn fmt_fields(&self, node: &CssIdentifier, f: &mut CssFormatter) -> FormatResult<()> { let CssIdentifierFields { value_token } = node.as_fields(); - // The parser uses identifiers to represent a few different things: - // selector names, rule names, values, and also units. For formatting, - // we always want to write units in lowercase, but all of the others - // we want to preserve their casing. - if self.forced_lowercase { - write!(f, [FormatTokenAsLowercase::from(value_token?)]) - } else { - write!(f, [value_token.format()]) - } + write!(f, [value_token.format()]) } } diff --git a/crates/biome_css_formatter/src/css/auxiliary/mod.rs b/crates/biome_css_formatter/src/css/auxiliary/mod.rs index fb51f97f3c06..8877539e5e55 100644 --- a/crates/biome_css_formatter/src/css/auxiliary/mod.rs +++ b/crates/biome_css_formatter/src/css/auxiliary/mod.rs @@ -15,7 +15,8 @@ pub(crate) mod container_style_in_parens; pub(crate) mod container_style_not_query; pub(crate) mod container_style_or_query; pub(crate) mod container_style_query_in_parens; -pub(crate) mod custom_property; +pub(crate) mod custom_identifier; +pub(crate) mod dashed_identifier; pub(crate) mod declaration; pub(crate) mod declaration_important; pub(crate) mod declaration_list_block; @@ -65,5 +66,3 @@ pub(crate) mod supports_or_condition; pub(crate) mod universal_namespace_prefix; pub(crate) mod url_function; pub(crate) mod url_value_raw; -pub(crate) mod var_function; -pub(crate) mod var_function_value; diff --git a/crates/biome_css_formatter/src/css/auxiliary/var_function.rs b/crates/biome_css_formatter/src/css/auxiliary/var_function.rs deleted file mode 100644 index 73a63c95c921..000000000000 --- a/crates/biome_css_formatter/src/css/auxiliary/var_function.rs +++ /dev/null @@ -1,34 +0,0 @@ -use crate::prelude::*; -use biome_css_syntax::{CssVarFunction, CssVarFunctionFields}; -use biome_formatter::{format_args, write}; - -#[derive(Debug, Clone, Default)] -pub(crate) struct FormatCssVarFunction; -impl FormatNodeRule for FormatCssVarFunction { - fn fmt_fields(&self, node: &CssVarFunction, f: &mut CssFormatter) -> FormatResult<()> { - let CssVarFunctionFields { - var_token, - l_paren_token, - property, - value, - r_paren_token, - } = node.as_fields(); - - write!( - f, - [ - var_token.format(), - group(&format_args![ - l_paren_token.format(), - property.format(), - // `value` takes care of formatting both the comma and the - // default value. Since it's an `Option`, it can just - // always be formatted inline and will have no effect if - // it is `None` instead. - value.format(), - r_paren_token.format() - ]) - ] - ) - } -} diff --git a/crates/biome_css_formatter/src/css/auxiliary/var_function_value.rs b/crates/biome_css_formatter/src/css/auxiliary/var_function_value.rs deleted file mode 100644 index e85720b1fd6c..000000000000 --- a/crates/biome_css_formatter/src/css/auxiliary/var_function_value.rs +++ /dev/null @@ -1,20 +0,0 @@ -use crate::prelude::*; -use biome_css_syntax::{CssVarFunctionValue, CssVarFunctionValueFields}; -use biome_formatter::write; - -#[derive(Debug, Clone, Default)] -pub(crate) struct FormatCssVarFunctionValue; -impl FormatNodeRule for FormatCssVarFunctionValue { - fn fmt_fields(&self, node: &CssVarFunctionValue, f: &mut CssFormatter) -> FormatResult<()> { - let CssVarFunctionValueFields { comma_token, value } = node.as_fields(); - - write!( - f, - [ - comma_token.format(), - soft_line_break_or_space(), - value.format() - ] - ) - } -} diff --git a/crates/biome_css_formatter/src/css/value/regular_dimension.rs b/crates/biome_css_formatter/src/css/value/regular_dimension.rs index 6c9ff1bc2dc1..b5cbd9b9c1f5 100644 --- a/crates/biome_css_formatter/src/css/value/regular_dimension.rs +++ b/crates/biome_css_formatter/src/css/value/regular_dimension.rs @@ -1,4 +1,4 @@ -use crate::{css::auxiliary::identifier::FormatCssIdentifierOptions, prelude::*}; +use crate::prelude::*; use biome_css_syntax::{CssRegularDimension, CssRegularDimensionFields}; use biome_formatter::write; @@ -11,12 +11,7 @@ impl FormatNodeRule for FormatCssRegularDimension { write!(f, [value.format()])?; if let Ok(unit) = unit { - write!( - f, - [unit.format().with_options(FormatCssIdentifierOptions { - forced_lowercase: true - })] - )?; + write!(f, [unit.format()])?; } Ok(()) diff --git a/crates/biome_css_formatter/src/generated.rs b/crates/biome_css_formatter/src/generated.rs index 6ca45bdd8364..037e4fe8a148 100644 --- a/crates/biome_css_formatter/src/generated.rs +++ b/crates/biome_css_formatter/src/generated.rs @@ -602,6 +602,46 @@ impl IntoFormat for biome_css_syntax::CssUniversalNamespacePre FormatOwnedWithRule :: new (self , crate :: css :: auxiliary :: universal_namespace_prefix :: FormatCssUniversalNamespacePrefix :: default ()) } } +impl FormatRule + for crate::css::auxiliary::custom_identifier::FormatCssCustomIdentifier +{ + type Context = CssFormatContext; + #[inline(always)] + fn fmt( + &self, + node: &biome_css_syntax::CssCustomIdentifier, + f: &mut CssFormatter, + ) -> FormatResult<()> { + FormatNodeRule::::fmt(self, node, f) + } +} +impl AsFormat for biome_css_syntax::CssCustomIdentifier { + type Format<'a> = FormatRefWithRule< + 'a, + biome_css_syntax::CssCustomIdentifier, + crate::css::auxiliary::custom_identifier::FormatCssCustomIdentifier, + >; + fn format(&self) -> Self::Format<'_> { + #![allow(clippy::default_constructed_unit_structs)] + FormatRefWithRule::new( + self, + crate::css::auxiliary::custom_identifier::FormatCssCustomIdentifier::default(), + ) + } +} +impl IntoFormat for biome_css_syntax::CssCustomIdentifier { + type Format = FormatOwnedWithRule< + biome_css_syntax::CssCustomIdentifier, + crate::css::auxiliary::custom_identifier::FormatCssCustomIdentifier, + >; + fn into_format(self) -> Self::Format { + #![allow(clippy::default_constructed_unit_structs)] + FormatOwnedWithRule::new( + self, + crate::css::auxiliary::custom_identifier::FormatCssCustomIdentifier::default(), + ) + } +} impl FormatRule for crate::css::auxiliary::attribute_name::FormatCssAttributeName { @@ -1567,43 +1607,43 @@ impl IntoFormat for biome_css_syntax::CssDeclarationImportant ) } } -impl FormatRule - for crate::css::auxiliary::custom_property::FormatCssCustomProperty +impl FormatRule + for crate::css::auxiliary::dashed_identifier::FormatCssDashedIdentifier { type Context = CssFormatContext; #[inline(always)] fn fmt( &self, - node: &biome_css_syntax::CssCustomProperty, + node: &biome_css_syntax::CssDashedIdentifier, f: &mut CssFormatter, ) -> FormatResult<()> { - FormatNodeRule::::fmt(self, node, f) + FormatNodeRule::::fmt(self, node, f) } } -impl AsFormat for biome_css_syntax::CssCustomProperty { +impl AsFormat for biome_css_syntax::CssDashedIdentifier { type Format<'a> = FormatRefWithRule< 'a, - biome_css_syntax::CssCustomProperty, - crate::css::auxiliary::custom_property::FormatCssCustomProperty, + biome_css_syntax::CssDashedIdentifier, + crate::css::auxiliary::dashed_identifier::FormatCssDashedIdentifier, >; fn format(&self) -> Self::Format<'_> { #![allow(clippy::default_constructed_unit_structs)] FormatRefWithRule::new( self, - crate::css::auxiliary::custom_property::FormatCssCustomProperty::default(), + crate::css::auxiliary::dashed_identifier::FormatCssDashedIdentifier::default(), ) } } -impl IntoFormat for biome_css_syntax::CssCustomProperty { +impl IntoFormat for biome_css_syntax::CssDashedIdentifier { type Format = FormatOwnedWithRule< - biome_css_syntax::CssCustomProperty, - crate::css::auxiliary::custom_property::FormatCssCustomProperty, + biome_css_syntax::CssDashedIdentifier, + crate::css::auxiliary::dashed_identifier::FormatCssDashedIdentifier, >; fn into_format(self) -> Self::Format { #![allow(clippy::default_constructed_unit_structs)] FormatOwnedWithRule::new( self, - crate::css::auxiliary::custom_property::FormatCssCustomProperty::default(), + crate::css::auxiliary::dashed_identifier::FormatCssDashedIdentifier::default(), ) } } @@ -4050,86 +4090,6 @@ impl IntoFormat for biome_css_syntax::CssUrlValueRaw { ) } } -impl FormatRule - for crate::css::auxiliary::var_function::FormatCssVarFunction -{ - type Context = CssFormatContext; - #[inline(always)] - fn fmt( - &self, - node: &biome_css_syntax::CssVarFunction, - f: &mut CssFormatter, - ) -> FormatResult<()> { - FormatNodeRule::::fmt(self, node, f) - } -} -impl AsFormat for biome_css_syntax::CssVarFunction { - type Format<'a> = FormatRefWithRule< - 'a, - biome_css_syntax::CssVarFunction, - crate::css::auxiliary::var_function::FormatCssVarFunction, - >; - fn format(&self) -> Self::Format<'_> { - #![allow(clippy::default_constructed_unit_structs)] - FormatRefWithRule::new( - self, - crate::css::auxiliary::var_function::FormatCssVarFunction::default(), - ) - } -} -impl IntoFormat for biome_css_syntax::CssVarFunction { - type Format = FormatOwnedWithRule< - biome_css_syntax::CssVarFunction, - crate::css::auxiliary::var_function::FormatCssVarFunction, - >; - fn into_format(self) -> Self::Format { - #![allow(clippy::default_constructed_unit_structs)] - FormatOwnedWithRule::new( - self, - crate::css::auxiliary::var_function::FormatCssVarFunction::default(), - ) - } -} -impl FormatRule - for crate::css::auxiliary::var_function_value::FormatCssVarFunctionValue -{ - type Context = CssFormatContext; - #[inline(always)] - fn fmt( - &self, - node: &biome_css_syntax::CssVarFunctionValue, - f: &mut CssFormatter, - ) -> FormatResult<()> { - FormatNodeRule::::fmt(self, node, f) - } -} -impl AsFormat for biome_css_syntax::CssVarFunctionValue { - type Format<'a> = FormatRefWithRule< - 'a, - biome_css_syntax::CssVarFunctionValue, - crate::css::auxiliary::var_function_value::FormatCssVarFunctionValue, - >; - fn format(&self) -> Self::Format<'_> { - #![allow(clippy::default_constructed_unit_structs)] - FormatRefWithRule::new( - self, - crate::css::auxiliary::var_function_value::FormatCssVarFunctionValue::default(), - ) - } -} -impl IntoFormat for biome_css_syntax::CssVarFunctionValue { - type Format = FormatOwnedWithRule< - biome_css_syntax::CssVarFunctionValue, - crate::css::auxiliary::var_function_value::FormatCssVarFunctionValue, - >; - fn into_format(self) -> Self::Format { - #![allow(clippy::default_constructed_unit_structs)] - FormatOwnedWithRule::new( - self, - crate::css::auxiliary::var_function_value::FormatCssVarFunctionValue::default(), - ) - } -} impl FormatRule for crate::css::auxiliary::parameter::FormatCssParameter { diff --git a/crates/biome_css_formatter/tests/quick_test.rs b/crates/biome_css_formatter/tests/quick_test.rs index bb494b76b6ef..f60f5e55f95f 100644 --- a/crates/biome_css_formatter/tests/quick_test.rs +++ b/crates/biome_css_formatter/tests/quick_test.rs @@ -13,13 +13,12 @@ mod language { // use this test check if your snippet prints as you wish, without using a snapshot fn quick_test() { let src = r#" -a { - content: url(https://example.com/a.jpg); - content: url( https://example.com/f.jpg ); - } + + @container style(--responsive: true) { } + "#; let parse = parse_css(src, CssParserOptions::default()); - println!("{:#?}", parse.syntax()); + println!("{:#?}", parse); let options = CssFormatOptions::default() .with_line_width(LineWidth::try_from(80).unwrap()) diff --git a/crates/biome_css_parser/src/lexer/mod.rs b/crates/biome_css_parser/src/lexer/mod.rs index 985890761fc5..12f1243d191e 100644 --- a/crates/biome_css_parser/src/lexer/mod.rs +++ b/crates/biome_css_parser/src/lexer/mod.rs @@ -1219,7 +1219,7 @@ impl<'src> CssLexer<'src> { return CDC; } - // --custom-property + // --dashed-identifier if self.is_ident_start() { return self.consume_identifier(); } diff --git a/crates/biome_css_parser/src/syntax/at_rule/color_profile.rs b/crates/biome_css_parser/src/syntax/at_rule/color_profile.rs index d4dff9891c7a..48ca0fe0865e 100644 --- a/crates/biome_css_parser/src/syntax/at_rule/color_profile.rs +++ b/crates/biome_css_parser/src/syntax/at_rule/color_profile.rs @@ -1,7 +1,8 @@ +use crate::lexer::CssLexContext; use crate::parser::CssParser; use crate::syntax::blocks::parse_or_recover_declaration_list_block; +use crate::syntax::parse_custom_identifier; use crate::syntax::parse_error::expected_identifier; -use crate::syntax::parse_regular_identifier; use biome_css_syntax::CssSyntaxKind::*; use biome_css_syntax::{CssSyntaxKind, T}; use biome_parser::parse_recovery::ParseRecovery; @@ -24,7 +25,8 @@ pub(crate) fn parse_color_profile_at_rule(p: &mut CssParser) -> ParsedSyntax { p.bump(T![color_profile]); - let kind = if parse_regular_identifier(p) + // TODO: This should actually be ` | device-cmyk`. + let kind = if parse_custom_identifier(p, CssLexContext::Regular) .or_recover( p, &ParseRecovery::new(CSS_BOGUS, COLOR_PROFILE_RECOVERY_SET) diff --git a/crates/biome_css_parser/src/syntax/at_rule/container.rs b/crates/biome_css_parser/src/syntax/at_rule/container.rs index ac23619dbd83..23690005d56e 100644 --- a/crates/biome_css_parser/src/syntax/at_rule/container.rs +++ b/crates/biome_css_parser/src/syntax/at_rule/container.rs @@ -1,7 +1,8 @@ +use crate::lexer::CssLexContext; use crate::parser::CssParser; use crate::syntax::at_rule::feature::parse_any_query_feature; use crate::syntax::blocks::parse_or_recover_rule_list_block; -use crate::syntax::{is_at_identifier, parse_declaration, parse_regular_identifier}; +use crate::syntax::{is_at_identifier, parse_custom_identifier, parse_declaration}; use biome_css_syntax::CssSyntaxKind::*; use biome_css_syntax::T; use biome_parser::parsed_syntax::ParsedSyntax::Present; @@ -23,7 +24,7 @@ pub(crate) fn parse_container_at_rule(p: &mut CssParser) -> ParsedSyntax { p.bump(T![container]); - parse_regular_identifier(p).ok(); + parse_custom_identifier(p, CssLexContext::Regular).ok(); parse_any_container_query(p).ok(); // TODO handle error diff --git a/crates/biome_css_parser/src/syntax/at_rule/counter_style.rs b/crates/biome_css_parser/src/syntax/at_rule/counter_style.rs index dbd448707cdc..a404f7e5d807 100644 --- a/crates/biome_css_parser/src/syntax/at_rule/counter_style.rs +++ b/crates/biome_css_parser/src/syntax/at_rule/counter_style.rs @@ -1,7 +1,8 @@ +use crate::lexer::CssLexContext; use crate::parser::CssParser; use crate::syntax::blocks::parse_or_recover_declaration_list_block; +use crate::syntax::parse_custom_identifier; use crate::syntax::parse_error::expected_identifier; -use crate::syntax::parse_regular_identifier; use biome_css_syntax::CssSyntaxKind::*; use biome_css_syntax::{CssSyntaxKind, T}; use biome_parser::parse_recovery::ParseRecovery; @@ -24,7 +25,7 @@ pub(crate) fn parse_counter_style_at_rule(p: &mut CssParser) -> ParsedSyntax { p.bump(T![counter_style]); - let kind = if parse_regular_identifier(p) + let kind = if parse_custom_identifier(p, CssLexContext::Regular) .or_recover( p, &ParseRecovery::new(CSS_BOGUS, COUNTER_STYLE_RECOVERY_SET) diff --git a/crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs b/crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs index 6c513af1d7fb..641c4b1bcd92 100644 --- a/crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs +++ b/crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs @@ -1,8 +1,6 @@ use crate::syntax::blocks::parse_or_recover_declaration_list_block; -use crate::{ - parser::CssParser, - syntax::{parse_error::expected_identifier, parse_regular_identifier}, -}; +use crate::syntax::parse_dashed_identifier; +use crate::{parser::CssParser, syntax::parse_error::expected_identifier}; use biome_css_syntax::{ CssSyntaxKind::{self, *}, T, @@ -29,7 +27,7 @@ pub(crate) fn parse_font_palette_values_at_rule(p: &mut CssParser) -> ParsedSynt p.bump(T![font_palette_values]); - let kind = if parse_regular_identifier(p) + let kind = if parse_dashed_identifier(p) .or_recover( p, &ParseRecovery::new(CSS_BOGUS, FONT_PALETTE_VALUES_RECOVERY_SET) diff --git a/crates/biome_css_parser/src/syntax/at_rule/keyframes.rs b/crates/biome_css_parser/src/syntax/at_rule/keyframes.rs index 7a4c4a18cb1f..a1d2050ce272 100644 --- a/crates/biome_css_parser/src/syntax/at_rule/keyframes.rs +++ b/crates/biome_css_parser/src/syntax/at_rule/keyframes.rs @@ -1,3 +1,4 @@ +use crate::lexer::CssLexContext; use crate::parser::CssParser; use crate::syntax::at_rule::parse_error::{ expected_keyframes_item, expected_keyframes_item_selector, @@ -5,7 +6,7 @@ use crate::syntax::at_rule::parse_error::{ use crate::syntax::blocks::parse_declaration_list_block; use crate::syntax::css_dimension::{is_at_percentage_dimension, parse_percentage_dimension}; use crate::syntax::parse_error::{expected_block, expected_identifier}; -use crate::syntax::{is_at_identifier, parse_regular_identifier, parse_string, BODY_RECOVERY_SET}; +use crate::syntax::{is_at_identifier, parse_custom_identifier, parse_string, BODY_RECOVERY_SET}; use biome_css_syntax::CssSyntaxKind::*; use biome_css_syntax::{CssSyntaxKind, T}; use biome_parser::parse_lists::{ParseNodeList, ParseSeparatedList}; @@ -30,7 +31,7 @@ pub(crate) fn parse_keyframes_at_rule(p: &mut CssParser) -> ParsedSyntax { p.bump(T![keyframes]); let name = if is_at_identifier(p) { - parse_regular_identifier(p) + parse_custom_identifier(p, CssLexContext::Regular) } else { parse_string(p) }; diff --git a/crates/biome_css_parser/src/syntax/at_rule/page.rs b/crates/biome_css_parser/src/syntax/at_rule/page.rs index 8ab569fb9727..a15ada646104 100644 --- a/crates/biome_css_parser/src/syntax/at_rule/page.rs +++ b/crates/biome_css_parser/src/syntax/at_rule/page.rs @@ -1,3 +1,4 @@ +use crate::lexer::CssLexContext; use crate::parser::CssParser; use crate::syntax::at_rule::parse_error::{ expected_any_page_at_rule_item, expected_page_selector, expected_page_selector_pseudo, @@ -6,7 +7,7 @@ use crate::syntax::at_rule::{at_at_rule, parse_at_rule}; use crate::syntax::blocks::parse_or_recover_declaration_or_rule_list_block; use crate::syntax::parse_error::expected_block; use crate::syntax::{ - is_at_identifier, parse_declaration_with_semicolon, parse_regular_identifier, BODY_RECOVERY_SET, + is_at_identifier, parse_custom_identifier, parse_declaration_with_semicolon, BODY_RECOVERY_SET, }; use biome_css_syntax::CssSyntaxKind::*; use biome_css_syntax::{CssSyntaxKind, T}; @@ -96,7 +97,7 @@ pub(crate) fn parse_page_selector(p: &mut CssParser) -> ParsedSyntax { let m = p.start(); // it's optional - parse_regular_identifier(p).ok(); + parse_custom_identifier(p, CssLexContext::Regular).ok(); CssPageSelectorPseudoList.parse_list(p); Present(m.complete(p, CSS_PAGE_SELECTOR)) diff --git a/crates/biome_css_parser/src/syntax/mod.rs b/crates/biome_css_parser/src/syntax/mod.rs index 01549bd5f463..8c7facd99fd8 100644 --- a/crates/biome_css_parser/src/syntax/mod.rs +++ b/crates/biome_css_parser/src/syntax/mod.rs @@ -232,7 +232,7 @@ pub(crate) fn is_at_any_value(p: &mut CssParser) -> bool { || p.at(CSS_STRING_LITERAL) || is_at_any_dimension(p) || p.at(CSS_NUMBER_LITERAL) - || is_at_custom_property(p) + || is_at_dashed_identifier(p) || is_at_ratio(p) || is_at_color(p) } @@ -241,8 +241,8 @@ pub(crate) fn is_at_any_value(p: &mut CssParser) -> bool { pub(crate) fn parse_any_value(p: &mut CssParser) -> ParsedSyntax { if is_at_any_function(p) { parse_any_function(p) - } else if is_at_custom_property(p) { - parse_custom_property(p) + } else if is_at_dashed_identifier(p) { + parse_dashed_identifier(p) } else if is_at_identifier(p) { parse_regular_identifier(p) } else if p.at(CSS_STRING_LITERAL) { @@ -275,22 +275,6 @@ pub(crate) fn parse_color(p: &mut CssParser) -> ParsedSyntax { Present(m.complete(p, CSS_COLOR)) } -#[inline] -pub(crate) fn is_at_custom_property(p: &mut CssParser) -> bool { - is_at_identifier(p) && p.cur_text().starts_with("--") -} - -#[inline] -pub(crate) fn parse_custom_property(p: &mut CssParser) -> ParsedSyntax { - if !is_at_custom_property(p) { - return Absent; - } - - let m = p.start(); - parse_regular_identifier(p).or_add_diagnostic(p, expected_identifier); - Present(m.complete(p, CSS_CUSTOM_PROPERTY)) -} - #[inline] pub(crate) fn is_at_any_function(p: &mut CssParser) -> bool { is_at_identifier(p) && p.nth_at(1, T!['(']) @@ -460,6 +444,24 @@ pub(crate) fn parse_ratio(p: &mut CssParser) -> ParsedSyntax { Present(m.complete(p, CSS_RATIO)) } +pub(crate) fn is_at_url_value(p: &mut CssParser) -> bool { + p.at(CSS_URL_VALUE_RAW_LITERAL) || is_at_string(p) +} + +#[inline] +pub(crate) fn parse_url_value(p: &mut CssParser) -> ParsedSyntax { + if !is_at_url_value(p) { + return Absent; + } + + if is_at_string(p) { + return parse_string(p); + } + let m = p.start(); + p.expect(CSS_URL_VALUE_RAW_LITERAL); + Present(m.complete(p, CSS_URL_VALUE_RAW)) +} + #[inline] pub(crate) fn is_at_identifier(p: &mut CssParser) -> bool { is_nth_at_identifier(p, 0) @@ -469,41 +471,65 @@ pub(crate) fn is_at_identifier(p: &mut CssParser) -> bool { pub(crate) fn is_nth_at_identifier(p: &mut CssParser, n: usize) -> bool { p.nth_at(n, T![ident]) || p.nth(n).is_contextual_keyword() } +/// Parse any identifier as a general CssIdentifier. Regular identifiers are +/// case-insensitive, often used for property names, values, etc. #[inline] pub(crate) fn parse_regular_identifier(p: &mut CssParser) -> ParsedSyntax { parse_identifier(p, CssLexContext::Regular) } -pub(crate) fn is_at_url_value(p: &mut CssParser) -> bool { - p.at(CSS_URL_VALUE_RAW_LITERAL) || is_at_string(p) -} - #[inline] -pub(crate) fn parse_url_value(p: &mut CssParser) -> ParsedSyntax { - if !is_at_url_value(p) { +pub(crate) fn parse_identifier(p: &mut CssParser, context: CssLexContext) -> ParsedSyntax { + if !is_at_identifier(p) { return Absent; } - if is_at_string(p) { - return parse_string(p); - } let m = p.start(); - p.expect(CSS_URL_VALUE_RAW_LITERAL); - Present(m.complete(p, CSS_URL_VALUE_RAW)) + p.bump_remap_with_context(T![ident], context); + let identifier = m.complete(p, CSS_IDENTIFIER); + + Present(identifier) } + +/// Custom identifiers are identifiers not defined by CSS itself. These _are_ +/// case-sensitive, used for class names, ids, etc. Custom identifiers _may_ +/// have the same value as an identifier defined by CSS (e.g, `color`, used as +/// a class name). +/// +/// Custom identifiers have the same syntax as general identifiers, so the +/// [is_at_identifier] function can be used to check for both while parsing. #[inline] -pub(crate) fn parse_identifier(p: &mut CssParser, context: CssLexContext) -> ParsedSyntax { +pub(crate) fn parse_custom_identifier(p: &mut CssParser, context: CssLexContext) -> ParsedSyntax { if !is_at_identifier(p) { return Absent; } let m = p.start(); p.bump_remap_with_context(T![ident], context); - let identifier = m.complete(p, CSS_IDENTIFIER); + let identifier = m.complete(p, CSS_CUSTOM_IDENTIFIER); Present(identifier) } +#[inline] +pub(crate) fn is_at_dashed_identifier(p: &mut CssParser) -> bool { + is_at_identifier(p) && p.cur_text().starts_with("--") +} + +/// Dashed identifiers are regular identifiers that start with two dashes (`--`). +/// Case sensitive, these are guaranteed to never overlap with an identifier +/// defined by CSS. +#[inline] +pub(crate) fn parse_dashed_identifier(p: &mut CssParser) -> ParsedSyntax { + if !is_at_dashed_identifier(p) { + return Absent; + } + + let m = p.start(); + p.bump(T![ident]); + Present(m.complete(p, CSS_DASHED_IDENTIFIER)) +} + #[inline] pub(crate) fn parse_regular_number(p: &mut CssParser) -> ParsedSyntax { parse_number(p, CssLexContext::Regular) diff --git a/crates/biome_css_parser/src/syntax/selector/mod.rs b/crates/biome_css_parser/src/syntax/selector/mod.rs index 2db0c05841b5..2d4413f40c2c 100644 --- a/crates/biome_css_parser/src/syntax/selector/mod.rs +++ b/crates/biome_css_parser/src/syntax/selector/mod.rs @@ -11,7 +11,8 @@ use crate::syntax::selector::attribute::parse_attribute_selector; use crate::syntax::selector::pseudo_class::parse_pseudo_class_selector; use crate::syntax::selector::pseudo_element::parse_pseudo_element_selector; use crate::syntax::{ - is_at_identifier, parse_identifier, parse_regular_identifier, RULE_RECOVERY_SET, + is_at_identifier, parse_custom_identifier, parse_identifier, parse_regular_identifier, + RULE_RECOVERY_SET, }; use biome_css_syntax::CssSyntaxKind::*; use biome_css_syntax::{CssSyntaxKind, TextRange, T}; @@ -277,7 +278,7 @@ pub(crate) fn parse_class_selector(p: &mut CssParser) -> ParsedSyntax { let m = p.start(); p.bump(T![.]); - parse_selector_identifier(p).or_add_diagnostic(p, expected_identifier); + parse_selector_custom_identifier(p).or_add_diagnostic(p, expected_identifier); Present(m.complete(p, CSS_CLASS_SELECTOR)) } @@ -291,7 +292,7 @@ pub(crate) fn parse_id_selector(p: &mut CssParser) -> ParsedSyntax { let m = p.start(); p.bump(T![#]); - parse_selector_identifier(p).or_add_diagnostic(p, expected_identifier); + parse_selector_custom_identifier(p).or_add_diagnostic(p, expected_identifier); Present(m.complete(p, CSS_ID_SELECTOR)) } @@ -329,6 +330,15 @@ fn parse_selector_identifier(p: &mut CssParser) -> ParsedSyntax { parse_identifier(p, context) } +/// Custom identifiers are used for class names and ids in selectors and are +/// case-sensitive. These are distinguished from regular identifiers in +/// selectors that are case-insensitive for safety in preserving the casing. +#[inline] +fn parse_selector_custom_identifier(p: &mut CssParser) -> ParsedSyntax { + let context = selector_lex_context(p); + parse_custom_identifier(p, context) +} + #[inline] pub(crate) fn eat_or_recover_selector_function_close_token<'a, E, D>( p: &mut CssParser<'a>, 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 8c66e424a2d3..ae8868ac3971 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 @@ -75,7 +75,7 @@ CssRoot { rule: CssBogusAtRule { items: [ COLOR_PROFILE_KW@78..92 "color-profile" [] [Whitespace(" ")], - CssIdentifier { + CssCustomIdentifier { value_token: IDENT@92..103 "DEVICE-CMYK" [] [], }, ], @@ -132,7 +132,7 @@ CssRoot { 0: AT@76..78 "@" [Newline("\n")] [] 1: CSS_BOGUS_AT_RULE@78..103 0: COLOR_PROFILE_KW@78..92 "color-profile" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@92..103 + 1: CSS_CUSTOM_IDENTIFIER@92..103 0: IDENT@92..103 "DEVICE-CMYK" [] [] 4: CSS_AT_RULE@103..118 0: AT@103..105 "@" [Newline("\n")] [] 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 ff11a7b86b2a..a0f58f72b01a 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 @@ -75,7 +75,7 @@ CssRoot { rule: CssBogusAtRule { items: [ COUNTER_STYLE_KW@76..90 "counter-style" [] [Whitespace(" ")], - CssIdentifier { + CssCustomIdentifier { value_token: IDENT@90..95 "ident" [] [], }, ], @@ -86,7 +86,7 @@ CssRoot { rule: CssBogusAtRule { items: [ COUNTER_STYLE_KW@97..111 "counter-style" [] [Whitespace(" ")], - CssIdentifier { + CssCustomIdentifier { value_token: IDENT@111..116 "ident" [] [], }, ], @@ -135,13 +135,13 @@ CssRoot { 0: AT@74..76 "@" [Newline("\n")] [] 1: CSS_BOGUS_AT_RULE@76..95 0: COUNTER_STYLE_KW@76..90 "counter-style" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@90..95 + 1: CSS_CUSTOM_IDENTIFIER@90..95 0: IDENT@90..95 "ident" [] [] 4: CSS_AT_RULE@95..116 0: AT@95..97 "@" [Newline("\n")] [] 1: CSS_BOGUS_AT_RULE@97..116 0: COUNTER_STYLE_KW@97..111 "counter-style" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@111..116 + 1: CSS_CUSTOM_IDENTIFIER@111..116 0: IDENT@111..116 "ident" [] [] 2: EOF@116..117 "" [Newline("\n")] [] diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css index 96d61cb2cd70..dd70ce6fbb5c 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css @@ -1,5 +1,6 @@ @font-palette-values { } @font-palette-values 6788 { } @font-palette-values 'string' { } +@font-palette-values undashed-ident { } @font-palette-values ident @font-palette-values ; 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 3256647b30de..a2152d138e77 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 @@ -9,6 +9,7 @@ expression: snapshot @font-palette-values { } @font-palette-values 6788 { } @font-palette-values 'string' { } +@font-palette-values undashed-ident { } @font-palette-values ident @font-palette-values ; @@ -75,36 +76,56 @@ CssRoot { rule: CssBogusAtRule { items: [ FONT_PALETTE_VALUES_KW@94..114 "font-palette-values" [] [Whitespace(" ")], - CssIdentifier { - value_token: IDENT@114..119 "ident" [] [], + CssBogus { + items: [ + IDENT@114..129 "undashed-ident" [] [Whitespace(" ")], + ], + }, + CssDeclarationListBlock { + l_curly_token: L_CURLY@129..131 "{" [] [Whitespace(" ")], + declarations: CssDeclarationList [], + r_curly_token: R_CURLY@131..132 "}" [] [], }, ], }, }, CssAtRule { - at_token: AT@119..121 "@" [Newline("\n")] [], + at_token: AT@132..134 "@" [Newline("\n")] [], rule: CssBogusAtRule { items: [ - FONT_PALETTE_VALUES_KW@121..141 "font-palette-values" [] [Whitespace(" ")], + FONT_PALETTE_VALUES_KW@134..154 "font-palette-values" [] [Whitespace(" ")], CssBogus { items: [ - SEMICOLON@141..142 ";" [] [], + IDENT@154..159 "ident" [] [], + ], + }, + ], + }, + }, + CssAtRule { + at_token: AT@159..161 "@" [Newline("\n")] [], + rule: CssBogusAtRule { + items: [ + FONT_PALETTE_VALUES_KW@161..181 "font-palette-values" [] [Whitespace(" ")], + CssBogus { + items: [ + SEMICOLON@181..182 ";" [] [], ], }, ], }, }, ], - eof_token: EOF@142..143 "" [Newline("\n")] [], + eof_token: EOF@182..183 "" [Newline("\n")] [], } ``` ## CST ``` -0: CSS_ROOT@0..143 +0: CSS_ROOT@0..183 0: (empty) - 1: CSS_RULE_LIST@0..142 + 1: CSS_RULE_LIST@0..182 0: CSS_AT_RULE@0..26 0: AT@0..1 "@" [] [] 1: CSS_BOGUS_AT_RULE@1..26 @@ -133,19 +154,29 @@ CssRoot { 0: L_CURLY@88..91 "{" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST@91..91 2: R_CURLY@91..92 "}" [] [] - 3: CSS_AT_RULE@92..119 + 3: CSS_AT_RULE@92..132 0: AT@92..94 "@" [Newline("\n")] [] - 1: CSS_BOGUS_AT_RULE@94..119 + 1: CSS_BOGUS_AT_RULE@94..132 0: FONT_PALETTE_VALUES_KW@94..114 "font-palette-values" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@114..119 - 0: IDENT@114..119 "ident" [] [] - 4: CSS_AT_RULE@119..142 - 0: AT@119..121 "@" [Newline("\n")] [] - 1: CSS_BOGUS_AT_RULE@121..142 - 0: FONT_PALETTE_VALUES_KW@121..141 "font-palette-values" [] [Whitespace(" ")] - 1: CSS_BOGUS@141..142 - 0: SEMICOLON@141..142 ";" [] [] - 2: EOF@142..143 "" [Newline("\n")] [] + 1: CSS_BOGUS@114..129 + 0: IDENT@114..129 "undashed-ident" [] [Whitespace(" ")] + 2: CSS_DECLARATION_LIST_BLOCK@129..132 + 0: L_CURLY@129..131 "{" [] [Whitespace(" ")] + 1: CSS_DECLARATION_LIST@131..131 + 2: R_CURLY@131..132 "}" [] [] + 4: CSS_AT_RULE@132..159 + 0: AT@132..134 "@" [Newline("\n")] [] + 1: CSS_BOGUS_AT_RULE@134..159 + 0: FONT_PALETTE_VALUES_KW@134..154 "font-palette-values" [] [Whitespace(" ")] + 1: CSS_BOGUS@154..159 + 0: IDENT@154..159 "ident" [] [] + 5: CSS_AT_RULE@159..182 + 0: AT@159..161 "@" [Newline("\n")] [] + 1: CSS_BOGUS_AT_RULE@161..182 + 0: FONT_PALETTE_VALUES_KW@161..181 "font-palette-values" [] [Whitespace(" ")] + 1: CSS_BOGUS@181..182 + 0: SEMICOLON@181..182 ";" [] [] + 2: EOF@182..183 "" [Newline("\n")] [] ``` @@ -176,7 +207,7 @@ at_rule_font_palette_values_error.css:2:22 parse ━━━━━━━━━━ > 2 │ @font-palette-values 6788 { } │ ^^^^ 3 │ @font-palette-values 'string' { } - 4 │ @font-palette-values ident + 4 │ @font-palette-values undashed-ident { } i Expected an identifier here. @@ -184,7 +215,7 @@ at_rule_font_palette_values_error.css:2:22 parse ━━━━━━━━━━ > 2 │ @font-palette-values 6788 { } │ ^^^^ 3 │ @font-palette-values 'string' { } - 4 │ @font-palette-values ident + 4 │ @font-palette-values undashed-ident { } at_rule_font_palette_values_error.css:3:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -194,8 +225,8 @@ at_rule_font_palette_values_error.css:3:22 parse ━━━━━━━━━━ 2 │ @font-palette-values 6788 { } > 3 │ @font-palette-values 'string' { } │ ^^^^^^^^ - 4 │ @font-palette-values ident - 5 │ @font-palette-values ; + 4 │ @font-palette-values undashed-ident { } + 5 │ @font-palette-values ident i Expected an identifier here. @@ -203,59 +234,99 @@ at_rule_font_palette_values_error.css:3:22 parse ━━━━━━━━━━ 2 │ @font-palette-values 6788 { } > 3 │ @font-palette-values 'string' { } │ ^^^^^^^^ - 4 │ @font-palette-values ident - 5 │ @font-palette-values ; + 4 │ @font-palette-values undashed-ident { } + 5 │ @font-palette-values ident -at_rule_font_palette_values_error.css:5:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +at_rule_font_palette_values_error.css:4:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Expected a body but instead found '@'. + × Expected an identifier but instead found 'undashed-ident'. + + 2 │ @font-palette-values 6788 { } + 3 │ @font-palette-values 'string' { } + > 4 │ @font-palette-values undashed-ident { } + │ ^^^^^^^^^^^^^^ + 5 │ @font-palette-values ident + 6 │ @font-palette-values ; + + i Expected an identifier here. + + 2 │ @font-palette-values 6788 { } + 3 │ @font-palette-values 'string' { } + > 4 │ @font-palette-values undashed-ident { } + │ ^^^^^^^^^^^^^^ + 5 │ @font-palette-values ident + 6 │ @font-palette-values ; + +at_rule_font_palette_values_error.css:5:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Expected an identifier but instead found 'ident'. + + 3 │ @font-palette-values 'string' { } + 4 │ @font-palette-values undashed-ident { } + > 5 │ @font-palette-values ident + │ ^^^^^ + 6 │ @font-palette-values ; + 7 │ + + i Expected an identifier here. 3 │ @font-palette-values 'string' { } - 4 │ @font-palette-values ident - > 5 │ @font-palette-values ; + 4 │ @font-palette-values undashed-ident { } + > 5 │ @font-palette-values ident + │ ^^^^^ + 6 │ @font-palette-values ; + 7 │ + +at_rule_font_palette_values_error.css:6:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Expected a body but instead found '@'. + + 4 │ @font-palette-values undashed-ident { } + 5 │ @font-palette-values ident + > 6 │ @font-palette-values ; │ ^ - 6 │ + 7 │ i Expected a body here. - 3 │ @font-palette-values 'string' { } - 4 │ @font-palette-values ident - > 5 │ @font-palette-values ; + 4 │ @font-palette-values undashed-ident { } + 5 │ @font-palette-values ident + > 6 │ @font-palette-values ; │ ^ - 6 │ + 7 │ -at_rule_font_palette_values_error.css:5:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +at_rule_font_palette_values_error.css:6:22 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found ';'. - 3 │ @font-palette-values 'string' { } - 4 │ @font-palette-values ident - > 5 │ @font-palette-values ; + 4 │ @font-palette-values undashed-ident { } + 5 │ @font-palette-values ident + > 6 │ @font-palette-values ; │ ^ - 6 │ + 7 │ i Expected an identifier here. - 3 │ @font-palette-values 'string' { } - 4 │ @font-palette-values ident - > 5 │ @font-palette-values ; + 4 │ @font-palette-values undashed-ident { } + 5 │ @font-palette-values ident + > 6 │ @font-palette-values ; │ ^ - 6 │ + 7 │ -at_rule_font_palette_values_error.css:6:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +at_rule_font_palette_values_error.css:7:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a body but instead found the end of the file. - 4 │ @font-palette-values ident - 5 │ @font-palette-values ; - > 6 │ + 5 │ @font-palette-values ident + 6 │ @font-palette-values ; + > 7 │ │ i Expected a body here. - 4 │ @font-palette-values ident - 5 │ @font-palette-values ; - > 6 │ + 5 │ @font-palette-values ident + 6 │ @font-palette-values ; + > 7 │ │ ``` diff --git a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes.css.snap index 566327b9cbcb..4afd54a19dc1 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_keyframes.css.snap @@ -193,7 +193,7 @@ CssRoot { at_token: AT@95..98 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@98..108 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@108..116 "slidein" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -277,7 +277,7 @@ CssRoot { rule: CssBogusAtRule { items: [ KEYFRAMES_KW@226..236 "keyframes" [] [Whitespace(" ")], - CssIdentifier { + CssCustomIdentifier { value_token: IDENT@236..244 "slidein" [] [Whitespace(" ")], }, CssBogus { @@ -348,7 +348,7 @@ CssRoot { at_token: AT@288..291 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@291..301 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@301..309 "slidein" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -432,7 +432,7 @@ CssRoot { at_token: AT@391..394 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@394..404 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@404..412 "slidein" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -521,7 +521,7 @@ CssRoot { at_token: AT@494..497 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@497..507 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@507..515 "slidein" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -774,7 +774,7 @@ CssRoot { 0: AT@95..98 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@98..223 0: KEYFRAMES_KW@98..108 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@108..116 + 1: CSS_CUSTOM_IDENTIFIER@108..116 0: IDENT@108..116 "slidein" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@116..223 0: L_CURLY@116..117 "{" [] [] @@ -828,7 +828,7 @@ CssRoot { 0: AT@223..226 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_BOGUS_AT_RULE@226..288 0: KEYFRAMES_KW@226..236 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@236..244 + 1: CSS_CUSTOM_IDENTIFIER@236..244 0: IDENT@236..244 "slidein" [] [Whitespace(" ")] 2: CSS_BOGUS@244..288 0: L_CURLY@244..245 "{" [] [] @@ -867,7 +867,7 @@ CssRoot { 0: AT@288..291 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@291..391 0: KEYFRAMES_KW@291..301 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@301..309 + 1: CSS_CUSTOM_IDENTIFIER@301..309 0: IDENT@301..309 "slidein" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@309..391 0: L_CURLY@309..310 "{" [] [] @@ -921,7 +921,7 @@ CssRoot { 0: AT@391..394 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@394..494 0: KEYFRAMES_KW@394..404 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@404..412 + 1: CSS_CUSTOM_IDENTIFIER@404..412 0: IDENT@404..412 "slidein" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@412..494 0: L_CURLY@412..413 "{" [] [] @@ -979,7 +979,7 @@ CssRoot { 0: AT@494..497 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@497..720 0: KEYFRAMES_KW@497..507 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@507..515 + 1: CSS_CUSTOM_IDENTIFIER@507..515 0: IDENT@507..515 "slidein" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@515..720 0: L_CURLY@515..516 "{" [] [] 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 9de27ca59b8a..77438ac8e134 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 @@ -33,7 +33,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@8..9 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@9..21 "media-object" [] [], }, }, @@ -53,7 +53,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@27..28 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@28..36 "content" [] [Whitespace(" ")], }, }, @@ -94,7 +94,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@51..52 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@52..65 "media-object" [] [Whitespace(" ")], }, }, @@ -127,7 +127,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@76..77 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@77..89 "media-object" [] [], }, }, @@ -162,7 +162,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@94..95 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@95..103 "content" [] [Whitespace(" ")], }, }, @@ -214,7 +214,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@8..21 0: CSS_CLASS_SELECTOR@8..21 0: DOT@8..9 "." [] [] - 1: CSS_IDENTIFIER@9..21 + 1: CSS_CUSTOM_IDENTIFIER@9..21 0: IDENT@9..21 "media-object" [] [] 2: R_PAREN@21..23 ")" [] [Whitespace(" ")] 1: TO_KW@23..26 "to" [] [Whitespace(" ")] @@ -228,7 +228,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@27..36 0: CSS_CLASS_SELECTOR@27..36 0: DOT@27..28 "." [] [] - 1: CSS_IDENTIFIER@28..36 + 1: CSS_CUSTOM_IDENTIFIER@28..36 0: IDENT@28..36 "content" [] [Whitespace(" ")] 1: R_ANGLE@36..38 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@38..40 @@ -256,7 +256,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@51..65 0: CSS_CLASS_SELECTOR@51..65 0: DOT@51..52 "." [] [] - 1: CSS_IDENTIFIER@52..65 + 1: CSS_CUSTOM_IDENTIFIER@52..65 0: IDENT@52..65 "media-object" [] [Whitespace(" ")] 2: (empty) 2: CSS_RULE_LIST_BLOCK@65..67 @@ -279,7 +279,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@76..89 0: CSS_CLASS_SELECTOR@76..89 0: DOT@76..77 "." [] [] - 1: CSS_IDENTIFIER@77..89 + 1: CSS_CUSTOM_IDENTIFIER@77..89 0: IDENT@77..89 "media-object" [] [] 1: CSS_SPACE_LITERAL@89..90 " " [] [] 2: CSS_COMPOUND_SELECTOR@90..92 @@ -302,7 +302,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@94..103 0: CSS_CLASS_SELECTOR@94..103 0: DOT@94..95 "." [] [] - 1: CSS_IDENTIFIER@95..103 + 1: CSS_CUSTOM_IDENTIFIER@95..103 0: IDENT@95..103 "content" [] [Whitespace(" ")] 1: R_ANGLE@103..105 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@105..106 diff --git a/crates/biome_css_parser/tests/css_test_suite/error/css_unfinished_block.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/css_unfinished_block.css.snap index 45c3c44c923f..7853e8f9acf8 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/css_unfinished_block.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/css_unfinished_block.css.snap @@ -25,7 +25,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@0..1 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1..8 "action" [] [Whitespace(" ")], }, }, @@ -57,7 +57,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@0..8 0: CSS_CLASS_SELECTOR@0..8 0: DOT@0..1 "." [] [] - 1: CSS_IDENTIFIER@1..8 + 1: CSS_CUSTOM_IDENTIFIER@1..8 0: IDENT@1..8 "action" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@8..9 0: L_CURLY@8..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 19c49bc13a43..5a9bdeb8b1dd 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 @@ -29,7 +29,7 @@ CssRoot { }, CssClassSelector { dot_token: DOT@2..3 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3..9 "class" [] [Whitespace(" ")], }, }, @@ -64,7 +64,7 @@ CssRoot { 1: (empty) 1: CSS_CLASS_SELECTOR@2..9 0: DOT@2..3 "." [] [] - 1: CSS_IDENTIFIER@3..9 + 1: CSS_CUSTOM_IDENTIFIER@3..9 0: IDENT@3..9 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@9..11 0: L_CURLY@9..10 "{" [] [] 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 3ca45f048bf5..e365e757c700 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 @@ -29,7 +29,7 @@ CssRoot { }, CssClassSelector { dot_token: DOT@2..3 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3..9 "class" [] [Whitespace(" ")], }, }, @@ -64,7 +64,7 @@ CssRoot { 1: (empty) 1: CSS_CLASS_SELECTOR@2..9 0: DOT@2..3 "." [] [] - 1: CSS_IDENTIFIER@3..9 + 1: CSS_CUSTOM_IDENTIFIER@3..9 0: IDENT@3..9 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@9..11 0: L_CURLY@9..10 "{" [] [] 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 22d5cdc902a2..8b0f4b7f8114 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 @@ -32,7 +32,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1..2 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2..11 "selector" [] [Whitespace(" ")], }, }, @@ -66,7 +66,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1..11 0: CSS_CLASS_SELECTOR@1..11 0: DOT@1..2 "." [] [] - 1: CSS_IDENTIFIER@2..11 + 1: CSS_CUSTOM_IDENTIFIER@2..11 0: IDENT@2..11 "selector" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@11..15 0: L_CURLY@11..12 "{" [] [] 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 059d5aef9b3c..20d6b1cbf159 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 @@ -91,7 +91,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@27..28 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@28..31 "div" [] [], }, }, @@ -135,7 +135,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@50..51 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@51..54 "div" [] [], }, }, @@ -178,7 +178,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@72..73 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@73..76 "div" [] [], }, }, @@ -222,7 +222,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@94..95 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@95..98 "div" [] [], }, }, @@ -265,7 +265,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@115..116 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@116..120 "div" [] [Whitespace(" ")], }, }, @@ -302,7 +302,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@129..130 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@130..133 "div" [] [], }, }, @@ -375,7 +375,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@27..31 0: CSS_CLASS_SELECTOR@27..31 0: DOT@27..28 "." [] [] - 1: CSS_IDENTIFIER@28..31 + 1: CSS_CUSTOM_IDENTIFIER@28..31 0: IDENT@28..31 "div" [] [] 3: CSS_BOGUS@31..39 0: COMMA@31..33 "," [] [Whitespace(" ")] @@ -403,7 +403,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@50..54 0: CSS_CLASS_SELECTOR@50..54 0: DOT@50..51 "." [] [] - 1: CSS_IDENTIFIER@51..54 + 1: CSS_CUSTOM_IDENTIFIER@51..54 0: IDENT@51..54 "div" [] [] 3: CSS_BOGUS@54..63 0: COMMA@54..56 "," [] [Whitespace(" ")] @@ -430,7 +430,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@72..76 0: CSS_CLASS_SELECTOR@72..76 0: DOT@72..73 "." [] [] - 1: CSS_IDENTIFIER@73..76 + 1: CSS_CUSTOM_IDENTIFIER@73..76 0: IDENT@73..76 "div" [] [] 3: CSS_BOGUS@76..83 0: CSS_SPACE_LITERAL@76..77 " " [] [] @@ -458,7 +458,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@94..98 0: CSS_CLASS_SELECTOR@94..98 0: DOT@94..95 "." [] [] - 1: CSS_IDENTIFIER@95..98 + 1: CSS_CUSTOM_IDENTIFIER@95..98 0: IDENT@95..98 "div" [] [] 3: CSS_BOGUS@98..106 0: CSS_SPACE_LITERAL@98..99 " " [] [] @@ -485,7 +485,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@115..120 0: CSS_CLASS_SELECTOR@115..120 0: DOT@115..116 "." [] [] - 1: CSS_IDENTIFIER@116..120 + 1: CSS_CUSTOM_IDENTIFIER@116..120 0: IDENT@116..120 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@120..122 0: L_CURLY@120..121 "{" [] [] @@ -508,7 +508,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@129..133 0: CSS_CLASS_SELECTOR@129..133 0: DOT@129..130 "." [] [] - 1: CSS_IDENTIFIER@130..133 + 1: CSS_CUSTOM_IDENTIFIER@130..133 0: IDENT@130..133 "div" [] [] 2: EOF@133..134 "" [Newline("\n")] [] 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 aeb03c47881e..a9ed2955ac85 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 @@ -158,7 +158,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@64..65 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@65..68 "div" [] [], }, }, @@ -204,7 +204,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@86..87 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@87..90 "div" [] [], }, }, @@ -251,7 +251,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@109..110 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@110..113 "div" [] [], }, }, @@ -296,7 +296,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@130..131 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@131..135 "div" [] [Whitespace(" ")], }, }, @@ -335,7 +335,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@144..145 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@145..148 "div" [] [], }, }, @@ -451,7 +451,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@64..68 0: CSS_CLASS_SELECTOR@64..68 0: DOT@64..65 "." [] [] - 1: CSS_IDENTIFIER@65..68 + 1: CSS_CUSTOM_IDENTIFIER@65..68 0: IDENT@65..68 "div" [] [] 3: CSS_BOGUS@68..75 0: CSS_SPACE_LITERAL@68..69 " " [] [] @@ -480,7 +480,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@86..90 0: CSS_CLASS_SELECTOR@86..90 0: DOT@86..87 "." [] [] - 1: CSS_IDENTIFIER@87..90 + 1: CSS_CUSTOM_IDENTIFIER@87..90 0: IDENT@87..90 "div" [] [] 3: CSS_BOGUS@90..98 0: CSS_SPACE_LITERAL@90..91 " " [] [] @@ -510,7 +510,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@109..113 0: CSS_CLASS_SELECTOR@109..113 0: DOT@109..110 "." [] [] - 1: CSS_IDENTIFIER@110..113 + 1: CSS_CUSTOM_IDENTIFIER@110..113 0: IDENT@110..113 "div" [] [] 3: CSS_BOGUS@113..121 0: CSS_SPACE_LITERAL@113..114 " " [] [] @@ -538,7 +538,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@130..135 0: CSS_CLASS_SELECTOR@130..135 0: DOT@130..131 "." [] [] - 1: CSS_IDENTIFIER@131..135 + 1: CSS_CUSTOM_IDENTIFIER@131..135 0: IDENT@131..135 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@135..137 0: L_CURLY@135..136 "{" [] [] @@ -562,7 +562,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@144..148 0: CSS_CLASS_SELECTOR@144..148 0: DOT@144..145 "." [] [] - 1: CSS_IDENTIFIER@145..148 + 1: CSS_CUSTOM_IDENTIFIER@145..148 0: IDENT@145..148 "div" [] [] 2: EOF@148..149 "" [Newline("\n")] [] 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 00270329f9cf..b19cf13ba6af 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 @@ -507,7 +507,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@284..285 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@285..288 "div" [] [], }, }, @@ -559,7 +559,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@313..314 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@314..318 "div" [] [Whitespace(" ")], }, }, @@ -1014,7 +1014,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@284..288 0: CSS_CLASS_SELECTOR@284..288 0: DOT@284..285 "." [] [] - 1: CSS_IDENTIFIER@285..288 + 1: CSS_CUSTOM_IDENTIFIER@285..288 0: IDENT@285..288 "div" [] [] 3: R_PAREN@288..290 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@290..292 @@ -1047,7 +1047,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@313..318 0: CSS_CLASS_SELECTOR@313..318 0: DOT@313..314 "." [] [] - 1: CSS_IDENTIFIER@314..318 + 1: CSS_CUSTOM_IDENTIFIER@314..318 0: IDENT@314..318 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@318..320 0: L_CURLY@318..319 "{" [] [] 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 fb4ba089f165..3d1e87a6b1ec 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 @@ -195,7 +195,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@84..85 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@85..88 "div" [] [], }, }, @@ -208,7 +208,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@89..90 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@90..95 "class" [] [], }, }, @@ -260,7 +260,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@114..115 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@115..118 "div" [] [], }, }, @@ -273,7 +273,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@119..120 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@120..126 "class" [] [Whitespace(" ")], }, }, @@ -315,7 +315,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@134..135 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@135..139 "div" [] [Whitespace(" ")], }, }, @@ -357,7 +357,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@147..148 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@148..151 "div" [] [], }, }, @@ -499,7 +499,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@84..88 0: CSS_CLASS_SELECTOR@84..88 0: DOT@84..85 "." [] [] - 1: CSS_IDENTIFIER@85..88 + 1: CSS_CUSTOM_IDENTIFIER@85..88 0: IDENT@85..88 "div" [] [] 1: CSS_SPACE_LITERAL@88..89 " " [] [] 2: CSS_COMPOUND_SELECTOR@89..95 @@ -508,7 +508,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@89..95 0: CSS_CLASS_SELECTOR@89..95 0: DOT@89..90 "." [] [] - 1: CSS_IDENTIFIER@90..95 + 1: CSS_CUSTOM_IDENTIFIER@90..95 0: IDENT@90..95 "class" [] [] 1: COMMA@95..96 "," [] [] 2: (empty) @@ -541,7 +541,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@114..118 0: CSS_CLASS_SELECTOR@114..118 0: DOT@114..115 "." [] [] - 1: CSS_IDENTIFIER@115..118 + 1: CSS_CUSTOM_IDENTIFIER@115..118 0: IDENT@115..118 "div" [] [] 1: CSS_SPACE_LITERAL@118..119 " " [] [] 2: CSS_COMPOUND_SELECTOR@119..126 @@ -550,7 +550,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@119..126 0: CSS_CLASS_SELECTOR@119..126 0: DOT@119..120 "." [] [] - 1: CSS_IDENTIFIER@120..126 + 1: CSS_CUSTOM_IDENTIFIER@120..126 0: IDENT@120..126 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@126..128 0: L_CURLY@126..127 "{" [] [] @@ -576,7 +576,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@134..139 0: CSS_CLASS_SELECTOR@134..139 0: DOT@134..135 "." [] [] - 1: CSS_IDENTIFIER@135..139 + 1: CSS_CUSTOM_IDENTIFIER@135..139 0: IDENT@135..139 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@139..141 0: L_CURLY@139..140 "{" [] [] @@ -602,7 +602,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@147..151 0: CSS_CLASS_SELECTOR@147..151 0: DOT@147..148 "." [] [] - 1: CSS_IDENTIFIER@148..151 + 1: CSS_CUSTOM_IDENTIFIER@148..151 0: IDENT@148..151 "div" [] [] 2: EOF@151..152 "" [Newline("\n")] [] diff --git a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector.css.snap b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector.css.snap index 8652ee2afbe5..f64526d0632b 100644 --- a/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector.css.snap @@ -89,7 +89,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@33..34 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@34..37 "div" [] [], }, }, @@ -133,7 +133,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@58..59 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@59..62 "div" [] [], }, }, @@ -177,7 +177,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@82..83 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@83..86 "div" [] [], }, }, @@ -190,7 +190,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@87..88 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@88..94 "class" [] [Whitespace(" ")], }, }, @@ -229,7 +229,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@105..106 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@106..109 "div" [] [], }, }, @@ -242,7 +242,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@110..111 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@111..116 "class" [] [], }, }, @@ -316,7 +316,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@33..37 0: CSS_CLASS_SELECTOR@33..37 0: DOT@33..34 "." [] [] - 1: CSS_IDENTIFIER@34..37 + 1: CSS_CUSTOM_IDENTIFIER@34..37 0: IDENT@34..37 "div" [] [] 3: CSS_BOGUS@37..45 0: COMMA@37..39 "," [] [Whitespace(" ")] @@ -344,7 +344,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@58..62 0: CSS_CLASS_SELECTOR@58..62 0: DOT@58..59 "." [] [] - 1: CSS_IDENTIFIER@59..62 + 1: CSS_CUSTOM_IDENTIFIER@59..62 0: IDENT@59..62 "div" [] [] 3: CSS_BOGUS@62..71 0: COMMA@62..64 "," [] [Whitespace(" ")] @@ -372,7 +372,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@82..86 0: CSS_CLASS_SELECTOR@82..86 0: DOT@82..83 "." [] [] - 1: CSS_IDENTIFIER@83..86 + 1: CSS_CUSTOM_IDENTIFIER@83..86 0: IDENT@83..86 "div" [] [] 1: CSS_SPACE_LITERAL@86..87 " " [] [] 2: CSS_COMPOUND_SELECTOR@87..94 @@ -381,7 +381,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@87..94 0: CSS_CLASS_SELECTOR@87..94 0: DOT@87..88 "." [] [] - 1: CSS_IDENTIFIER@88..94 + 1: CSS_CUSTOM_IDENTIFIER@88..94 0: IDENT@88..94 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@94..96 0: L_CURLY@94..95 "{" [] [] @@ -405,7 +405,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@105..109 0: CSS_CLASS_SELECTOR@105..109 0: DOT@105..106 "." [] [] - 1: CSS_IDENTIFIER@106..109 + 1: CSS_CUSTOM_IDENTIFIER@106..109 0: IDENT@106..109 "div" [] [] 1: CSS_SPACE_LITERAL@109..110 " " [] [] 2: CSS_COMPOUND_SELECTOR@110..116 @@ -414,7 +414,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@110..116 0: CSS_CLASS_SELECTOR@110..116 0: DOT@110..111 "." [] [] - 1: CSS_IDENTIFIER@111..116 + 1: CSS_CUSTOM_IDENTIFIER@111..116 0: IDENT@111..116 "class" [] [] 2: EOF@116..117 "" [Newline("\n")] [] 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 c4cb79fa4f86..ae6e0063db30 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 @@ -193,7 +193,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@96..97 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@97..100 "div" [] [], }, }, @@ -206,7 +206,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@101..102 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@102..107 "class" [] [], }, }, @@ -255,7 +255,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@128..129 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@129..132 "div" [] [], }, }, @@ -268,7 +268,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@133..134 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@134..140 "class" [] [Whitespace(" ")], }, }, @@ -307,7 +307,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@150..151 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@151..155 "div" [] [Whitespace(" ")], }, }, @@ -346,7 +346,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@165..166 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@166..169 "div" [] [], }, }, @@ -485,7 +485,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@96..100 0: CSS_CLASS_SELECTOR@96..100 0: DOT@96..97 "." [] [] - 1: CSS_IDENTIFIER@97..100 + 1: CSS_CUSTOM_IDENTIFIER@97..100 0: IDENT@97..100 "div" [] [] 1: CSS_SPACE_LITERAL@100..101 " " [] [] 2: CSS_COMPOUND_SELECTOR@101..107 @@ -494,7 +494,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@101..107 0: CSS_CLASS_SELECTOR@101..107 0: DOT@101..102 "." [] [] - 1: CSS_IDENTIFIER@102..107 + 1: CSS_CUSTOM_IDENTIFIER@102..107 0: IDENT@102..107 "class" [] [] 1: COMMA@107..108 "," [] [] 2: (empty) @@ -525,7 +525,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@128..132 0: CSS_CLASS_SELECTOR@128..132 0: DOT@128..129 "." [] [] - 1: CSS_IDENTIFIER@129..132 + 1: CSS_CUSTOM_IDENTIFIER@129..132 0: IDENT@129..132 "div" [] [] 1: CSS_SPACE_LITERAL@132..133 " " [] [] 2: CSS_COMPOUND_SELECTOR@133..140 @@ -534,7 +534,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@133..140 0: CSS_CLASS_SELECTOR@133..140 0: DOT@133..134 "." [] [] - 1: CSS_IDENTIFIER@134..140 + 1: CSS_CUSTOM_IDENTIFIER@134..140 0: IDENT@134..140 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@140..142 0: L_CURLY@140..141 "{" [] [] @@ -558,7 +558,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@150..155 0: CSS_CLASS_SELECTOR@150..155 0: DOT@150..151 "." [] [] - 1: CSS_IDENTIFIER@151..155 + 1: CSS_CUSTOM_IDENTIFIER@151..155 0: IDENT@151..155 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@155..157 0: L_CURLY@155..156 "{" [] [] @@ -582,7 +582,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@165..169 0: CSS_CLASS_SELECTOR@165..169 0: DOT@165..166 "." [] [] - 1: CSS_IDENTIFIER@166..169 + 1: CSS_CUSTOM_IDENTIFIER@166..169 0: IDENT@166..169 "div" [] [] 2: EOF@169..170 "" [Newline("\n")] [] 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 f5423d40cbbb..0f520610e9d7 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 @@ -53,7 +53,7 @@ CssRoot { }, CssClassSelector { dot_token: DOT@7..8 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@8..13 "class" [] [], }, }, @@ -74,7 +74,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@15..17 "." [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@17..22 "class" [] [], }, }, @@ -142,7 +142,7 @@ CssRoot { 0: COLON@4..7 ":" [Newline("\n")] [Whitespace(" ")] 1: CSS_CLASS_SELECTOR@7..13 0: DOT@7..8 "." [] [] - 1: CSS_IDENTIFIER@8..13 + 1: CSS_CUSTOM_IDENTIFIER@8..13 0: IDENT@8..13 "class" [] [] 1: CSS_DECLARATION_LIST_BLOCK@13..15 0: L_CURLY@13..14 "{" [] [] @@ -156,7 +156,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@15..24 0: CSS_CLASS_SELECTOR@15..22 0: DOT@15..17 "." [Newline("\n")] [] - 1: CSS_IDENTIFIER@17..22 + 1: CSS_CUSTOM_IDENTIFIER@17..22 0: IDENT@17..22 "class" [] [] 1: CSS_BOGUS_SUB_SELECTOR@22..24 0: COLON@22..24 ":" [] [Whitespace(" ")] 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 67c5460f7a65..ade9c4a21d86 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 @@ -94,7 +94,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@30..31 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@31..34 "div" [] [], }, }, @@ -140,7 +140,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@54..55 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@55..58 "div" [] [], }, }, @@ -186,7 +186,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@77..78 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@78..81 "div" [] [], }, }, @@ -199,7 +199,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@82..83 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@83..89 "class" [] [Whitespace(" ")], }, }, @@ -280,7 +280,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@30..34 0: CSS_CLASS_SELECTOR@30..34 0: DOT@30..31 "." [] [] - 1: CSS_IDENTIFIER@31..34 + 1: CSS_CUSTOM_IDENTIFIER@31..34 0: IDENT@31..34 "div" [] [] 3: CSS_BOGUS@34..42 0: COMMA@34..36 "," [] [Whitespace(" ")] @@ -309,7 +309,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@54..58 0: CSS_CLASS_SELECTOR@54..58 0: DOT@54..55 "." [] [] - 1: CSS_IDENTIFIER@55..58 + 1: CSS_CUSTOM_IDENTIFIER@55..58 0: IDENT@55..58 "div" [] [] 3: CSS_BOGUS@58..67 0: COMMA@58..60 "," [] [Whitespace(" ")] @@ -338,7 +338,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@77..81 0: CSS_CLASS_SELECTOR@77..81 0: DOT@77..78 "." [] [] - 1: CSS_IDENTIFIER@78..81 + 1: CSS_CUSTOM_IDENTIFIER@78..81 0: IDENT@78..81 "div" [] [] 1: CSS_SPACE_LITERAL@81..82 " " [] [] 2: CSS_COMPOUND_SELECTOR@82..89 @@ -347,7 +347,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@82..89 0: CSS_CLASS_SELECTOR@82..89 0: DOT@82..83 "." [] [] - 1: CSS_IDENTIFIER@83..89 + 1: CSS_CUSTOM_IDENTIFIER@83..89 0: IDENT@83..89 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@89..91 0: L_CURLY@89..90 "{" [] [] 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 3b751240cb1d..18705283f977 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 @@ -27,7 +27,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@0..1 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1..9 "selector" [] [], }, }, @@ -61,7 +61,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@0..9 0: CSS_CLASS_SELECTOR@0..9 0: DOT@0..1 "." [] [] - 1: CSS_IDENTIFIER@1..9 + 1: CSS_CUSTOM_IDENTIFIER@1..9 0: IDENT@1..9 "selector" [] [] 1: COMMA@9..11 "," [] [Whitespace(" ")] 2: (empty) 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 474a8e9ed26e..f7cb0793c698 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 @@ -25,7 +25,7 @@ CssRoot { at_token: AT@0..1 "@" [] [], rule: CssColorProfileAtRule { color_profile_token: COLOR_PROFILE_KW@1..15 "color-profile" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@15..25 "--fogra39" [] [Whitespace(" ")], }, block: CssDeclarationListBlock { @@ -39,7 +39,7 @@ CssRoot { at_token: AT@29..32 "@" [Newline("\n"), Newline("\n")] [], rule: CssColorProfileAtRule { color_profile_token: COLOR_PROFILE_KW@32..46 "color-profile" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@46..58 "device-cmyk" [] [Whitespace(" ")], }, block: CssDeclarationListBlock { @@ -53,7 +53,7 @@ CssRoot { at_token: AT@62..65 "@" [Newline("\n"), Newline("\n")] [], rule: CssColorProfileAtRule { color_profile_token: COLOR_PROFILE_KW@65..79 "color-profile" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@79..91 "DEVICE-CMYK" [] [Whitespace(" ")], }, block: CssDeclarationListBlock { @@ -78,7 +78,7 @@ CssRoot { 0: AT@0..1 "@" [] [] 1: CSS_COLOR_PROFILE_AT_RULE@1..29 0: COLOR_PROFILE_KW@1..15 "color-profile" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@15..25 + 1: CSS_CUSTOM_IDENTIFIER@15..25 0: IDENT@15..25 "--fogra39" [] [Whitespace(" ")] 2: CSS_DECLARATION_LIST_BLOCK@25..29 0: L_CURLY@25..28 "{" [] [Whitespace(" ")] @@ -88,7 +88,7 @@ CssRoot { 0: AT@29..32 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_COLOR_PROFILE_AT_RULE@32..62 0: COLOR_PROFILE_KW@32..46 "color-profile" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@46..58 + 1: CSS_CUSTOM_IDENTIFIER@46..58 0: IDENT@46..58 "device-cmyk" [] [Whitespace(" ")] 2: CSS_DECLARATION_LIST_BLOCK@58..62 0: L_CURLY@58..61 "{" [] [Whitespace(" ")] @@ -98,7 +98,7 @@ CssRoot { 0: AT@62..65 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_COLOR_PROFILE_AT_RULE@65..95 0: COLOR_PROFILE_KW@65..79 "color-profile" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@79..91 + 1: CSS_CUSTOM_IDENTIFIER@79..91 0: IDENT@79..91 "DEVICE-CMYK" [] [Whitespace(" ")] 2: CSS_DECLARATION_LIST_BLOCK@91..95 0: L_CURLY@91..94 "{" [] [Whitespace(" ")] 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 1d5c77c20a8d..1702355d1d1c 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 @@ CssRoot { at_token: AT@0..1 "@" [] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@1..11 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@11..16 "name" [] [Whitespace(" ")], }, query: CssContainerNotQuery { @@ -89,7 +89,7 @@ CssRoot { at_token: AT@41..44 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@44..54 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@54..64 "my-layout" [] [Whitespace(" ")], }, query: CssContainerSizeFeatureInParens { @@ -123,7 +123,7 @@ CssRoot { at_token: AT@89..92 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@92..102 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@102..107 "card" [] [Whitespace(" ")], }, query: CssContainerOrQuery { @@ -209,7 +209,7 @@ CssRoot { at_token: AT@198..201 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@201..211 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@211..216 "card" [] [Whitespace(" ")], }, query: CssContainerAndQuery { @@ -414,7 +414,7 @@ CssRoot { at_token: AT@419..422 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@422..432 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@432..440 "sidebar" [] [Whitespace(" ")], }, query: CssContainerSizeFeatureInParens { @@ -446,7 +446,7 @@ CssRoot { at_token: AT@463..466 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@466..476 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@476..481 "test" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -477,7 +477,7 @@ CssRoot { at_token: AT@511..514 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@514..524 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@524..529 "style" [] [], }, query: CssContainerSizeFeatureInParens { @@ -504,7 +504,7 @@ CssRoot { at_token: AT@554..557 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@557..567 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@567..572 "card" [] [Whitespace(" ")], }, query: CssContainerSizeFeatureInParens { @@ -538,7 +538,7 @@ CssRoot { at_token: AT@597..600 "@" [Newline("\n"), Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@600..610 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@610..615 "style" [] [], }, query: CssContainerSizeFeatureInParens { @@ -687,7 +687,7 @@ CssRoot { 0: AT@0..1 "@" [] [] 1: CSS_CONTAINER_AT_RULE@1..41 0: CONTAINER_KW@1..11 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@11..16 + 1: CSS_CUSTOM_IDENTIFIER@11..16 0: IDENT@11..16 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_NOT_QUERY@16..37 0: NOT_KW@16..20 "not" [] [Whitespace(" ")] @@ -712,7 +712,7 @@ CssRoot { 0: AT@41..44 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@44..89 0: CONTAINER_KW@44..54 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@54..64 + 1: CSS_CUSTOM_IDENTIFIER@54..64 0: IDENT@54..64 "my-layout" [] [Whitespace(" ")] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@64..85 0: L_PAREN@64..65 "(" [] [] @@ -735,7 +735,7 @@ CssRoot { 0: AT@89..92 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@92..161 0: CONTAINER_KW@92..102 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@102..107 + 1: CSS_CUSTOM_IDENTIFIER@102..107 0: IDENT@102..107 "card" [] [Whitespace(" ")] 2: CSS_CONTAINER_OR_QUERY@107..157 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@107..128 @@ -794,7 +794,7 @@ CssRoot { 0: AT@198..201 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@201..266 0: CONTAINER_KW@201..211 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@211..216 + 1: CSS_CUSTOM_IDENTIFIER@211..216 0: IDENT@211..216 "card" [] [Whitespace(" ")] 2: CSS_CONTAINER_AND_QUERY@216..262 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@216..237 @@ -934,7 +934,7 @@ CssRoot { 0: AT@419..422 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@422..463 0: CONTAINER_KW@422..432 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@432..440 + 1: CSS_CUSTOM_IDENTIFIER@432..440 0: IDENT@432..440 "sidebar" [] [Whitespace(" ")] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@440..459 0: L_PAREN@440..441 "(" [] [] @@ -956,7 +956,7 @@ CssRoot { 0: AT@463..466 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@466..511 0: CONTAINER_KW@466..476 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@476..481 + 1: CSS_CUSTOM_IDENTIFIER@476..481 0: IDENT@476..481 "test" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@481..507 0: STYLE_KW@481..486 "style" [] [] @@ -978,7 +978,7 @@ CssRoot { 0: AT@511..514 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@514..554 0: CONTAINER_KW@514..524 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@524..529 + 1: CSS_CUSTOM_IDENTIFIER@524..529 0: IDENT@524..529 "style" [] [] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@529..550 0: L_PAREN@529..530 "(" [] [] @@ -997,7 +997,7 @@ CssRoot { 0: AT@554..557 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@557..597 0: CONTAINER_KW@557..567 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@567..572 + 1: CSS_CUSTOM_IDENTIFIER@567..572 0: IDENT@567..572 "card" [] [Whitespace(" ")] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@572..593 0: L_PAREN@572..573 "(" [] [] @@ -1020,7 +1020,7 @@ CssRoot { 0: AT@597..600 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@600..640 0: CONTAINER_KW@600..610 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@610..615 + 1: CSS_CUSTOM_IDENTIFIER@610..615 0: IDENT@610..615 "style" [] [] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@615..636 0: L_PAREN@615..616 "(" [] [] 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 4c3a7cb73e5d..ed00211e4d06 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 @@ -44,7 +44,7 @@ CssRoot { at_token: AT@0..1 "@" [] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@1..11 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@11..17 "name" [] [Whitespace(" ")], }, query: CssContainerSizeFeatureInParens { @@ -78,7 +78,7 @@ CssRoot { at_token: AT@38..40 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@40..50 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@50..56 "name" [] [Whitespace(" ")], }, query: CssContainerOrQuery { @@ -181,7 +181,7 @@ CssRoot { at_token: AT@138..140 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@140..150 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@150..156 "name" [] [Whitespace(" ")], }, query: CssContainerAndQuery { @@ -284,7 +284,7 @@ CssRoot { at_token: AT@241..243 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@243..253 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@253..259 "name" [] [Whitespace(" ")], }, query: CssContainerAndQuery { @@ -368,7 +368,7 @@ CssRoot { at_token: AT@330..332 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@332..342 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@342..348 "name" [] [Whitespace(" ")], }, query: CssContainerAndQuery { @@ -459,7 +459,7 @@ CssRoot { at_token: AT@425..427 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@427..437 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@437..443 "name" [] [Whitespace(" ")], }, query: CssContainerAndQuery { @@ -573,7 +573,7 @@ CssRoot { at_token: AT@541..543 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@543..553 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@553..558 "name" [] [Whitespace(" ")], }, query: CssContainerNotQuery { @@ -637,7 +637,7 @@ CssRoot { at_token: AT@606..608 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@608..618 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@618..623 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -675,7 +675,7 @@ CssRoot { at_token: AT@650..652 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@652..662 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@662..667 "style" [] [], }, query: CssContainerSizeFeatureInParens { @@ -702,7 +702,7 @@ CssRoot { at_token: AT@692..694 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@694..704 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@704..709 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -756,7 +756,7 @@ CssRoot { at_token: AT@747..749 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@749..759 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@759..764 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -833,7 +833,7 @@ CssRoot { at_token: AT@820..822 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@822..832 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@832..837 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -894,7 +894,7 @@ CssRoot { at_token: AT@881..883 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@883..893 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@893..898 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -962,7 +962,7 @@ CssRoot { at_token: AT@948..950 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@950..960 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@960..965 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -1053,7 +1053,7 @@ CssRoot { at_token: AT@1039..1041 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@1041..1051 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1051..1056 "name" [] [Whitespace(" ")], }, query: CssContainerStyleQueryInParens { @@ -1098,7 +1098,7 @@ CssRoot { at_token: AT@1088..1090 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@1090..1100 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1100..1105 "name" [] [Whitespace(" ")], }, query: CssContainerAndQuery { @@ -1212,7 +1212,7 @@ CssRoot { at_token: AT@1201..1203 "@" [Newline("\n")] [], rule: CssContainerAtRule { container_token: CONTAINER_KW@1203..1213 "container" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1213..1219 "name" [] [Whitespace(" ")], }, query: CssContainerSizeFeatureInParens { @@ -1246,7 +1246,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@1238..1241 "#" [Newline("\n"), Whitespace("\t")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1241..1247 "inner" [] [Whitespace(" ")], }, }, @@ -1326,7 +1326,7 @@ CssRoot { 0: AT@0..1 "@" [] [] 1: CSS_CONTAINER_AT_RULE@1..38 0: CONTAINER_KW@1..11 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@11..17 + 1: CSS_CUSTOM_IDENTIFIER@11..17 0: IDENT@11..17 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@17..34 0: L_PAREN@17..18 "(" [] [] @@ -1349,7 +1349,7 @@ CssRoot { 0: AT@38..40 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@40..138 0: CONTAINER_KW@40..50 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@50..56 + 1: CSS_CUSTOM_IDENTIFIER@50..56 0: IDENT@50..56 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_OR_QUERY@56..134 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@56..73 @@ -1417,7 +1417,7 @@ CssRoot { 0: AT@138..140 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@140..241 0: CONTAINER_KW@140..150 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@150..156 + 1: CSS_CUSTOM_IDENTIFIER@150..156 0: IDENT@150..156 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_AND_QUERY@156..237 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@156..173 @@ -1485,7 +1485,7 @@ CssRoot { 0: AT@241..243 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@243..330 0: CONTAINER_KW@243..253 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@253..259 + 1: CSS_CUSTOM_IDENTIFIER@253..259 0: IDENT@253..259 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_AND_QUERY@259..326 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@259..276 @@ -1541,7 +1541,7 @@ CssRoot { 0: AT@330..332 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@332..425 0: CONTAINER_KW@332..342 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@342..348 + 1: CSS_CUSTOM_IDENTIFIER@342..348 0: IDENT@342..348 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_AND_QUERY@348..421 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@348..365 @@ -1602,7 +1602,7 @@ CssRoot { 0: AT@425..427 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@427..541 0: CONTAINER_KW@427..437 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@437..443 + 1: CSS_CUSTOM_IDENTIFIER@437..443 0: IDENT@437..443 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_AND_QUERY@443..537 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@443..460 @@ -1678,7 +1678,7 @@ CssRoot { 0: AT@541..543 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@543..606 0: CONTAINER_KW@543..553 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@553..558 + 1: CSS_CUSTOM_IDENTIFIER@553..558 0: IDENT@553..558 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_NOT_QUERY@558..602 0: NOT_KW@558..562 "not" [] [Whitespace(" ")] @@ -1721,7 +1721,7 @@ CssRoot { 0: AT@606..608 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@608..650 0: CONTAINER_KW@608..618 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@618..623 + 1: CSS_CUSTOM_IDENTIFIER@618..623 0: IDENT@618..623 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@623..646 0: STYLE_KW@623..628 "style" [] [] @@ -1748,7 +1748,7 @@ CssRoot { 0: AT@650..652 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@652..692 0: CONTAINER_KW@652..662 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@662..667 + 1: CSS_CUSTOM_IDENTIFIER@662..667 0: IDENT@662..667 "style" [] [] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@667..690 0: L_PAREN@667..668 "(" [] [] @@ -1767,7 +1767,7 @@ CssRoot { 0: AT@692..694 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@694..747 0: CONTAINER_KW@694..704 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@704..709 + 1: CSS_CUSTOM_IDENTIFIER@704..709 0: IDENT@704..709 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@709..743 0: STYLE_KW@709..714 "style" [] [] @@ -1805,7 +1805,7 @@ CssRoot { 0: AT@747..749 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@749..820 0: CONTAINER_KW@749..759 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@759..764 + 1: CSS_CUSTOM_IDENTIFIER@759..764 0: IDENT@759..764 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@764..816 0: STYLE_KW@764..769 "style" [] [] @@ -1859,7 +1859,7 @@ CssRoot { 0: AT@820..822 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@822..881 0: CONTAINER_KW@822..832 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@832..837 + 1: CSS_CUSTOM_IDENTIFIER@832..837 0: IDENT@832..837 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@837..877 0: STYLE_KW@837..842 "style" [] [] @@ -1902,7 +1902,7 @@ CssRoot { 0: AT@881..883 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@883..948 0: CONTAINER_KW@883..893 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@893..898 + 1: CSS_CUSTOM_IDENTIFIER@893..898 0: IDENT@893..898 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@898..944 0: STYLE_KW@898..903 "style" [] [] @@ -1950,7 +1950,7 @@ CssRoot { 0: AT@948..950 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@950..1039 0: CONTAINER_KW@950..960 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@960..965 + 1: CSS_CUSTOM_IDENTIFIER@960..965 0: IDENT@960..965 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@965..1035 0: STYLE_KW@965..970 "style" [] [] @@ -2014,7 +2014,7 @@ CssRoot { 0: AT@1039..1041 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@1041..1088 0: CONTAINER_KW@1041..1051 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@1051..1056 + 1: CSS_CUSTOM_IDENTIFIER@1051..1056 0: IDENT@1051..1056 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_STYLE_QUERY_IN_PARENS@1056..1084 0: STYLE_KW@1056..1061 "style" [] [] @@ -2046,7 +2046,7 @@ CssRoot { 0: AT@1088..1090 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@1090..1201 0: CONTAINER_KW@1090..1100 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@1100..1105 + 1: CSS_CUSTOM_IDENTIFIER@1100..1105 0: IDENT@1100..1105 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_AND_QUERY@1105..1197 0: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@1105..1122 @@ -2125,7 +2125,7 @@ CssRoot { 0: AT@1201..1203 "@" [Newline("\n")] [] 1: CSS_CONTAINER_AT_RULE@1203..1321 0: CONTAINER_KW@1203..1213 "container" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@1213..1219 + 1: CSS_CUSTOM_IDENTIFIER@1213..1219 0: IDENT@1213..1219 "name" [] [Whitespace(" ")] 2: CSS_CONTAINER_SIZE_FEATURE_IN_PARENS@1219..1237 0: L_PAREN@1219..1220 "(" [] [] @@ -2151,7 +2151,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1238..1247 0: CSS_ID_SELECTOR@1238..1247 0: HASH@1238..1241 "#" [Newline("\n"), Whitespace("\t")] [] - 1: CSS_IDENTIFIER@1241..1247 + 1: CSS_CUSTOM_IDENTIFIER@1241..1247 0: IDENT@1241..1247 "inner" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@1247..1280 0: L_CURLY@1247..1248 "{" [] [] 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 2a910bdcd613..7bce3f73b56e 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 @@ -21,7 +21,7 @@ CssRoot { at_token: AT@0..1 "@" [] [], rule: CssCounterStyleAtRule { counter_style_token: COUNTER_STYLE_KW@1..15 "counter-style" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@15..22 "thumbs" [] [Whitespace(" ")], }, block: CssDeclarationListBlock { @@ -46,7 +46,7 @@ CssRoot { 0: AT@0..1 "@" [] [] 1: CSS_COUNTER_STYLE_AT_RULE@1..26 0: COUNTER_STYLE_KW@1..15 "counter-style" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@15..22 + 1: CSS_CUSTOM_IDENTIFIER@15..22 0: IDENT@15..22 "thumbs" [] [Whitespace(" ")] 2: CSS_DECLARATION_LIST_BLOCK@22..26 0: L_CURLY@22..25 "{" [] [Whitespace(" ")] diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css index 2eb2ad7482d4..7884bdd25e9f 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css +++ b/crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css @@ -1 +1,2 @@ -@font-palette-values ident { } +@font-palette-values --ident { } +@font-palette-values --AnyCASInG-works { } 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 5929268ff94a..b08813f17e4f 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 @@ -6,7 +6,8 @@ expression: snapshot ## Input ```css -@font-palette-values ident { } +@font-palette-values --ident { } +@font-palette-values --AnyCASInG-works { } ``` @@ -21,38 +22,62 @@ CssRoot { at_token: AT@0..1 "@" [] [], rule: CssFontPaletteValuesAtRule { font_palette_values_token: FONT_PALETTE_VALUES_KW@1..21 "font-palette-values" [] [Whitespace(" ")], - name: CssIdentifier { - value_token: IDENT@21..27 "ident" [] [Whitespace(" ")], + name: CssDashedIdentifier { + value_token: IDENT@21..29 "--ident" [] [Whitespace(" ")], }, block: CssDeclarationListBlock { - l_curly_token: L_CURLY@27..30 "{" [] [Whitespace(" ")], + l_curly_token: L_CURLY@29..32 "{" [] [Whitespace(" ")], declarations: CssDeclarationList [], - r_curly_token: R_CURLY@30..31 "}" [] [], + r_curly_token: R_CURLY@32..33 "}" [] [], + }, + }, + }, + CssAtRule { + at_token: AT@33..35 "@" [Newline("\n")] [], + rule: CssFontPaletteValuesAtRule { + font_palette_values_token: FONT_PALETTE_VALUES_KW@35..55 "font-palette-values" [] [Whitespace(" ")], + name: CssDashedIdentifier { + value_token: IDENT@55..73 "--AnyCASInG-works" [] [Whitespace(" ")], + }, + block: CssDeclarationListBlock { + l_curly_token: L_CURLY@73..76 "{" [] [Whitespace(" ")], + declarations: CssDeclarationList [], + r_curly_token: R_CURLY@76..77 "}" [] [], }, }, }, ], - eof_token: EOF@31..32 "" [Newline("\n")] [], + eof_token: EOF@77..78 "" [Newline("\n")] [], } ``` ## CST ``` -0: CSS_ROOT@0..32 +0: CSS_ROOT@0..78 0: (empty) - 1: CSS_RULE_LIST@0..31 - 0: CSS_AT_RULE@0..31 + 1: CSS_RULE_LIST@0..77 + 0: CSS_AT_RULE@0..33 0: AT@0..1 "@" [] [] - 1: CSS_FONT_PALETTE_VALUES_AT_RULE@1..31 + 1: CSS_FONT_PALETTE_VALUES_AT_RULE@1..33 0: FONT_PALETTE_VALUES_KW@1..21 "font-palette-values" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@21..27 - 0: IDENT@21..27 "ident" [] [Whitespace(" ")] - 2: CSS_DECLARATION_LIST_BLOCK@27..31 - 0: L_CURLY@27..30 "{" [] [Whitespace(" ")] - 1: CSS_DECLARATION_LIST@30..30 - 2: R_CURLY@30..31 "}" [] [] - 2: EOF@31..32 "" [Newline("\n")] [] + 1: CSS_DASHED_IDENTIFIER@21..29 + 0: IDENT@21..29 "--ident" [] [Whitespace(" ")] + 2: CSS_DECLARATION_LIST_BLOCK@29..33 + 0: L_CURLY@29..32 "{" [] [Whitespace(" ")] + 1: CSS_DECLARATION_LIST@32..32 + 2: R_CURLY@32..33 "}" [] [] + 1: CSS_AT_RULE@33..77 + 0: AT@33..35 "@" [Newline("\n")] [] + 1: CSS_FONT_PALETTE_VALUES_AT_RULE@35..77 + 0: FONT_PALETTE_VALUES_KW@35..55 "font-palette-values" [] [Whitespace(" ")] + 1: CSS_DASHED_IDENTIFIER@55..73 + 0: IDENT@55..73 "--AnyCASInG-works" [] [Whitespace(" ")] + 2: CSS_DECLARATION_LIST_BLOCK@73..77 + 0: L_CURLY@73..76 "{" [] [Whitespace(" ")] + 1: CSS_DECLARATION_LIST@76..76 + 2: R_CURLY@76..77 "}" [] [] + 2: EOF@77..78 "" [Newline("\n")] [] ``` 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 cab45876126b..b7574783e960 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 @@ -74,7 +74,7 @@ CssRoot { at_token: AT@0..1 "@" [] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@1..11 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@11..15 "foo" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -102,7 +102,7 @@ CssRoot { at_token: AT@59..61 "@" [Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@61..74 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@74..81 "foo" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -116,7 +116,7 @@ CssRoot { at_token: AT@94..97 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@97..107 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@107..115 "slidein" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -219,7 +219,7 @@ CssRoot { at_token: AT@199..202 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@202..216 "-ms-keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@216..227 "identifier" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -411,7 +411,7 @@ CssRoot { at_token: AT@335..338 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@338..348 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@348..352 "FOO" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -453,7 +453,7 @@ CssRoot { at_token: AT@402..404 "@" [Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@404..422 "-webkit-keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@422..434 "slide-right" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -610,7 +610,7 @@ CssRoot { at_token: AT@576..579 "@" [Newline("\n"), Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@579..594 "-moz-keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@594..605 "slidein-up" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -724,7 +724,7 @@ CssRoot { 0: AT@0..1 "@" [] [] 1: CSS_KEYFRAMES_AT_RULE@1..28 0: KEYFRAMES_KW@1..11 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@11..15 + 1: CSS_CUSTOM_IDENTIFIER@11..15 0: IDENT@11..15 "foo" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@15..28 0: L_CURLY@15..27 "{" [] [Whitespace(" "), Comments("/* ... */"), Whitespace(" ")] @@ -744,7 +744,7 @@ CssRoot { 0: AT@59..61 "@" [Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@61..94 0: KEYFRAMES_KW@61..74 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@74..81 + 1: CSS_CUSTOM_IDENTIFIER@74..81 0: IDENT@74..81 "foo" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@81..94 0: L_CURLY@81..93 "{" [] [Whitespace(" "), Comments("/* ... */"), Whitespace(" ")] @@ -754,7 +754,7 @@ CssRoot { 0: AT@94..97 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@97..199 0: KEYFRAMES_KW@97..107 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@107..115 + 1: CSS_CUSTOM_IDENTIFIER@107..115 0: IDENT@107..115 "slidein" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@115..199 0: L_CURLY@115..116 "{" [] [] @@ -820,7 +820,7 @@ CssRoot { 0: AT@199..202 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@202..335 0: KEYFRAMES_KW@202..216 "-ms-keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@216..227 + 1: CSS_CUSTOM_IDENTIFIER@216..227 0: IDENT@216..227 "identifier" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@227..335 0: L_CURLY@227..228 "{" [] [] @@ -945,7 +945,7 @@ CssRoot { 0: AT@335..338 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@338..354 0: KEYFRAMES_KW@338..348 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@348..352 + 1: CSS_CUSTOM_IDENTIFIER@348..352 0: IDENT@348..352 "FOO" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@352..354 0: L_CURLY@352..353 "{" [] [] @@ -975,7 +975,7 @@ CssRoot { 0: AT@402..404 "@" [Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@404..576 0: KEYFRAMES_KW@404..422 "-webkit-keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@422..434 + 1: CSS_CUSTOM_IDENTIFIER@422..434 0: IDENT@422..434 "slide-right" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@434..576 0: L_CURLY@434..435 "{" [] [] @@ -1077,7 +1077,7 @@ CssRoot { 0: AT@576..579 "@" [Newline("\n"), Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@579..689 0: KEYFRAMES_KW@579..594 "-moz-keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@594..605 + 1: CSS_CUSTOM_IDENTIFIER@594..605 0: IDENT@594..605 "slidein-up" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@605..689 0: L_CURLY@605..606 "{" [] [] 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 950e5d471567..c43b870ca9a5 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 @@ -156,7 +156,7 @@ CssRoot { at_token: AT@89..92 "@" [Newline("\n"), Whitespace("\t")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@92..102 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@102..113 "slide-left" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -250,7 +250,7 @@ CssRoot { at_token: AT@193..196 "@" [Newline("\n"), Whitespace("\t")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@196..206 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@206..217 "slide-left" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -431,7 +431,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@404..407 "." [Newline("\n"), Whitespace("\t")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@407..413 "title" [] [Whitespace(" ")], }, }, @@ -885,7 +885,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@887..890 "." [Newline("\n"), Whitespace("\t")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@890..896 "title" [] [Whitespace(" ")], }, }, @@ -1048,7 +1048,7 @@ CssRoot { 0: AT@89..92 "@" [Newline("\n"), Whitespace("\t")] [] 1: CSS_KEYFRAMES_AT_RULE@92..171 0: KEYFRAMES_KW@92..102 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@102..113 + 1: CSS_CUSTOM_IDENTIFIER@102..113 0: IDENT@102..113 "slide-left" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@113..171 0: L_CURLY@113..114 "{" [] [] @@ -1109,7 +1109,7 @@ CssRoot { 0: AT@193..196 "@" [Newline("\n"), Whitespace("\t")] [] 1: CSS_KEYFRAMES_AT_RULE@196..277 0: KEYFRAMES_KW@196..206 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@206..217 + 1: CSS_CUSTOM_IDENTIFIER@206..217 0: IDENT@206..217 "slide-left" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@217..277 0: L_CURLY@217..218 "{" [] [] @@ -1230,7 +1230,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@404..413 0: CSS_CLASS_SELECTOR@404..413 0: DOT@404..407 "." [Newline("\n"), Whitespace("\t")] [] - 1: CSS_IDENTIFIER@407..413 + 1: CSS_CUSTOM_IDENTIFIER@407..413 0: IDENT@407..413 "title" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@413..434 0: L_CURLY@413..415 "{" [] [Whitespace(" ")] @@ -1525,7 +1525,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@887..896 0: CSS_CLASS_SELECTOR@887..896 0: DOT@887..890 "." [Newline("\n"), Whitespace("\t")] [] - 1: CSS_IDENTIFIER@890..896 + 1: CSS_CUSTOM_IDENTIFIER@890..896 0: IDENT@890..896 "title" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@896..917 0: L_CURLY@896..898 "{" [] [Whitespace(" ")] 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 e786b85cfff4..8d970686f398 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 @@ -892,7 +892,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@768..774 "#" [Newline("\n"), Whitespace(" ")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@774..780 "inner" [] [Whitespace(" ")], }, }, @@ -1535,7 +1535,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@768..780 0: CSS_ID_SELECTOR@768..780 0: HASH@768..774 "#" [Newline("\n"), Whitespace(" ")] [] - 1: CSS_IDENTIFIER@774..780 + 1: CSS_CUSTOM_IDENTIFIER@774..780 0: IDENT@774..780 "inner" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@780..816 0: L_CURLY@780..781 "{" [] [] 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 64d259ddff7a..c1316d7617a8 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 @@ -315,7 +315,7 @@ CssRoot { page_token: PAGE_KW@154..159 "page" [] [Whitespace(" ")], selectors: CssPageSelectorList [ CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@159..174 "LandscapeTable" [] [Whitespace(" ")], }, pseudos: CssPageSelectorPseudoList [], @@ -334,7 +334,7 @@ CssRoot { page_token: PAGE_KW@178..183 "page" [] [Whitespace(" ")], selectors: CssPageSelectorList [ CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@183..200 "CompanyLetterHead" [] [], }, pseudos: CssPageSelectorPseudoList [ @@ -380,14 +380,14 @@ CssRoot { page_token: PAGE_KW@261..266 "page" [] [Whitespace(" ")], selectors: CssPageSelectorList [ CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@266..269 "toc" [] [], }, pseudos: CssPageSelectorPseudoList [], }, COMMA@269..271 "," [] [Whitespace(" ")], CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@271..277 "index" [] [Whitespace(" ")], }, pseudos: CssPageSelectorPseudoList [], @@ -714,7 +714,7 @@ CssRoot { page_token: PAGE_KW@616..621 "page" [] [Whitespace(" ")], selectors: CssPageSelectorList [ CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@621..627 "artsy" [] [Whitespace(" ")], }, pseudos: CssPageSelectorPseudoList [], @@ -733,7 +733,7 @@ CssRoot { page_token: PAGE_KW@631..636 "page" [] [Whitespace(" ")], selectors: CssPageSelectorList [ CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@636..641 "artsy" [] [], }, pseudos: CssPageSelectorPseudoList [ @@ -757,7 +757,7 @@ CssRoot { page_token: PAGE_KW@651..656 "page" [] [Whitespace(" ")], selectors: CssPageSelectorList [ CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@656..661 "artsy" [] [], }, pseudos: CssPageSelectorPseudoList [ @@ -1219,7 +1219,7 @@ CssRoot { 0: PAGE_KW@154..159 "page" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_LIST@159..174 0: CSS_PAGE_SELECTOR@159..174 - 0: CSS_IDENTIFIER@159..174 + 0: CSS_CUSTOM_IDENTIFIER@159..174 0: IDENT@159..174 "LandscapeTable" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@174..174 2: CSS_PAGE_AT_RULE_BLOCK@174..176 @@ -1232,7 +1232,7 @@ CssRoot { 0: PAGE_KW@178..183 "page" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_LIST@183..207 0: CSS_PAGE_SELECTOR@183..207 - 0: CSS_IDENTIFIER@183..200 + 0: CSS_CUSTOM_IDENTIFIER@183..200 0: IDENT@183..200 "CompanyLetterHead" [] [] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@200..207 0: CSS_PAGE_SELECTOR_PSEUDO@200..207 @@ -1263,12 +1263,12 @@ CssRoot { 0: PAGE_KW@261..266 "page" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_LIST@266..277 0: CSS_PAGE_SELECTOR@266..269 - 0: CSS_IDENTIFIER@266..269 + 0: CSS_CUSTOM_IDENTIFIER@266..269 0: IDENT@266..269 "toc" [] [] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@269..269 1: COMMA@269..271 "," [] [Whitespace(" ")] 2: CSS_PAGE_SELECTOR@271..277 - 0: CSS_IDENTIFIER@271..277 + 0: CSS_CUSTOM_IDENTIFIER@271..277 0: IDENT@271..277 "index" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@277..277 2: CSS_PAGE_AT_RULE_BLOCK@277..279 @@ -1496,7 +1496,7 @@ CssRoot { 0: PAGE_KW@616..621 "page" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_LIST@621..627 0: CSS_PAGE_SELECTOR@621..627 - 0: CSS_IDENTIFIER@621..627 + 0: CSS_CUSTOM_IDENTIFIER@621..627 0: IDENT@621..627 "artsy" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@627..627 2: CSS_PAGE_AT_RULE_BLOCK@627..629 @@ -1509,7 +1509,7 @@ CssRoot { 0: PAGE_KW@631..636 "page" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_LIST@636..647 0: CSS_PAGE_SELECTOR@636..647 - 0: CSS_IDENTIFIER@636..641 + 0: CSS_CUSTOM_IDENTIFIER@636..641 0: IDENT@636..641 "artsy" [] [] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@641..647 0: CSS_PAGE_SELECTOR_PSEUDO@641..647 @@ -1525,7 +1525,7 @@ CssRoot { 0: PAGE_KW@651..656 "page" [] [Whitespace(" ")] 1: CSS_PAGE_SELECTOR_LIST@656..668 0: CSS_PAGE_SELECTOR@656..668 - 0: CSS_IDENTIFIER@656..661 + 0: CSS_CUSTOM_IDENTIFIER@656..661 0: IDENT@656..661 "artsy" [] [] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@661..668 0: CSS_PAGE_SELECTOR_PSEUDO@661..668 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 9ba4eea2acf9..b5ecd514554f 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 @@ -167,7 +167,7 @@ CssRoot { }, COMMA@29..31 "," [] [Whitespace(" ")], CssPageSelector { - ty: CssIdentifier { + ty: CssCustomIdentifier { value_token: IDENT@31..35 "name" [] [], }, pseudos: CssPageSelectorPseudoList [ @@ -1718,7 +1718,7 @@ CssRoot { 1: BLANK_KW@24..29 "blank" [] [] 1: COMMA@29..31 "," [] [Whitespace(" ")] 2: CSS_PAGE_SELECTOR@31..59 - 0: CSS_IDENTIFIER@31..35 + 0: CSS_CUSTOM_IDENTIFIER@31..35 0: IDENT@31..35 "name" [] [] 1: CSS_PAGE_SELECTOR_PSEUDO_LIST@35..59 0: CSS_PAGE_SELECTOR_PSEUDO@35..41 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 13fa5e09709a..bee3620f0717 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 @@ -131,7 +131,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@97..98 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@98..110 "light-scheme" [] [], }, }, @@ -198,7 +198,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@201..202 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@202..210 "content" [] [Whitespace(" ")], }, }, @@ -265,7 +265,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@245..248 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@248..256 "content" [] [Whitespace(" ")], }, }, @@ -316,7 +316,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@286..287 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@287..299 "media-object" [] [], }, }, @@ -336,7 +336,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@305..306 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@306..314 "content" [] [Whitespace(" ")], }, }, @@ -403,7 +403,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@349..352 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@352..360 "content" [] [Whitespace(" ")], }, }, @@ -456,7 +456,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@393..394 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@394..402 "content" [] [Whitespace(" ")], }, }, @@ -523,7 +523,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@437..440 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@440..448 "content" [] [Whitespace(" ")], }, }, @@ -574,7 +574,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@478..479 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@479..484 "inner" [] [], }, }, @@ -591,7 +591,7 @@ CssRoot { at_token: AT@487..489 "@" [Newline("\n")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@489..499 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@499..509 "--my-anim" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -682,7 +682,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@569..570 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@570..582 "media-object" [] [], }, }, @@ -722,7 +722,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@600..601 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@601..609 "content" [] [Whitespace(" ")], }, }, @@ -820,7 +820,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@97..110 0: CSS_CLASS_SELECTOR@97..110 0: DOT@97..98 "." [] [] - 1: CSS_IDENTIFIER@98..110 + 1: CSS_CUSTOM_IDENTIFIER@98..110 0: IDENT@98..110 "light-scheme" [] [] 2: R_PAREN@110..112 ")" [] [Whitespace(" ")] 2: CSS_RULE_LIST_BLOCK@112..188 @@ -865,7 +865,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@201..210 0: CSS_CLASS_SELECTOR@201..210 0: DOT@201..202 "." [] [] - 1: CSS_IDENTIFIER@202..210 + 1: CSS_CUSTOM_IDENTIFIER@202..210 0: IDENT@202..210 "content" [] [Whitespace(" ")] 1: R_ANGLE@210..212 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@212..213 @@ -910,7 +910,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@245..256 0: CSS_CLASS_SELECTOR@245..256 0: DOT@245..248 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@248..256 + 1: CSS_CUSTOM_IDENTIFIER@248..256 0: IDENT@248..256 "content" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@256..274 0: L_CURLY@256..257 "{" [] [] @@ -943,7 +943,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@286..299 0: CSS_CLASS_SELECTOR@286..299 0: DOT@286..287 "." [] [] - 1: CSS_IDENTIFIER@287..299 + 1: CSS_CUSTOM_IDENTIFIER@287..299 0: IDENT@287..299 "media-object" [] [] 2: R_PAREN@299..301 ")" [] [Whitespace(" ")] 1: TO_KW@301..304 "to" [] [Whitespace(" ")] @@ -957,7 +957,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@305..314 0: CSS_CLASS_SELECTOR@305..314 0: DOT@305..306 "." [] [] - 1: CSS_IDENTIFIER@306..314 + 1: CSS_CUSTOM_IDENTIFIER@306..314 0: IDENT@306..314 "content" [] [Whitespace(" ")] 1: R_ANGLE@314..316 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@316..317 @@ -1002,7 +1002,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@349..360 0: CSS_CLASS_SELECTOR@349..360 0: DOT@349..352 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@352..360 + 1: CSS_CUSTOM_IDENTIFIER@352..360 0: IDENT@352..360 "content" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@360..378 0: L_CURLY@360..361 "{" [] [] @@ -1037,7 +1037,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@393..402 0: CSS_CLASS_SELECTOR@393..402 0: DOT@393..394 "." [] [] - 1: CSS_IDENTIFIER@394..402 + 1: CSS_CUSTOM_IDENTIFIER@394..402 0: IDENT@394..402 "content" [] [Whitespace(" ")] 1: R_ANGLE@402..404 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@404..405 @@ -1082,7 +1082,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@437..448 0: CSS_CLASS_SELECTOR@437..448 0: DOT@437..440 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@440..448 + 1: CSS_CUSTOM_IDENTIFIER@440..448 0: IDENT@440..448 "content" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@448..466 0: L_CURLY@448..449 "{" [] [] @@ -1115,7 +1115,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@478..484 0: CSS_ID_SELECTOR@478..484 0: HASH@478..479 "#" [] [] - 1: CSS_IDENTIFIER@479..484 + 1: CSS_CUSTOM_IDENTIFIER@479..484 0: IDENT@479..484 "inner" [] [] 2: R_PAREN@484..486 ")" [] [Whitespace(" ")] 2: CSS_RULE_LIST_BLOCK@486..559 @@ -1125,7 +1125,7 @@ CssRoot { 0: AT@487..489 "@" [Newline("\n")] [] 1: CSS_KEYFRAMES_AT_RULE@489..557 0: KEYFRAMES_KW@489..499 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@499..509 + 1: CSS_CUSTOM_IDENTIFIER@499..509 0: IDENT@499..509 "--my-anim" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@509..557 0: L_CURLY@509..510 "{" [] [] @@ -1184,7 +1184,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@569..582 0: CSS_CLASS_SELECTOR@569..582 0: DOT@569..570 "." [] [] - 1: CSS_IDENTIFIER@570..582 + 1: CSS_CUSTOM_IDENTIFIER@570..582 0: IDENT@570..582 "media-object" [] [] 1: COMMA@582..584 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@584..594 @@ -1211,7 +1211,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@600..609 0: CSS_CLASS_SELECTOR@600..609 0: DOT@600..601 "." [] [] - 1: CSS_IDENTIFIER@601..609 + 1: CSS_CUSTOM_IDENTIFIER@601..609 0: IDENT@601..609 "content" [] [Whitespace(" ")] 1: R_ANGLE@609..611 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@611..612 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 bdee5aa4a665..f44f43826a4b 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 @@ -1478,7 +1478,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1491..1492 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1492..1501 "selected" [] [Whitespace(" ")], }, }, @@ -2150,7 +2150,7 @@ CssRoot { at_token: AT@2098..2101 "@" [Newline("\n"), Whitespace("\t")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@2101..2111 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2111..2116 "anim" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -2271,10 +2271,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@2229..2238 "--varName" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@2229..2238 "--varName" [] [], }, ], }, @@ -2641,7 +2639,7 @@ CssRoot { at_token: AT@2492..2495 "@" [Newline("\n"), Whitespace("\t")] [], rule: CssKeyframesAtRule { keyframes_token: KEYFRAMES_KW@2495..2505 "keyframes" [] [Whitespace(" ")], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2505..2510 "anim" [] [Whitespace(" ")], }, block: CssKeyframesBlock { @@ -2980,7 +2978,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2823..2824 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2824..2833 "selected" [] [Whitespace(" ")], }, }, @@ -3154,10 +3152,8 @@ CssRoot { supports_token: SUPPORTS_KW@2993..3002 "supports" [] [Whitespace(" ")], condition: CssSupportsConditionInParens { l_paren_token: L_PAREN@3002..3003 "(" [] [], - condition: CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@3003..3008 "--var" [] [], - }, + condition: CssDashedIdentifier { + value_token: IDENT@3003..3008 "--var" [] [], }, r_paren_token: R_PAREN@3008..3010 ")" [] [Whitespace(" ")], }, @@ -4169,7 +4165,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1491..1501 0: CSS_CLASS_SELECTOR@1491..1501 0: DOT@1491..1492 "." [] [] - 1: CSS_IDENTIFIER@1492..1501 + 1: CSS_CUSTOM_IDENTIFIER@1492..1501 0: IDENT@1492..1501 "selected" [] [Whitespace(" ")] 1: PIPE2@1501..1504 "||" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@1504..1507 @@ -4613,7 +4609,7 @@ CssRoot { 0: AT@2098..2101 "@" [Newline("\n"), Whitespace("\t")] [] 1: CSS_KEYFRAMES_AT_RULE@2101..2177 0: KEYFRAMES_KW@2101..2111 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@2111..2116 + 1: CSS_CUSTOM_IDENTIFIER@2111..2116 0: IDENT@2111..2116 "anim" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@2116..2177 0: L_CURLY@2116..2117 "{" [] [] @@ -4696,9 +4692,8 @@ CssRoot { 0: CSS_PARAMETER@2229..2238 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@2229..2238 0: CSS_COMPONENT_VALUE_LIST@2229..2238 - 0: CSS_CUSTOM_PROPERTY@2229..2238 - 0: CSS_IDENTIFIER@2229..2238 - 0: IDENT@2229..2238 "--varName" [] [] + 0: CSS_DASHED_IDENTIFIER@2229..2238 + 0: IDENT@2229..2238 "--varName" [] [] 3: R_PAREN@2238..2239 ")" [] [] 3: (empty) 1: SEMICOLON@2239..2240 ";" [] [] @@ -4947,7 +4942,7 @@ CssRoot { 0: AT@2492..2495 "@" [Newline("\n"), Whitespace("\t")] [] 1: CSS_KEYFRAMES_AT_RULE@2495..2571 0: KEYFRAMES_KW@2495..2505 "keyframes" [] [Whitespace(" ")] - 1: CSS_IDENTIFIER@2505..2510 + 1: CSS_CUSTOM_IDENTIFIER@2505..2510 0: IDENT@2505..2510 "anim" [] [Whitespace(" ")] 2: CSS_KEYFRAMES_BLOCK@2510..2571 0: L_CURLY@2510..2511 "{" [] [] @@ -5173,7 +5168,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2823..2833 0: CSS_CLASS_SELECTOR@2823..2833 0: DOT@2823..2824 "." [] [] - 1: CSS_IDENTIFIER@2824..2833 + 1: CSS_CUSTOM_IDENTIFIER@2824..2833 0: IDENT@2824..2833 "selected" [] [Whitespace(" ")] 1: PIPE2@2833..2836 "||" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@2836..2839 @@ -5286,9 +5281,8 @@ CssRoot { 0: SUPPORTS_KW@2993..3002 "supports" [] [Whitespace(" ")] 1: CSS_SUPPORTS_CONDITION_IN_PARENS@3002..3010 0: L_PAREN@3002..3003 "(" [] [] - 1: CSS_CUSTOM_PROPERTY@3003..3008 - 0: CSS_IDENTIFIER@3003..3008 - 0: IDENT@3003..3008 "--var" [] [] + 1: CSS_DASHED_IDENTIFIER@3003..3008 + 0: IDENT@3003..3008 "--var" [] [] 2: R_PAREN@3008..3010 ")" [] [Whitespace(" ")] 2: CSS_RULE_LIST_BLOCK@3010..3037 0: L_CURLY@3010..3011 "{" [] [] 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 80137a72840e..258cf13a8840 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 @@ -25,7 +25,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@0..1 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1..8 "action" [] [Whitespace(" ")], }, }, @@ -57,7 +57,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@0..8 0: CSS_CLASS_SELECTOR@0..8 0: DOT@0..1 "." [] [] - 1: CSS_IDENTIFIER@1..8 + 1: CSS_CUSTOM_IDENTIFIER@1..8 0: IDENT@1..8 "action" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@8..10 0: L_CURLY@8..9 "{" [] [] 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 3bbaa511f200..b88d96e8544e 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 @@ -406,10 +406,8 @@ CssRoot { }, colon_token: COLON@203..205 ":" [] [Whitespace(" ")], value: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@205..213 "--custom" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@205..213 "--custom" [] [], }, ], important: missing (optional), @@ -492,10 +490,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@293..315 "--bs-border-radius-xxl" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@293..315 "--bs-border-radius-xxl" [] [], }, ], }, @@ -757,9 +753,8 @@ CssRoot { 0: IDENT@193..203 "prop1" [Newline("\n"), Whitespace(" ")] [] 1: COLON@203..205 ":" [] [Whitespace(" ")] 2: CSS_COMPONENT_VALUE_LIST@205..213 - 0: CSS_CUSTOM_PROPERTY@205..213 - 0: CSS_IDENTIFIER@205..213 - 0: IDENT@205..213 "--custom" [] [] + 0: CSS_DASHED_IDENTIFIER@205..213 + 0: IDENT@205..213 "--custom" [] [] 3: (empty) 1: SEMICOLON@213..214 ";" [] [] 2: R_CURLY@214..216 "}" [Newline("\n")] [] @@ -816,9 +811,8 @@ CssRoot { 0: CSS_PARAMETER@293..315 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@293..315 0: CSS_COMPONENT_VALUE_LIST@293..315 - 0: CSS_CUSTOM_PROPERTY@293..315 - 0: CSS_IDENTIFIER@293..315 - 0: IDENT@293..315 "--bs-border-radius-xxl" [] [] + 0: CSS_DASHED_IDENTIFIER@293..315 + 0: IDENT@293..315 "--bs-border-radius-xxl" [] [] 3: R_PAREN@315..317 ")" [] [Whitespace(" ")] 3: CSS_DECLARATION_IMPORTANT@317..327 0: BANG@317..318 "!" [] [] 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 fc1d6384452f..e76ece81f947 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 @@ -1071,10 +1071,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@612..619 "--width" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@612..619 "--width" [] [], }, ], }, @@ -1474,7 +1472,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@848..851 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@851..855 "bar" [] [Whitespace(" ")], }, }, @@ -1904,7 +1902,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1105..1108 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1108..1113 "fade" [] [Whitespace(" ")], }, }, @@ -2268,7 +2266,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1436..1439 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1439..1444 "fade" [] [Whitespace(" ")], }, }, @@ -2404,7 +2402,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1551..1554 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1554..1559 "type" [] [Whitespace(" ")], }, }, @@ -2513,7 +2511,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1708..1711 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1711..1716 "type" [] [Whitespace(" ")], }, }, @@ -2637,7 +2635,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@1837..1840 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1840..1845 "more" [] [Whitespace(" ")], }, }, @@ -3268,10 +3266,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@2279..2286 "--width" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@2279..2286 "--width" [] [], }, ], }, @@ -3338,10 +3334,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@2326..2333 "--width" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@2326..2333 "--width" [] [], }, ], }, @@ -3408,10 +3402,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@2368..2375 "--width" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@2368..2375 "--width" [] [], }, ], }, @@ -3478,10 +3470,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@2412..2419 "--width" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@2412..2419 "--width" [] [], }, ], }, @@ -3548,10 +3538,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@2459..2466 "--width" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@2459..2466 "--width" [] [], }, ], }, @@ -3596,7 +3584,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2477..2480 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2480..2488 "min-max" [] [Whitespace(" ")], }, }, @@ -3852,7 +3840,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2635..2638 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2638..2642 "rem" [] [Whitespace(" ")], }, }, @@ -3922,7 +3910,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2673..2676 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2676..2680 "sin" [] [Whitespace(" ")], }, }, @@ -4041,7 +4029,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2759..2762 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2762..2766 "cos" [] [Whitespace(" ")], }, }, @@ -4160,7 +4148,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2845..2848 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2848..2853 "asin" [] [Whitespace(" ")], }, }, @@ -4283,7 +4271,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2929..2932 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2932..2937 "acos" [] [Whitespace(" ")], }, }, @@ -4406,7 +4394,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3013..3016 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3016..3021 "atan" [] [Whitespace(" ")], }, }, @@ -4477,7 +4465,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3061..3064 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3064..3070 "atan2" [] [Whitespace(" ")], }, }, @@ -4552,7 +4540,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3110..3113 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3113..3118 "sqrt" [] [Whitespace(" ")], }, }, @@ -4602,7 +4590,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3142..3145 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3145..3149 "exp" [] [Whitespace(" ")], }, }, @@ -4662,7 +4650,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3176..3179 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3179..3183 "abs" [] [Whitespace(" ")], }, }, @@ -4743,7 +4731,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3234..3237 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@3237..3242 "sign" [] [Whitespace(" ")], }, }, @@ -5631,9 +5619,8 @@ CssRoot { 0: CSS_PARAMETER@612..619 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@612..619 0: CSS_COMPONENT_VALUE_LIST@612..619 - 0: CSS_CUSTOM_PROPERTY@612..619 - 0: CSS_IDENTIFIER@612..619 - 0: IDENT@612..619 "--width" [] [] + 0: CSS_DASHED_IDENTIFIER@612..619 + 0: IDENT@612..619 "--width" [] [] 3: R_PAREN@619..620 ")" [] [] 3: R_PAREN@620..621 ")" [] [] 3: (empty) @@ -5878,7 +5865,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@848..855 0: CSS_CLASS_SELECTOR@848..855 0: DOT@848..851 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@851..855 + 1: CSS_CUSTOM_IDENTIFIER@851..855 0: IDENT@851..855 "bar" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@855..1105 0: L_CURLY@855..856 "{" [] [] @@ -6144,7 +6131,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1105..1113 0: CSS_CLASS_SELECTOR@1105..1113 0: DOT@1105..1108 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@1108..1113 + 1: CSS_CUSTOM_IDENTIFIER@1108..1113 0: IDENT@1108..1113 "fade" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@1113..1216 0: L_CURLY@1113..1114 "{" [] [] @@ -6376,7 +6363,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1436..1444 0: CSS_CLASS_SELECTOR@1436..1444 0: DOT@1436..1439 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@1439..1444 + 1: CSS_CUSTOM_IDENTIFIER@1439..1444 0: IDENT@1439..1444 "fade" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@1444..1551 0: L_CURLY@1444..1445 "{" [] [] @@ -6461,7 +6448,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1551..1559 0: CSS_CLASS_SELECTOR@1551..1559 0: DOT@1551..1554 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@1554..1559 + 1: CSS_CUSTOM_IDENTIFIER@1554..1559 0: IDENT@1554..1559 "type" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@1559..1708 0: L_CURLY@1559..1560 "{" [] [] @@ -6529,7 +6516,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1708..1716 0: CSS_CLASS_SELECTOR@1708..1716 0: DOT@1708..1711 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@1711..1716 + 1: CSS_CUSTOM_IDENTIFIER@1711..1716 0: IDENT@1711..1716 "type" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@1716..1837 0: L_CURLY@1716..1717 "{" [] [] @@ -6606,7 +6593,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@1837..1845 0: CSS_CLASS_SELECTOR@1837..1845 0: DOT@1837..1840 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@1840..1845 + 1: CSS_CUSTOM_IDENTIFIER@1840..1845 0: IDENT@1840..1845 "more" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@1845..2477 0: L_CURLY@1845..1846 "{" [] [] @@ -7006,9 +6993,8 @@ CssRoot { 0: CSS_PARAMETER@2279..2286 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@2279..2286 0: CSS_COMPONENT_VALUE_LIST@2279..2286 - 0: CSS_CUSTOM_PROPERTY@2279..2286 - 0: CSS_IDENTIFIER@2279..2286 - 0: IDENT@2279..2286 "--width" [] [] + 0: CSS_DASHED_IDENTIFIER@2279..2286 + 0: IDENT@2279..2286 "--width" [] [] 3: R_PAREN@2286..2287 ")" [] [] 1: COMMA@2287..2289 "," [] [Whitespace(" ")] 2: CSS_PARAMETER@2289..2293 @@ -7049,9 +7035,8 @@ CssRoot { 0: CSS_PARAMETER@2326..2333 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@2326..2333 0: CSS_COMPONENT_VALUE_LIST@2326..2333 - 0: CSS_CUSTOM_PROPERTY@2326..2333 - 0: CSS_IDENTIFIER@2326..2333 - 0: IDENT@2326..2333 "--width" [] [] + 0: CSS_DASHED_IDENTIFIER@2326..2333 + 0: IDENT@2326..2333 "--width" [] [] 3: R_PAREN@2333..2334 ")" [] [] 3: COMMA@2334..2336 "," [] [Whitespace(" ")] 4: CSS_PARAMETER@2336..2340 @@ -7092,9 +7077,8 @@ CssRoot { 0: CSS_PARAMETER@2368..2375 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@2368..2375 0: CSS_COMPONENT_VALUE_LIST@2368..2375 - 0: CSS_CUSTOM_PROPERTY@2368..2375 - 0: CSS_IDENTIFIER@2368..2375 - 0: IDENT@2368..2375 "--width" [] [] + 0: CSS_DASHED_IDENTIFIER@2368..2375 + 0: IDENT@2368..2375 "--width" [] [] 3: R_PAREN@2375..2376 ")" [] [] 3: COMMA@2376..2378 "," [] [Whitespace(" ")] 4: CSS_PARAMETER@2378..2382 @@ -7135,9 +7119,8 @@ CssRoot { 0: CSS_PARAMETER@2412..2419 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@2412..2419 0: CSS_COMPONENT_VALUE_LIST@2412..2419 - 0: CSS_CUSTOM_PROPERTY@2412..2419 - 0: CSS_IDENTIFIER@2412..2419 - 0: IDENT@2412..2419 "--width" [] [] + 0: CSS_DASHED_IDENTIFIER@2412..2419 + 0: IDENT@2412..2419 "--width" [] [] 3: R_PAREN@2419..2420 ")" [] [] 3: COMMA@2420..2422 "," [] [Whitespace(" ")] 4: CSS_PARAMETER@2422..2426 @@ -7178,9 +7161,8 @@ CssRoot { 0: CSS_PARAMETER@2459..2466 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@2459..2466 0: CSS_COMPONENT_VALUE_LIST@2459..2466 - 0: CSS_CUSTOM_PROPERTY@2459..2466 - 0: CSS_IDENTIFIER@2459..2466 - 0: IDENT@2459..2466 "--width" [] [] + 0: CSS_DASHED_IDENTIFIER@2459..2466 + 0: IDENT@2459..2466 "--width" [] [] 3: R_PAREN@2466..2467 ")" [] [] 3: COMMA@2467..2469 "," [] [Whitespace(" ")] 4: CSS_PARAMETER@2469..2473 @@ -7203,7 +7185,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2477..2488 0: CSS_CLASS_SELECTOR@2477..2488 0: DOT@2477..2480 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@2480..2488 + 1: CSS_CUSTOM_IDENTIFIER@2480..2488 0: IDENT@2480..2488 "min-max" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2488..2635 0: L_CURLY@2488..2489 "{" [] [] @@ -7361,7 +7343,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2635..2642 0: CSS_CLASS_SELECTOR@2635..2642 0: DOT@2635..2638 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@2638..2642 + 1: CSS_CUSTOM_IDENTIFIER@2638..2642 0: IDENT@2638..2642 "rem" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2642..2673 0: L_CURLY@2642..2643 "{" [] [] @@ -7405,7 +7387,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2673..2680 0: CSS_CLASS_SELECTOR@2673..2680 0: DOT@2673..2676 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@2676..2680 + 1: CSS_CUSTOM_IDENTIFIER@2676..2680 0: IDENT@2676..2680 "sin" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2680..2759 0: L_CURLY@2680..2681 "{" [] [] @@ -7480,7 +7462,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2759..2766 0: CSS_CLASS_SELECTOR@2759..2766 0: DOT@2759..2762 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@2762..2766 + 1: CSS_CUSTOM_IDENTIFIER@2762..2766 0: IDENT@2762..2766 "cos" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2766..2845 0: L_CURLY@2766..2767 "{" [] [] @@ -7555,7 +7537,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2845..2853 0: CSS_CLASS_SELECTOR@2845..2853 0: DOT@2845..2848 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@2848..2853 + 1: CSS_CUSTOM_IDENTIFIER@2848..2853 0: IDENT@2848..2853 "asin" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2853..2929 0: L_CURLY@2853..2854 "{" [] [] @@ -7632,7 +7614,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2929..2937 0: CSS_CLASS_SELECTOR@2929..2937 0: DOT@2929..2932 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@2932..2937 + 1: CSS_CUSTOM_IDENTIFIER@2932..2937 0: IDENT@2932..2937 "acos" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2937..3013 0: L_CURLY@2937..2938 "{" [] [] @@ -7709,7 +7691,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3013..3021 0: CSS_CLASS_SELECTOR@3013..3021 0: DOT@3013..3016 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@3016..3021 + 1: CSS_CUSTOM_IDENTIFIER@3016..3021 0: IDENT@3016..3021 "atan" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@3021..3061 0: L_CURLY@3021..3022 "{" [] [] @@ -7754,7 +7736,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3061..3070 0: CSS_CLASS_SELECTOR@3061..3070 0: DOT@3061..3064 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@3064..3070 + 1: CSS_CUSTOM_IDENTIFIER@3064..3070 0: IDENT@3064..3070 "atan2" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@3070..3110 0: L_CURLY@3070..3071 "{" [] [] @@ -7801,7 +7783,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3110..3118 0: CSS_CLASS_SELECTOR@3110..3118 0: DOT@3110..3113 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@3113..3118 + 1: CSS_CUSTOM_IDENTIFIER@3113..3118 0: IDENT@3113..3118 "sqrt" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@3118..3142 0: L_CURLY@3118..3119 "{" [] [] @@ -7833,7 +7815,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3142..3149 0: CSS_CLASS_SELECTOR@3142..3149 0: DOT@3142..3145 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@3145..3149 + 1: CSS_CUSTOM_IDENTIFIER@3145..3149 0: IDENT@3145..3149 "exp" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@3149..3176 0: L_CURLY@3149..3150 "{" [] [] @@ -7871,7 +7853,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3176..3183 0: CSS_CLASS_SELECTOR@3176..3183 0: DOT@3176..3179 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@3179..3183 + 1: CSS_CUSTOM_IDENTIFIER@3179..3183 0: IDENT@3179..3183 "abs" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@3183..3234 0: L_CURLY@3183..3184 "{" [] [] @@ -7922,7 +7904,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3234..3242 0: CSS_CLASS_SELECTOR@3234..3242 0: DOT@3234..3237 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@3237..3242 + 1: CSS_CUSTOM_IDENTIFIER@3237..3242 0: IDENT@3237..3242 "sign" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@3242..3559 0: L_CURLY@3242..3243 "{" [] [] 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 f3f94810a6f1..68d57d089ac4 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 @@ -51,10 +51,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@21..24 "--a" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@21..24 "--a" [] [], }, ], }, @@ -81,10 +79,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@42..45 "--a" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@42..45 "--a" [] [], }, ], }, @@ -112,10 +108,8 @@ CssRoot { CssParameter { any_css_expression: CssListOfComponentValuesExpression { css_component_value_list: CssComponentValueList [ - CssCustomProperty { - value: CssIdentifier { - value_token: IDENT@64..67 "--a" [] [], - }, + CssDashedIdentifier { + value_token: IDENT@64..67 "--a" [] [], }, ], }, @@ -177,9 +171,8 @@ CssRoot { 0: CSS_PARAMETER@21..24 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@21..24 0: CSS_COMPONENT_VALUE_LIST@21..24 - 0: CSS_CUSTOM_PROPERTY@21..24 - 0: CSS_IDENTIFIER@21..24 - 0: IDENT@21..24 "--a" [] [] + 0: CSS_DASHED_IDENTIFIER@21..24 + 0: IDENT@21..24 "--a" [] [] 3: R_PAREN@24..25 ")" [] [] 3: (empty) 1: SEMICOLON@25..26 ";" [] [] @@ -196,9 +189,8 @@ CssRoot { 0: CSS_PARAMETER@42..45 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@42..45 0: CSS_COMPONENT_VALUE_LIST@42..45 - 0: CSS_CUSTOM_PROPERTY@42..45 - 0: CSS_IDENTIFIER@42..45 - 0: IDENT@42..45 "--a" [] [] + 0: CSS_DASHED_IDENTIFIER@42..45 + 0: IDENT@42..45 "--a" [] [] 1: COMMA@45..46 "," [] [] 3: R_PAREN@46..47 ")" [] [] 3: (empty) @@ -216,9 +208,8 @@ CssRoot { 0: CSS_PARAMETER@64..67 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@64..67 0: CSS_COMPONENT_VALUE_LIST@64..67 - 0: CSS_CUSTOM_PROPERTY@64..67 - 0: CSS_IDENTIFIER@64..67 - 0: IDENT@64..67 "--a" [] [] + 0: CSS_DASHED_IDENTIFIER@64..67 + 0: IDENT@64..67 "--a" [] [] 1: COMMA@67..69 "," [] [Whitespace(" ")] 2: CSS_PARAMETER@69..73 0: CSS_LIST_OF_COMPONENT_VALUES_EXPRESSION@69..73 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 4a4bf27242b4..ae74f99c249f 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 @@ -858,13 +858,13 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@505..507 "#" [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@507..509 "id" [] [], }, }, CssClassSelector { dot_token: DOT@509..510 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@510..515 "class" [] [], }, }, @@ -896,7 +896,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@526..528 "#" [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@528..530 "id" [] [], }, }, @@ -939,7 +939,7 @@ CssRoot { }, CssClassSelector { dot_token: DOT@550..551 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@551..557 "class" [] [Whitespace(" ")], }, }, @@ -2224,11 +2224,11 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@505..524 0: CSS_ID_SELECTOR@505..509 0: HASH@505..507 "#" [Newline("\n")] [] - 1: CSS_IDENTIFIER@507..509 + 1: CSS_CUSTOM_IDENTIFIER@507..509 0: IDENT@507..509 "id" [] [] 1: CSS_CLASS_SELECTOR@509..515 0: DOT@509..510 "." [] [] - 1: CSS_IDENTIFIER@510..515 + 1: CSS_CUSTOM_IDENTIFIER@510..515 0: IDENT@510..515 "class" [] [] 2: CSS_ATTRIBUTE_SELECTOR@515..524 0: L_BRACK@515..516 "[" [] [] @@ -2250,7 +2250,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@526..539 0: CSS_ID_SELECTOR@526..530 0: HASH@526..528 "#" [Newline("\n")] [] - 1: CSS_IDENTIFIER@528..530 + 1: CSS_CUSTOM_IDENTIFIER@528..530 0: IDENT@528..530 "id" [] [] 1: CSS_ATTRIBUTE_SELECTOR@530..539 0: L_BRACK@530..531 "[" [] [] @@ -2280,7 +2280,7 @@ CssRoot { 3: R_BRACK@549..550 "]" [] [] 1: CSS_CLASS_SELECTOR@550..557 0: DOT@550..551 "." [] [] - 1: CSS_IDENTIFIER@551..557 + 1: CSS_CUSTOM_IDENTIFIER@551..557 0: IDENT@551..557 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@557..559 0: L_CURLY@557..558 "{" [] [] 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 ab28459d86ed..2858c6094b0e 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 @@ -27,7 +27,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@0..1 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1..9 "selector" [] [], }, }, @@ -40,7 +40,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@11..12 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@12..21 "important" [] [], }, }, @@ -53,7 +53,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@23..24 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@24..29 "from" [] [Whitespace(" ")], }, }, @@ -85,7 +85,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@0..9 0: CSS_CLASS_SELECTOR@0..9 0: DOT@0..1 "." [] [] - 1: CSS_IDENTIFIER@1..9 + 1: CSS_CUSTOM_IDENTIFIER@1..9 0: IDENT@1..9 "selector" [] [] 1: COMMA@9..11 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@11..21 @@ -94,7 +94,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@11..21 0: CSS_CLASS_SELECTOR@11..21 0: DOT@11..12 "." [] [] - 1: CSS_IDENTIFIER@12..21 + 1: CSS_CUSTOM_IDENTIFIER@12..21 0: IDENT@12..21 "important" [] [] 3: COMMA@21..23 "," [] [Whitespace(" ")] 4: CSS_COMPOUND_SELECTOR@23..29 @@ -103,7 +103,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@23..29 0: CSS_CLASS_SELECTOR@23..29 0: DOT@23..24 "." [] [] - 1: CSS_IDENTIFIER@24..29 + 1: CSS_CUSTOM_IDENTIFIER@24..29 0: IDENT@24..29 "from" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@29..33 0: L_CURLY@29..30 "{" [] [] 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 5b0313526515..baedcddccf6c 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 @@ -62,7 +62,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@0..1 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1..5 "div" [] [Whitespace(" ")], }, }, @@ -75,7 +75,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@7..8 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@8..12 "div" [] [Whitespace(" ")], }, }, @@ -99,7 +99,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@14..17 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@17..23 "class" [] [Whitespace(" ")], }, }, @@ -124,7 +124,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@31..32 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@32..35 "id" [] [Whitespace(" ")], }, }, @@ -147,7 +147,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@39..42 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@42..46 "div" [] [Whitespace(" ")], }, }, @@ -160,7 +160,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@48..49 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@49..53 "div" [] [Whitespace(" ")], }, }, @@ -184,7 +184,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@55..58 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@58..64 "class" [] [Whitespace(" ")], }, }, @@ -209,7 +209,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@72..73 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@73..76 "id" [] [Whitespace(" ")], }, }, @@ -232,7 +232,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@80..83 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@83..87 "div" [] [Whitespace(" ")], }, }, @@ -245,7 +245,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@89..90 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@90..94 "div" [] [Whitespace(" ")], }, }, @@ -269,7 +269,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@96..99 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@99..105 "class" [] [Whitespace(" ")], }, }, @@ -294,7 +294,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@113..114 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@114..117 "id" [] [Whitespace(" ")], }, }, @@ -317,7 +317,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@121..124 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@124..128 "div" [] [Whitespace(" ")], }, }, @@ -330,7 +330,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@131..132 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@132..136 "div" [] [Whitespace(" ")], }, }, @@ -354,7 +354,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@138..141 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@141..147 "class" [] [Whitespace(" ")], }, }, @@ -379,7 +379,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@157..158 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@158..161 "id" [] [Whitespace(" ")], }, }, @@ -405,7 +405,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@165..168 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@168..174 "class" [] [Whitespace(" ")], }, }, @@ -430,7 +430,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@182..183 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@183..186 "id" [] [Whitespace(" ")], }, }, @@ -449,7 +449,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@192..193 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@193..198 "class" [] [], }, }, @@ -463,7 +463,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@199..200 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@200..208 "another" [] [Whitespace(" ")], }, }, @@ -486,7 +486,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@212..215 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@215..218 "div" [] [], }, }, @@ -499,7 +499,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@219..220 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@220..224 "div" [] [Whitespace(" ")], }, }, @@ -523,7 +523,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@226..229 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@229..234 "class" [] [], }, }, @@ -548,7 +548,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@241..242 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@242..245 "id" [] [Whitespace(" ")], }, }, @@ -672,7 +672,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@0..5 0: CSS_CLASS_SELECTOR@0..5 0: DOT@0..1 "." [] [] - 1: CSS_IDENTIFIER@1..5 + 1: CSS_CUSTOM_IDENTIFIER@1..5 0: IDENT@1..5 "div" [] [Whitespace(" ")] 1: R_ANGLE@5..7 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@7..12 @@ -681,7 +681,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@7..12 0: CSS_CLASS_SELECTOR@7..12 0: DOT@7..8 "." [] [] - 1: CSS_IDENTIFIER@8..12 + 1: CSS_CUSTOM_IDENTIFIER@8..12 0: IDENT@8..12 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@12..14 0: L_CURLY@12..13 "{" [] [] @@ -697,7 +697,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@14..23 0: CSS_CLASS_SELECTOR@14..23 0: DOT@14..17 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@17..23 + 1: CSS_CUSTOM_IDENTIFIER@17..23 0: IDENT@17..23 "class" [] [Whitespace(" ")] 1: R_ANGLE@23..25 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@25..29 @@ -714,7 +714,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@31..35 0: CSS_ID_SELECTOR@31..35 0: HASH@31..32 "#" [] [] - 1: CSS_IDENTIFIER@32..35 + 1: CSS_CUSTOM_IDENTIFIER@32..35 0: IDENT@32..35 "id" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@35..39 0: L_CURLY@35..36 "{" [] [] @@ -729,7 +729,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@39..46 0: CSS_CLASS_SELECTOR@39..46 0: DOT@39..42 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@42..46 + 1: CSS_CUSTOM_IDENTIFIER@42..46 0: IDENT@42..46 "div" [] [Whitespace(" ")] 1: PLUS@46..48 "+" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@48..53 @@ -738,7 +738,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@48..53 0: CSS_CLASS_SELECTOR@48..53 0: DOT@48..49 "." [] [] - 1: CSS_IDENTIFIER@49..53 + 1: CSS_CUSTOM_IDENTIFIER@49..53 0: IDENT@49..53 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@53..55 0: L_CURLY@53..54 "{" [] [] @@ -754,7 +754,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@55..64 0: CSS_CLASS_SELECTOR@55..64 0: DOT@55..58 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@58..64 + 1: CSS_CUSTOM_IDENTIFIER@58..64 0: IDENT@58..64 "class" [] [Whitespace(" ")] 1: PLUS@64..66 "+" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@66..70 @@ -771,7 +771,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@72..76 0: CSS_ID_SELECTOR@72..76 0: HASH@72..73 "#" [] [] - 1: CSS_IDENTIFIER@73..76 + 1: CSS_CUSTOM_IDENTIFIER@73..76 0: IDENT@73..76 "id" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@76..80 0: L_CURLY@76..77 "{" [] [] @@ -786,7 +786,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@80..87 0: CSS_CLASS_SELECTOR@80..87 0: DOT@80..83 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@83..87 + 1: CSS_CUSTOM_IDENTIFIER@83..87 0: IDENT@83..87 "div" [] [Whitespace(" ")] 1: TILDE@87..89 "~" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@89..94 @@ -795,7 +795,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@89..94 0: CSS_CLASS_SELECTOR@89..94 0: DOT@89..90 "." [] [] - 1: CSS_IDENTIFIER@90..94 + 1: CSS_CUSTOM_IDENTIFIER@90..94 0: IDENT@90..94 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@94..96 0: L_CURLY@94..95 "{" [] [] @@ -811,7 +811,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@96..105 0: CSS_CLASS_SELECTOR@96..105 0: DOT@96..99 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@99..105 + 1: CSS_CUSTOM_IDENTIFIER@99..105 0: IDENT@99..105 "class" [] [Whitespace(" ")] 1: TILDE@105..107 "~" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@107..111 @@ -828,7 +828,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@113..117 0: CSS_ID_SELECTOR@113..117 0: HASH@113..114 "#" [] [] - 1: CSS_IDENTIFIER@114..117 + 1: CSS_CUSTOM_IDENTIFIER@114..117 0: IDENT@114..117 "id" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@117..121 0: L_CURLY@117..118 "{" [] [] @@ -843,7 +843,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@121..128 0: CSS_CLASS_SELECTOR@121..128 0: DOT@121..124 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@124..128 + 1: CSS_CUSTOM_IDENTIFIER@124..128 0: IDENT@124..128 "div" [] [Whitespace(" ")] 1: PIPE2@128..131 "||" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@131..136 @@ -852,7 +852,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@131..136 0: CSS_CLASS_SELECTOR@131..136 0: DOT@131..132 "." [] [] - 1: CSS_IDENTIFIER@132..136 + 1: CSS_CUSTOM_IDENTIFIER@132..136 0: IDENT@132..136 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@136..138 0: L_CURLY@136..137 "{" [] [] @@ -868,7 +868,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@138..147 0: CSS_CLASS_SELECTOR@138..147 0: DOT@138..141 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@141..147 + 1: CSS_CUSTOM_IDENTIFIER@141..147 0: IDENT@141..147 "class" [] [Whitespace(" ")] 1: PIPE2@147..150 "||" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@150..154 @@ -885,7 +885,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@157..161 0: CSS_ID_SELECTOR@157..161 0: HASH@157..158 "#" [] [] - 1: CSS_IDENTIFIER@158..161 + 1: CSS_CUSTOM_IDENTIFIER@158..161 0: IDENT@158..161 "id" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@161..165 0: L_CURLY@161..162 "{" [] [] @@ -903,7 +903,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@165..174 0: CSS_CLASS_SELECTOR@165..174 0: DOT@165..168 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@168..174 + 1: CSS_CUSTOM_IDENTIFIER@168..174 0: IDENT@168..174 "class" [] [Whitespace(" ")] 1: R_ANGLE@174..176 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@176..180 @@ -920,7 +920,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@182..186 0: CSS_ID_SELECTOR@182..186 0: HASH@182..183 "#" [] [] - 1: CSS_IDENTIFIER@183..186 + 1: CSS_CUSTOM_IDENTIFIER@183..186 0: IDENT@183..186 "id" [] [Whitespace(" ")] 1: TILDE@186..188 "~" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@188..198 @@ -932,7 +932,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@192..198 0: CSS_CLASS_SELECTOR@192..198 0: DOT@192..193 "." [] [] - 1: CSS_IDENTIFIER@193..198 + 1: CSS_CUSTOM_IDENTIFIER@193..198 0: IDENT@193..198 "class" [] [] 1: CSS_SPACE_LITERAL@198..199 " " [] [] 2: CSS_COMPOUND_SELECTOR@199..208 @@ -941,7 +941,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@199..208 0: CSS_ID_SELECTOR@199..208 0: HASH@199..200 "#" [] [] - 1: CSS_IDENTIFIER@200..208 + 1: CSS_CUSTOM_IDENTIFIER@200..208 0: IDENT@200..208 "another" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@208..212 0: L_CURLY@208..209 "{" [] [] @@ -956,7 +956,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@212..218 0: CSS_CLASS_SELECTOR@212..218 0: DOT@212..215 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@215..218 + 1: CSS_CUSTOM_IDENTIFIER@215..218 0: IDENT@215..218 "div" [] [] 1: CSS_SPACE_LITERAL@218..219 " " [] [] 2: CSS_COMPOUND_SELECTOR@219..224 @@ -965,7 +965,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@219..224 0: CSS_CLASS_SELECTOR@219..224 0: DOT@219..220 "." [] [] - 1: CSS_IDENTIFIER@220..224 + 1: CSS_CUSTOM_IDENTIFIER@220..224 0: IDENT@220..224 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@224..226 0: L_CURLY@224..225 "{" [] [] @@ -981,7 +981,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@226..234 0: CSS_CLASS_SELECTOR@226..234 0: DOT@226..229 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@229..234 + 1: CSS_CUSTOM_IDENTIFIER@229..234 0: IDENT@229..234 "class" [] [] 1: CSS_SPACE_LITERAL@234..236 " " [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@236..239 @@ -998,7 +998,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@241..245 0: CSS_ID_SELECTOR@241..245 0: HASH@241..242 "#" [] [] - 1: CSS_IDENTIFIER@242..245 + 1: CSS_CUSTOM_IDENTIFIER@242..245 0: IDENT@242..245 "id" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@245..249 0: L_CURLY@245..246 "{" [] [] 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 189eefdcb003..7ba7c13efed3 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 @@ -27,7 +27,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@0..1 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@1..9 "selector" [] [], }, }, @@ -40,7 +40,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@11..12 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@12..21 "important" [] [], }, }, @@ -53,7 +53,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@23..24 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@24..29 "from" [] [Whitespace(" ")], }, }, @@ -85,7 +85,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@0..9 0: CSS_ID_SELECTOR@0..9 0: HASH@0..1 "#" [] [] - 1: CSS_IDENTIFIER@1..9 + 1: CSS_CUSTOM_IDENTIFIER@1..9 0: IDENT@1..9 "selector" [] [] 1: COMMA@9..11 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@11..21 @@ -94,7 +94,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@11..21 0: CSS_ID_SELECTOR@11..21 0: HASH@11..12 "#" [] [] - 1: CSS_IDENTIFIER@12..21 + 1: CSS_CUSTOM_IDENTIFIER@12..21 0: IDENT@12..21 "important" [] [] 3: COMMA@21..23 "," [] [Whitespace(" ")] 4: CSS_COMPOUND_SELECTOR@23..29 @@ -103,7 +103,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@23..29 0: CSS_ID_SELECTOR@23..29 0: HASH@23..24 "#" [] [] - 1: CSS_IDENTIFIER@24..29 + 1: CSS_CUSTOM_IDENTIFIER@24..29 0: IDENT@24..29 "from" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@29..33 0: L_CURLY@29..30 "{" [] [] 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 2bca71932c6e..d51a83b43e8a 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 @@ -3624,7 +3624,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2049..2050 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2050..2054 "test" [] [], }, }, @@ -3690,7 +3690,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2082..2083 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2083..2087 "test" [] [], }, }, @@ -3748,7 +3748,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2113..2114 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2114..2123 "important" [] [], }, }, @@ -3880,7 +3880,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@2185..2186 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@2186..2192 "class" [] [Whitespace(" ")], }, }, @@ -6344,7 +6344,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2049..2054 0: CSS_CLASS_SELECTOR@2049..2054 0: DOT@2049..2050 "." [] [] - 1: CSS_IDENTIFIER@2050..2054 + 1: CSS_CUSTOM_IDENTIFIER@2050..2054 0: IDENT@2050..2054 "test" [] [] 3: R_PAREN@2054..2056 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2056..2058 @@ -6389,7 +6389,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2082..2087 0: CSS_CLASS_SELECTOR@2082..2087 0: DOT@2082..2083 "." [] [] - 1: CSS_IDENTIFIER@2083..2087 + 1: CSS_CUSTOM_IDENTIFIER@2083..2087 0: IDENT@2083..2087 "test" [] [] 3: R_PAREN@2087..2089 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2089..2091 @@ -6428,7 +6428,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2113..2123 0: CSS_CLASS_SELECTOR@2113..2123 0: DOT@2113..2114 "." [] [] - 1: CSS_IDENTIFIER@2114..2123 + 1: CSS_CUSTOM_IDENTIFIER@2114..2123 0: IDENT@2114..2123 "important" [] [] 3: R_PAREN@2123..2125 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2125..2127 @@ -6514,7 +6514,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@2185..2192 0: CSS_CLASS_SELECTOR@2185..2192 0: DOT@2185..2186 "." [] [] - 1: CSS_IDENTIFIER@2186..2192 + 1: CSS_CUSTOM_IDENTIFIER@2186..2192 0: IDENT@2186..2192 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@2192..2194 0: L_CURLY@2192..2193 "{" [] [] 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 c0b71b8eab16..976f3bede679 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 @@ -280,7 +280,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@151..152 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@152..157 "class" [] [], }, }, @@ -328,7 +328,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@178..179 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@179..184 "class" [] [], }, }, @@ -376,7 +376,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@208..209 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@209..214 "class" [] [], }, }, @@ -400,7 +400,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@222..223 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@223..228 "class" [] [], }, }, @@ -437,7 +437,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@243..244 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@244..249 "class" [] [], }, }, @@ -461,7 +461,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@257..258 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@258..263 "class" [] [], }, }, @@ -525,7 +525,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@300..301 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@301..305 "div1" [] [], }, }, @@ -565,7 +565,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@325..326 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@326..329 "foo" [] [], }, }, @@ -578,7 +578,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@331..332 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@332..335 "bar" [] [], }, }, @@ -679,7 +679,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@375..378 "#" [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@378..393 "test-last-child" [] [], }, }, @@ -764,7 +764,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@447..449 "#" [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@449..462 "container-div" [] [], }, }, @@ -839,7 +839,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@507..508 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@508..515 "h1class" [] [], }, }, @@ -852,7 +852,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@517..518 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@518..521 "bar" [] [], }, }, @@ -907,7 +907,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@546..547 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@547..551 "div" [] [Whitespace(" ")], }, }, @@ -1106,7 +1106,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@151..163 0: CSS_CLASS_SELECTOR@151..157 0: DOT@151..152 "." [] [] - 1: CSS_IDENTIFIER@152..157 + 1: CSS_CUSTOM_IDENTIFIER@152..157 0: IDENT@152..157 "class" [] [] 1: CSS_ATTRIBUTE_SELECTOR@157..163 0: L_BRACK@157..158 "[" [] [] @@ -1139,7 +1139,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@178..190 0: CSS_CLASS_SELECTOR@178..184 0: DOT@178..179 "." [] [] - 1: CSS_IDENTIFIER@179..184 + 1: CSS_CUSTOM_IDENTIFIER@179..184 0: IDENT@179..184 "class" [] [] 1: CSS_ATTRIBUTE_SELECTOR@184..190 0: L_BRACK@184..185 "[" [] [] @@ -1172,7 +1172,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@208..220 0: CSS_CLASS_SELECTOR@208..214 0: DOT@208..209 "." [] [] - 1: CSS_IDENTIFIER@209..214 + 1: CSS_CUSTOM_IDENTIFIER@209..214 0: IDENT@209..214 "class" [] [] 1: CSS_ATTRIBUTE_SELECTOR@214..220 0: L_BRACK@214..215 "[" [] [] @@ -1189,7 +1189,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@222..228 0: CSS_CLASS_SELECTOR@222..228 0: DOT@222..223 "." [] [] - 1: CSS_IDENTIFIER@223..228 + 1: CSS_CUSTOM_IDENTIFIER@223..228 0: IDENT@223..228 "class" [] [] 3: R_PAREN@228..230 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@230..232 @@ -1214,7 +1214,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@243..255 0: CSS_CLASS_SELECTOR@243..249 0: DOT@243..244 "." [] [] - 1: CSS_IDENTIFIER@244..249 + 1: CSS_CUSTOM_IDENTIFIER@244..249 0: IDENT@244..249 "class" [] [] 1: CSS_ATTRIBUTE_SELECTOR@249..255 0: L_BRACK@249..250 "[" [] [] @@ -1231,7 +1231,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@257..263 0: CSS_CLASS_SELECTOR@257..263 0: DOT@257..258 "." [] [] - 1: CSS_IDENTIFIER@258..263 + 1: CSS_CUSTOM_IDENTIFIER@258..263 0: IDENT@258..263 "class" [] [] 3: R_PAREN@263..265 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@265..267 @@ -1275,7 +1275,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@300..305 0: CSS_ID_SELECTOR@300..305 0: HASH@300..301 "#" [] [] - 1: CSS_IDENTIFIER@301..305 + 1: CSS_CUSTOM_IDENTIFIER@301..305 0: IDENT@301..305 "div1" [] [] 1: COMMA@305..307 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@307..309 @@ -1303,7 +1303,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@325..329 0: CSS_CLASS_SELECTOR@325..329 0: DOT@325..326 "." [] [] - 1: CSS_IDENTIFIER@326..329 + 1: CSS_CUSTOM_IDENTIFIER@326..329 0: IDENT@326..329 "foo" [] [] 1: COMMA@329..331 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@331..335 @@ -1312,7 +1312,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@331..335 0: CSS_ID_SELECTOR@331..335 0: HASH@331..332 "#" [] [] - 1: CSS_IDENTIFIER@332..335 + 1: CSS_CUSTOM_IDENTIFIER@332..335 0: IDENT@332..335 "bar" [] [] 3: R_PAREN@335..336 ")" [] [] 5: COMMA@336..337 "," [] [] @@ -1378,7 +1378,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@375..393 0: CSS_ID_SELECTOR@375..393 0: HASH@375..378 "#" [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@378..393 + 1: CSS_CUSTOM_IDENTIFIER@378..393 0: IDENT@378..393 "test-last-child" [] [] 1: CSS_SPACE_LITERAL@393..394 " " [] [] 2: CSS_COMPOUND_SELECTOR@394..419 @@ -1435,7 +1435,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@447..462 0: CSS_ID_SELECTOR@447..462 0: HASH@447..449 "#" [Newline("\n")] [] - 1: CSS_IDENTIFIER@449..462 + 1: CSS_CUSTOM_IDENTIFIER@449..462 0: IDENT@449..462 "container-div" [] [] 1: CSS_SPACE_LITERAL@462..463 " " [] [] 2: CSS_COMPOUND_SELECTOR@463..490 @@ -1488,7 +1488,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@507..515 0: CSS_CLASS_SELECTOR@507..515 0: DOT@507..508 "." [] [] - 1: CSS_IDENTIFIER@508..515 + 1: CSS_CUSTOM_IDENTIFIER@508..515 0: IDENT@508..515 "h1class" [] [] 1: COMMA@515..517 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@517..521 @@ -1497,7 +1497,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@517..521 0: CSS_ID_SELECTOR@517..521 0: HASH@517..518 "#" [] [] - 1: CSS_IDENTIFIER@518..521 + 1: CSS_CUSTOM_IDENTIFIER@518..521 0: IDENT@518..521 "bar" [] [] 3: R_PAREN@521..523 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@523..525 @@ -1532,7 +1532,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@546..551 0: CSS_CLASS_SELECTOR@546..551 0: DOT@546..547 "." [] [] - 1: CSS_IDENTIFIER@547..551 + 1: CSS_CUSTOM_IDENTIFIER@547..551 0: IDENT@547..551 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@551..553 0: L_CURLY@551..552 "{" [] [] 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 23d61c6a9e4b..eb0250e26b08 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 @@ -324,7 +324,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@156..157 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@157..164 "sidebar" [] [], }, }, @@ -509,7 +509,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@309..311 "." [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@311..315 "test" [] [], }, }, @@ -986,7 +986,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@156..211 0: CSS_CLASS_SELECTOR@156..164 0: DOT@156..157 "." [] [] - 1: CSS_IDENTIFIER@157..164 + 1: CSS_CUSTOM_IDENTIFIER@157..164 0: IDENT@157..164 "sidebar" [] [] 1: CSS_PSEUDO_CLASS_SELECTOR@164..184 0: COLON@164..165 ":" [] [] @@ -1110,7 +1110,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@309..363 0: CSS_CLASS_SELECTOR@309..315 0: DOT@309..311 "." [Newline("\n")] [] - 1: CSS_IDENTIFIER@311..315 + 1: CSS_CUSTOM_IDENTIFIER@311..315 0: IDENT@311..315 "test" [] [] 1: CSS_PSEUDO_ELEMENT_SELECTOR@315..341 0: COLON2@315..317 "::" [] [] 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 121e06daafd5..8c29e316d43c 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 @@ -155,7 +155,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@51..52 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@52..56 "div" [] [Whitespace(" ")], }, }, @@ -280,7 +280,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@51..56 0: CSS_CLASS_SELECTOR@51..56 0: DOT@51..52 "." [] [] - 1: CSS_IDENTIFIER@52..56 + 1: CSS_CUSTOM_IDENTIFIER@52..56 0: IDENT@52..56 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@56..58 0: L_CURLY@56..57 "{" [] [] 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 ea92129874ac..58e7b4269478 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 @@ -179,7 +179,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@93..94 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@94..98 "div" [] [Whitespace(" ")], }, }, @@ -316,7 +316,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@93..98 0: CSS_CLASS_SELECTOR@93..98 0: DOT@93..94 "." [] [] - 1: CSS_IDENTIFIER@94..98 + 1: CSS_CUSTOM_IDENTIFIER@94..98 0: IDENT@94..98 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@98..100 0: L_CURLY@98..99 "{" [] [] 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 0ff5454b55c0..6ca3858ae96a 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 @@ -155,7 +155,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@49..50 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@50..54 "div" [] [Whitespace(" ")], }, }, @@ -280,7 +280,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@49..54 0: CSS_CLASS_SELECTOR@49..54 0: DOT@49..50 "." [] [] - 1: CSS_IDENTIFIER@50..54 + 1: CSS_CUSTOM_IDENTIFIER@50..54 0: IDENT@50..54 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@54..56 0: L_CURLY@54..55 "{" [] [] 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 a187518af25f..64f37593a338 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 @@ -594,7 +594,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@239..241 "." [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@241..253 "header-group" [] [], }, }, @@ -635,7 +635,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@266..267 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@267..275 "subtitle" [] [], }, }, @@ -711,7 +711,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@296..297 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@297..301 "div" [] [Whitespace(" ")], }, }, @@ -1128,7 +1128,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@239..276 0: CSS_CLASS_SELECTOR@239..253 0: DOT@239..241 "." [Newline("\n")] [] - 1: CSS_IDENTIFIER@241..253 + 1: CSS_CUSTOM_IDENTIFIER@241..253 0: IDENT@241..253 "header-group" [] [] 1: CSS_PSEUDO_CLASS_SELECTOR@253..261 0: COLON@253..254 ":" [] [] @@ -1160,7 +1160,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@266..275 0: CSS_CLASS_SELECTOR@266..275 0: DOT@266..267 "." [] [] - 1: CSS_IDENTIFIER@267..275 + 1: CSS_CUSTOM_IDENTIFIER@267..275 0: IDENT@267..275 "subtitle" [] [] 3: R_PAREN@275..276 ")" [] [] 1: CSS_SPACE_LITERAL@276..277 " " [] [] @@ -1208,7 +1208,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@296..301 0: CSS_CLASS_SELECTOR@296..301 0: DOT@296..297 "." [] [] - 1: CSS_IDENTIFIER@297..301 + 1: CSS_CUSTOM_IDENTIFIER@297..301 0: IDENT@297..301 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@301..303 0: L_CURLY@301..302 "{" [] [] 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 2d8931ab3e78..45b026c11023 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 @@ -38,7 +38,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@6..7 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@7..29 "special-custom-element" [] [], }, }, @@ -73,7 +73,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@43..44 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@44..69 "special-custom-element" [] [Whitespace(" ")], }, }, @@ -108,7 +108,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@80..81 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@81..87 "footer" [] [], }, }, @@ -167,7 +167,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@107..108 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@108..114 "footer" [] [], }, }, @@ -185,7 +185,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@116..117 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@117..121 "div" [] [Whitespace(" ")], }, }, @@ -227,7 +227,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@6..29 0: CSS_CLASS_SELECTOR@6..29 0: DOT@6..7 "." [] [] - 1: CSS_IDENTIFIER@7..29 + 1: CSS_CUSTOM_IDENTIFIER@7..29 0: IDENT@7..29 "special-custom-element" [] [] 3: R_PAREN@29..31 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@31..33 @@ -251,7 +251,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@43..69 0: CSS_CLASS_SELECTOR@43..69 0: DOT@43..44 "." [] [] - 1: CSS_IDENTIFIER@44..69 + 1: CSS_CUSTOM_IDENTIFIER@44..69 0: IDENT@44..69 "special-custom-element" [] [Whitespace(" ")] 3: R_PAREN@69..71 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@71..73 @@ -275,7 +275,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@80..87 0: CSS_CLASS_SELECTOR@80..87 0: DOT@80..81 "." [] [] - 1: CSS_IDENTIFIER@81..87 + 1: CSS_CUSTOM_IDENTIFIER@81..87 0: IDENT@81..87 "footer" [] [] 3: R_PAREN@87..89 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@89..91 @@ -315,7 +315,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@107..114 0: CSS_CLASS_SELECTOR@107..114 0: DOT@107..108 "." [] [] - 1: CSS_IDENTIFIER@108..114 + 1: CSS_CUSTOM_IDENTIFIER@108..114 0: IDENT@108..114 "footer" [] [] 3: R_PAREN@114..115 ")" [] [] 1: CSS_SPACE_LITERAL@115..116 " " [] [] @@ -325,7 +325,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@116..121 0: CSS_CLASS_SELECTOR@116..121 0: DOT@116..117 "." [] [] - 1: CSS_IDENTIFIER@117..121 + 1: CSS_CUSTOM_IDENTIFIER@117..121 0: IDENT@117..121 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@121..123 0: L_CURLY@121..122 "{" [] [] 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 74a18eb1f2cf..79d14b2dbbfb 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 @@ -119,7 +119,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@66..67 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@67..71 "div" [] [Whitespace(" ")], }, }, @@ -217,7 +217,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@66..71 0: CSS_CLASS_SELECTOR@66..71 0: DOT@66..67 "." [] [] - 1: CSS_IDENTIFIER@67..71 + 1: CSS_CUSTOM_IDENTIFIER@67..71 0: IDENT@67..71 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@71..73 0: L_CURLY@71..72 "{" [] [] 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 d82487069270..901fc0080de4 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 @@ -241,7 +241,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@76..77 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@77..81 "cool" [] [], }, }, @@ -254,7 +254,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@83..84 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@84..87 "fun" [] [], }, }, @@ -615,7 +615,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@222..223 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@223..227 "list" [] [], }, }, @@ -1450,7 +1450,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@76..81 0: CSS_CLASS_SELECTOR@76..81 0: DOT@76..77 "." [] [] - 1: CSS_IDENTIFIER@77..81 + 1: CSS_CUSTOM_IDENTIFIER@77..81 0: IDENT@77..81 "cool" [] [] 1: COMMA@81..83 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@83..87 @@ -1459,7 +1459,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@83..87 0: CSS_CLASS_SELECTOR@83..87 0: DOT@83..84 "." [] [] - 1: CSS_IDENTIFIER@84..87 + 1: CSS_CUSTOM_IDENTIFIER@84..87 0: IDENT@84..87 "fun" [] [] 3: R_PAREN@87..89 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@89..91 @@ -1709,7 +1709,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@222..227 0: CSS_CLASS_SELECTOR@222..227 0: DOT@222..223 "." [] [] - 1: CSS_IDENTIFIER@223..227 + 1: CSS_CUSTOM_IDENTIFIER@223..227 0: IDENT@223..227 "list" [] [] 3: R_PAREN@227..229 ")" [] [Whitespace(" ")] 1: R_ANGLE@229..231 ">" [] [Whitespace(" ")] 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 b87f322e67e1..5dad619a2d9d 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 @@ -294,7 +294,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@145..146 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@146..152 "class" [] [Whitespace(" ")], }, }, @@ -505,7 +505,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@145..152 0: CSS_CLASS_SELECTOR@145..152 0: DOT@145..146 "." [] [] - 1: CSS_IDENTIFIER@146..152 + 1: CSS_CUSTOM_IDENTIFIER@146..152 0: IDENT@146..152 "class" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@152..154 0: L_CURLY@152..153 "{" [] [] diff --git a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module.css.snap b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module.css.snap index d9d7abd50966..0833eb58c187 100644 --- a/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module.css.snap +++ b/crates/biome_css_parser/tests/css_test_suite/ok/selector/pseudo_class/pseudo_class_module.css.snap @@ -37,7 +37,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@8..9 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@9..14 "class" [] [], }, }, @@ -86,7 +86,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@30..31 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@31..36 "class" [] [], }, }, @@ -111,7 +111,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@43..44 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@44..46 "id" [] [], }, }, @@ -149,7 +149,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@59..60 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@60..65 "class" [] [], }, }, @@ -179,7 +179,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@71..72 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@72..76 "div" [] [Whitespace(" ")], }, }, @@ -222,7 +222,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@8..14 0: CSS_CLASS_SELECTOR@8..14 0: DOT@8..9 "." [] [] - 1: CSS_IDENTIFIER@9..14 + 1: CSS_CUSTOM_IDENTIFIER@9..14 0: IDENT@9..14 "class" [] [] 1: CSS_SPACE_LITERAL@14..15 " " [] [] 2: CSS_COMPOUND_SELECTOR@15..18 @@ -256,7 +256,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@30..36 0: CSS_CLASS_SELECTOR@30..36 0: DOT@30..31 "." [] [] - 1: CSS_IDENTIFIER@31..36 + 1: CSS_CUSTOM_IDENTIFIER@31..36 0: IDENT@31..36 "class" [] [] 1: CSS_SPACE_LITERAL@36..37 " " [] [] 2: CSS_COMPOUND_SELECTOR@37..41 @@ -273,7 +273,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@43..46 0: CSS_ID_SELECTOR@43..46 0: HASH@43..44 "#" [] [] - 1: CSS_IDENTIFIER@44..46 + 1: CSS_CUSTOM_IDENTIFIER@44..46 0: IDENT@44..46 "id" [] [] 3: R_PAREN@46..48 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@48..50 @@ -299,7 +299,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@59..65 0: CSS_CLASS_SELECTOR@59..65 0: DOT@59..60 "." [] [] - 1: CSS_IDENTIFIER@60..65 + 1: CSS_CUSTOM_IDENTIFIER@60..65 0: IDENT@60..65 "class" [] [] 1: CSS_SPACE_LITERAL@65..66 " " [] [] 2: CSS_COMPOUND_SELECTOR@66..69 @@ -317,7 +317,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@71..76 0: CSS_CLASS_SELECTOR@71..76 0: DOT@71..72 "." [] [] - 1: CSS_IDENTIFIER@72..76 + 1: CSS_CUSTOM_IDENTIFIER@72..76 0: IDENT@72..76 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@76..78 0: L_CURLY@76..77 "{" [] [] 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 87de94dffcc0..2c28dbce48bb 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 @@ -306,7 +306,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@110..112 "." [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@112..120 "selector" [] [], }, }, @@ -420,7 +420,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@166..167 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@167..172 "fancy" [] [], }, }, @@ -596,7 +596,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@236..237 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@237..242 "fancy" [] [], }, }, @@ -651,7 +651,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@259..260 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@260..263 "foo" [] [], }, }, @@ -786,7 +786,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@335..336 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@336..339 "foo" [] [], }, }, @@ -1375,7 +1375,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@581..582 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@582..586 "div" [] [Whitespace(" ")], }, }, @@ -1582,7 +1582,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@110..133 0: CSS_CLASS_SELECTOR@110..120 0: DOT@110..112 "." [Newline("\n")] [] - 1: CSS_IDENTIFIER@112..120 + 1: CSS_CUSTOM_IDENTIFIER@112..120 0: IDENT@112..120 "selector" [] [] 1: CSS_PSEUDO_CLASS_SELECTOR@120..133 0: COLON@120..121 ":" [] [] @@ -1662,7 +1662,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@166..172 0: CSS_CLASS_SELECTOR@166..172 0: DOT@166..167 "." [] [] - 1: CSS_IDENTIFIER@167..172 + 1: CSS_CUSTOM_IDENTIFIER@167..172 0: IDENT@167..172 "fancy" [] [] 3: R_PAREN@172..174 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@174..176 @@ -1784,7 +1784,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@236..242 0: CSS_CLASS_SELECTOR@236..242 0: DOT@236..237 "." [] [] - 1: CSS_IDENTIFIER@237..242 + 1: CSS_CUSTOM_IDENTIFIER@237..242 0: IDENT@237..242 "fancy" [] [] 3: R_PAREN@242..244 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@244..246 @@ -1821,7 +1821,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@259..263 0: CSS_CLASS_SELECTOR@259..263 0: DOT@259..260 "." [] [] - 1: CSS_IDENTIFIER@260..263 + 1: CSS_CUSTOM_IDENTIFIER@260..263 0: IDENT@260..263 "foo" [] [] 3: R_PAREN@263..265 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@265..267 @@ -1911,7 +1911,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@335..339 0: CSS_ID_SELECTOR@335..339 0: HASH@335..336 "#" [] [] - 1: CSS_IDENTIFIER@336..339 + 1: CSS_CUSTOM_IDENTIFIER@336..339 0: IDENT@336..339 "foo" [] [] 3: R_PAREN@339..341 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@341..343 @@ -2311,7 +2311,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@581..586 0: CSS_CLASS_SELECTOR@581..586 0: DOT@581..582 "." [] [] - 1: CSS_IDENTIFIER@582..586 + 1: CSS_CUSTOM_IDENTIFIER@582..586 0: IDENT@582..586 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@586..588 0: L_CURLY@586..587 "{" [] [] 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 d4ef823282c1..22e7b7942723 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 @@ -155,7 +155,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@45..46 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@46..50 "div" [] [Whitespace(" ")], }, }, @@ -280,7 +280,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@45..50 0: CSS_CLASS_SELECTOR@45..50 0: DOT@45..46 "." [] [] - 1: CSS_IDENTIFIER@46..50 + 1: CSS_CUSTOM_IDENTIFIER@46..50 0: IDENT@46..50 "div" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@50..52 0: L_CURLY@50..51 "{" [] [] 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 01c2628a9712..caa5464e5fd5 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 @@ -236,7 +236,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@88..89 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@89..93 "cool" [] [], }, }, @@ -249,7 +249,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@95..96 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@96..99 "fun" [] [], }, }, @@ -610,7 +610,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@252..253 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@253..260 "lwheret" [] [], }, }, @@ -977,7 +977,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@88..93 0: CSS_CLASS_SELECTOR@88..93 0: DOT@88..89 "." [] [] - 1: CSS_IDENTIFIER@89..93 + 1: CSS_CUSTOM_IDENTIFIER@89..93 0: IDENT@89..93 "cool" [] [] 1: COMMA@93..95 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@95..99 @@ -986,7 +986,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@95..99 0: CSS_CLASS_SELECTOR@95..99 0: DOT@95..96 "." [] [] - 1: CSS_IDENTIFIER@96..99 + 1: CSS_CUSTOM_IDENTIFIER@96..99 0: IDENT@96..99 "fun" [] [] 3: R_PAREN@99..101 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@101..103 @@ -1236,7 +1236,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@252..260 0: CSS_CLASS_SELECTOR@252..260 0: DOT@252..253 "." [] [] - 1: CSS_IDENTIFIER@253..260 + 1: CSS_CUSTOM_IDENTIFIER@253..260 0: IDENT@253..260 "lwheret" [] [] 3: R_PAREN@260..262 ")" [] [Whitespace(" ")] 1: R_ANGLE@262..264 ">" [] [Whitespace(" ")] 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 0e5f74f174e1..c68e81ff4acf 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 @@ -255,7 +255,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@119..120 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@120..127 "scroll" [] [Whitespace(" ")], }, }, @@ -268,7 +268,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@129..130 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@130..133 "div" [] [], }, }, @@ -532,7 +532,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@316..319 "." [Newline("\n"), Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@319..329 "form-range" [] [], }, }, @@ -612,7 +612,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@377..378 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@378..381 "foo" [] [], }, }, @@ -784,7 +784,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@119..127 0: CSS_ID_SELECTOR@119..127 0: HASH@119..120 "#" [] [] - 1: CSS_IDENTIFIER@120..127 + 1: CSS_CUSTOM_IDENTIFIER@120..127 0: IDENT@120..127 "scroll" [] [Whitespace(" ")] 1: R_ANGLE@127..129 ">" [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@129..133 @@ -793,7 +793,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@129..133 0: CSS_CLASS_SELECTOR@129..133 0: DOT@129..130 "." [] [] - 1: CSS_IDENTIFIER@130..133 + 1: CSS_CUSTOM_IDENTIFIER@130..133 0: IDENT@130..133 "div" [] [] 3: R_PAREN@133..135 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@135..137 @@ -966,7 +966,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@316..352 0: CSS_CLASS_SELECTOR@316..329 0: DOT@316..319 "." [Newline("\n"), Newline("\n")] [] - 1: CSS_IDENTIFIER@319..329 + 1: CSS_CUSTOM_IDENTIFIER@319..329 0: IDENT@319..329 "form-range" [] [] 1: CSS_PSEUDO_ELEMENT_SELECTOR@329..352 0: COLON2@329..331 "::" [] [] @@ -1020,7 +1020,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@377..390 0: CSS_CLASS_SELECTOR@377..381 0: DOT@377..378 "." [] [] - 1: CSS_IDENTIFIER@378..381 + 1: CSS_CUSTOM_IDENTIFIER@378..381 0: IDENT@378..381 "foo" [] [] 1: CSS_PSEUDO_ELEMENT_SELECTOR@381..390 0: COLON2@381..383 "::" [] [] 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 bcf92a1dd2e1..6153f47e9def 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 @@ -71,7 +71,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@39..40 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@40..46 "scroll" [] [], }, }, @@ -113,7 +113,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@72..73 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@73..82 "scroll" [] [Whitespace(" ")], }, }, @@ -181,7 +181,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@39..46 0: CSS_ID_SELECTOR@39..46 0: HASH@39..40 "#" [] [] - 1: CSS_IDENTIFIER@40..46 + 1: CSS_CUSTOM_IDENTIFIER@40..46 0: IDENT@40..46 "scroll" [] [] 3: R_PAREN@46..48 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@48..50 @@ -209,7 +209,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@72..82 0: CSS_ID_SELECTOR@72..82 0: HASH@72..73 "#" [] [] - 1: CSS_IDENTIFIER@73..82 + 1: CSS_CUSTOM_IDENTIFIER@73..82 0: IDENT@73..82 "scroll" [] [Whitespace(" ")] 3: R_PAREN@82..84 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@84..86 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 8273162144af..a21199841e35 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 @@ -247,7 +247,7 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssIdSelector { hash_token: HASH@109..110 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@110..114 "cue1" [] [], }, }, @@ -431,7 +431,7 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@109..114 0: CSS_ID_SELECTOR@109..114 0: HASH@109..110 "#" [] [] - 1: CSS_IDENTIFIER@110..114 + 1: CSS_CUSTOM_IDENTIFIER@110..114 0: IDENT@110..114 "cue1" [] [] 3: R_PAREN@114..116 ")" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@116..118 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 4c55a7381d66..ca5f62bbad07 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 @@ -34,25 +34,25 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@3..4 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@4..9 "class" [] [], }, }, CssClassSelector { dot_token: DOT@9..10 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@10..17 "content" [] [], }, }, CssIdSelector { hash_token: HASH@17..18 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@18..20 "id" [] [], }, }, CssIdSelector { hash_token: HASH@20..21 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@21..24 "id" [] [Whitespace(" ")], }, }, @@ -76,25 +76,25 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@28..29 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@29..34 "class" [] [], }, }, CssClassSelector { dot_token: DOT@34..35 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@35..42 "content" [] [], }, }, CssIdSelector { hash_token: HASH@42..43 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@43..45 "id" [] [], }, }, CssIdSelector { hash_token: HASH@45..46 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@46..50 "id1" [] [Whitespace(" ")], }, }, @@ -115,25 +115,25 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@52..54 "." [Newline("\n")] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@54..59 "class" [] [], }, }, CssClassSelector { dot_token: DOT@59..60 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@60..67 "content" [] [], }, }, CssIdSelector { hash_token: HASH@67..68 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@68..70 "id" [] [], }, }, CssIdSelector { hash_token: HASH@70..71 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@71..75 "id1" [] [Whitespace(" ")], }, }, @@ -159,25 +159,25 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@82..83 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@83..88 "class" [] [], }, }, CssClassSelector { dot_token: DOT@88..89 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@89..96 "content" [] [], }, }, CssIdSelector { hash_token: HASH@96..97 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@97..99 "id" [] [], }, }, CssIdSelector { hash_token: HASH@99..100 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@100..102 "id" [] [], }, }, @@ -193,25 +193,25 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@105..106 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@106..111 "class" [] [], }, }, CssClassSelector { dot_token: DOT@111..112 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@112..119 "content" [] [], }, }, CssIdSelector { hash_token: HASH@119..120 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@120..122 "id" [] [], }, }, CssIdSelector { hash_token: HASH@122..123 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@123..126 "id1" [] [], }, }, @@ -224,25 +224,25 @@ CssRoot { sub_selectors: CssSubSelectorList [ CssClassSelector { dot_token: DOT@128..129 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@129..134 "class" [] [], }, }, CssClassSelector { dot_token: DOT@134..135 "." [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@135..142 "content" [] [], }, }, CssIdSelector { hash_token: HASH@142..143 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@143..145 "id" [] [], }, }, CssIdSelector { hash_token: HASH@145..146 "#" [] [], - name: CssIdentifier { + name: CssCustomIdentifier { value_token: IDENT@146..150 "id1" [] [Whitespace(" ")], }, }, @@ -277,19 +277,19 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@3..24 0: CSS_CLASS_SELECTOR@3..9 0: DOT@3..4 "." [] [] - 1: CSS_IDENTIFIER@4..9 + 1: CSS_CUSTOM_IDENTIFIER@4..9 0: IDENT@4..9 "class" [] [] 1: CSS_CLASS_SELECTOR@9..17 0: DOT@9..10 "." [] [] - 1: CSS_IDENTIFIER@10..17 + 1: CSS_CUSTOM_IDENTIFIER@10..17 0: IDENT@10..17 "content" [] [] 2: CSS_ID_SELECTOR@17..20 0: HASH@17..18 "#" [] [] - 1: CSS_IDENTIFIER@18..20 + 1: CSS_CUSTOM_IDENTIFIER@18..20 0: IDENT@18..20 "id" [] [] 3: CSS_ID_SELECTOR@20..24 0: HASH@20..21 "#" [] [] - 1: CSS_IDENTIFIER@21..24 + 1: CSS_CUSTOM_IDENTIFIER@21..24 0: IDENT@21..24 "id" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@24..26 0: L_CURLY@24..25 "{" [] [] @@ -305,19 +305,19 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@28..50 0: CSS_CLASS_SELECTOR@28..34 0: DOT@28..29 "." [] [] - 1: CSS_IDENTIFIER@29..34 + 1: CSS_CUSTOM_IDENTIFIER@29..34 0: IDENT@29..34 "class" [] [] 1: CSS_CLASS_SELECTOR@34..42 0: DOT@34..35 "." [] [] - 1: CSS_IDENTIFIER@35..42 + 1: CSS_CUSTOM_IDENTIFIER@35..42 0: IDENT@35..42 "content" [] [] 2: CSS_ID_SELECTOR@42..45 0: HASH@42..43 "#" [] [] - 1: CSS_IDENTIFIER@43..45 + 1: CSS_CUSTOM_IDENTIFIER@43..45 0: IDENT@43..45 "id" [] [] 3: CSS_ID_SELECTOR@45..50 0: HASH@45..46 "#" [] [] - 1: CSS_IDENTIFIER@46..50 + 1: CSS_CUSTOM_IDENTIFIER@46..50 0: IDENT@46..50 "id1" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@50..52 0: L_CURLY@50..51 "{" [] [] @@ -331,19 +331,19 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@52..75 0: CSS_CLASS_SELECTOR@52..59 0: DOT@52..54 "." [Newline("\n")] [] - 1: CSS_IDENTIFIER@54..59 + 1: CSS_CUSTOM_IDENTIFIER@54..59 0: IDENT@54..59 "class" [] [] 1: CSS_CLASS_SELECTOR@59..67 0: DOT@59..60 "." [] [] - 1: CSS_IDENTIFIER@60..67 + 1: CSS_CUSTOM_IDENTIFIER@60..67 0: IDENT@60..67 "content" [] [] 2: CSS_ID_SELECTOR@67..70 0: HASH@67..68 "#" [] [] - 1: CSS_IDENTIFIER@68..70 + 1: CSS_CUSTOM_IDENTIFIER@68..70 0: IDENT@68..70 "id" [] [] 3: CSS_ID_SELECTOR@70..75 0: HASH@70..71 "#" [] [] - 1: CSS_IDENTIFIER@71..75 + 1: CSS_CUSTOM_IDENTIFIER@71..75 0: IDENT@71..75 "id1" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@75..77 0: L_CURLY@75..76 "{" [] [] @@ -360,19 +360,19 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@82..102 0: CSS_CLASS_SELECTOR@82..88 0: DOT@82..83 "." [] [] - 1: CSS_IDENTIFIER@83..88 + 1: CSS_CUSTOM_IDENTIFIER@83..88 0: IDENT@83..88 "class" [] [] 1: CSS_CLASS_SELECTOR@88..96 0: DOT@88..89 "." [] [] - 1: CSS_IDENTIFIER@89..96 + 1: CSS_CUSTOM_IDENTIFIER@89..96 0: IDENT@89..96 "content" [] [] 2: CSS_ID_SELECTOR@96..99 0: HASH@96..97 "#" [] [] - 1: CSS_IDENTIFIER@97..99 + 1: CSS_CUSTOM_IDENTIFIER@97..99 0: IDENT@97..99 "id" [] [] 3: CSS_ID_SELECTOR@99..102 0: HASH@99..100 "#" [] [] - 1: CSS_IDENTIFIER@100..102 + 1: CSS_CUSTOM_IDENTIFIER@100..102 0: IDENT@100..102 "id" [] [] 1: COMMA@102..104 "," [] [Whitespace(" ")] 2: CSS_COMPOUND_SELECTOR@104..126 @@ -383,19 +383,19 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@105..126 0: CSS_CLASS_SELECTOR@105..111 0: DOT@105..106 "." [] [] - 1: CSS_IDENTIFIER@106..111 + 1: CSS_CUSTOM_IDENTIFIER@106..111 0: IDENT@106..111 "class" [] [] 1: CSS_CLASS_SELECTOR@111..119 0: DOT@111..112 "." [] [] - 1: CSS_IDENTIFIER@112..119 + 1: CSS_CUSTOM_IDENTIFIER@112..119 0: IDENT@112..119 "content" [] [] 2: CSS_ID_SELECTOR@119..122 0: HASH@119..120 "#" [] [] - 1: CSS_IDENTIFIER@120..122 + 1: CSS_CUSTOM_IDENTIFIER@120..122 0: IDENT@120..122 "id" [] [] 3: CSS_ID_SELECTOR@122..126 0: HASH@122..123 "#" [] [] - 1: CSS_IDENTIFIER@123..126 + 1: CSS_CUSTOM_IDENTIFIER@123..126 0: IDENT@123..126 "id1" [] [] 3: COMMA@126..128 "," [] [Whitespace(" ")] 4: CSS_COMPOUND_SELECTOR@128..150 @@ -404,19 +404,19 @@ CssRoot { 2: CSS_SUB_SELECTOR_LIST@128..150 0: CSS_CLASS_SELECTOR@128..134 0: DOT@128..129 "." [] [] - 1: CSS_IDENTIFIER@129..134 + 1: CSS_CUSTOM_IDENTIFIER@129..134 0: IDENT@129..134 "class" [] [] 1: CSS_CLASS_SELECTOR@134..142 0: DOT@134..135 "." [] [] - 1: CSS_IDENTIFIER@135..142 + 1: CSS_CUSTOM_IDENTIFIER@135..142 0: IDENT@135..142 "content" [] [] 2: CSS_ID_SELECTOR@142..145 0: HASH@142..143 "#" [] [] - 1: CSS_IDENTIFIER@143..145 + 1: CSS_CUSTOM_IDENTIFIER@143..145 0: IDENT@143..145 "id" [] [] 3: CSS_ID_SELECTOR@145..150 0: HASH@145..146 "#" [] [] - 1: CSS_IDENTIFIER@146..150 + 1: CSS_CUSTOM_IDENTIFIER@146..150 0: IDENT@146..150 "id1" [] [Whitespace(" ")] 1: CSS_DECLARATION_LIST_BLOCK@150..152 0: L_CURLY@150..151 "{" [] [] diff --git a/crates/biome_css_syntax/src/generated/kind.rs b/crates/biome_css_syntax/src/generated/kind.rs index 3b0b8fcb75ef..4a8f4c65fc8a 100644 --- a/crates/biome_css_syntax/src/generated/kind.rs +++ b/crates/biome_css_syntax/src/generated/kind.rs @@ -192,7 +192,8 @@ pub enum CssSyntaxKind { FONT_FACE_KW, CSS_STRING_LITERAL, CSS_NUMBER_LITERAL, - CSS_CUSTOM_PROPERTY, + CSS_DASHED_IDENTIFIER, + CSS_CUSTOM_IDENTIFIER, CSS_SPACE_LITERAL, CSS_URL_VALUE_RAW_LITERAL, CSS_COLOR_LITERAL, @@ -380,7 +381,8 @@ impl CssSyntaxKind { match self { CSS_STRING_LITERAL | CSS_NUMBER_LITERAL - | CSS_CUSTOM_PROPERTY + | CSS_DASHED_IDENTIFIER + | CSS_CUSTOM_IDENTIFIER | CSS_SPACE_LITERAL | CSS_URL_VALUE_RAW_LITERAL | CSS_COLOR_LITERAL => true, diff --git a/crates/biome_css_syntax/src/generated/macros.rs b/crates/biome_css_syntax/src/generated/macros.rs index c42f0f7178e3..a96bce400c70 100644 --- a/crates/biome_css_syntax/src/generated/macros.rs +++ b/crates/biome_css_syntax/src/generated/macros.rs @@ -118,8 +118,12 @@ macro_rules! map_syntax_node { let $pattern = unsafe { $crate::CssCounterStyleAtRule::new_unchecked(node) }; $body } - $crate::CssSyntaxKind::CSS_CUSTOM_PROPERTY => { - let $pattern = unsafe { $crate::CssCustomProperty::new_unchecked(node) }; + $crate::CssSyntaxKind::CSS_CUSTOM_IDENTIFIER => { + let $pattern = unsafe { $crate::CssCustomIdentifier::new_unchecked(node) }; + $body + } + $crate::CssSyntaxKind::CSS_DASHED_IDENTIFIER => { + let $pattern = unsafe { $crate::CssDashedIdentifier::new_unchecked(node) }; $body } $crate::CssSyntaxKind::CSS_DECLARATION => { @@ -518,14 +522,6 @@ macro_rules! map_syntax_node { let $pattern = unsafe { $crate::CssUrlValueRaw::new_unchecked(node) }; $body } - $crate::CssSyntaxKind::CSS_VAR_FUNCTION => { - let $pattern = unsafe { $crate::CssVarFunction::new_unchecked(node) }; - $body - } - $crate::CssSyntaxKind::CSS_VAR_FUNCTION_VALUE => { - let $pattern = unsafe { $crate::CssVarFunctionValue::new_unchecked(node) }; - $body - } $crate::CssSyntaxKind::CSS_BOGUS => { let $pattern = unsafe { $crate::CssBogus::new_unchecked(node) }; $body diff --git a/crates/biome_css_syntax/src/generated/nodes.rs b/crates/biome_css_syntax/src/generated/nodes.rs index 1c650c927251..9309ac2dddab 100644 --- a/crates/biome_css_syntax/src/generated/nodes.rs +++ b/crates/biome_css_syntax/src/generated/nodes.rs @@ -347,7 +347,7 @@ impl CssClassSelector { pub fn dot_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } } @@ -363,7 +363,7 @@ impl Serialize for CssClassSelector { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssClassSelectorFields { pub dot_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct CssColor { @@ -430,7 +430,7 @@ impl CssColorProfileAtRule { pub fn color_profile_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn block(&self) -> SyntaxResult { @@ -449,7 +449,7 @@ impl Serialize for CssColorProfileAtRule { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssColorProfileAtRuleFields { pub color_profile_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub block: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -615,7 +615,7 @@ impl CssContainerAtRule { pub fn container_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> Option { + pub fn name(&self) -> Option { support::node(&self.syntax, 1usize) } pub fn query(&self) -> SyntaxResult { @@ -637,7 +637,7 @@ impl Serialize for CssContainerAtRule { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssContainerAtRuleFields { pub container_token: SyntaxResult, - pub name: Option, + pub name: Option, pub query: SyntaxResult, pub block: SyntaxResult, } @@ -1074,7 +1074,7 @@ impl CssCounterStyleAtRule { pub fn counter_style_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn block(&self) -> SyntaxResult { @@ -1093,14 +1093,14 @@ impl Serialize for CssCounterStyleAtRule { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssCounterStyleAtRuleFields { pub counter_style_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub block: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] -pub struct CssCustomProperty { +pub struct CssCustomIdentifier { pub(crate) syntax: SyntaxNode, } -impl CssCustomProperty { +impl CssCustomIdentifier { #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] #[doc = r""] #[doc = r" # Safety"] @@ -1110,17 +1110,17 @@ impl CssCustomProperty { pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { Self { syntax } } - pub fn as_fields(&self) -> CssCustomPropertyFields { - CssCustomPropertyFields { - value: self.value(), + pub fn as_fields(&self) -> CssCustomIdentifierFields { + CssCustomIdentifierFields { + value_token: self.value_token(), } } - pub fn value(&self) -> SyntaxResult { - support::required_node(&self.syntax, 0usize) + pub fn value_token(&self) -> SyntaxResult { + support::required_token(&self.syntax, 0usize) } } #[cfg(feature = "serde")] -impl Serialize for CssCustomProperty { +impl Serialize for CssCustomIdentifier { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -1129,8 +1129,44 @@ impl Serialize for CssCustomProperty { } } #[cfg_attr(feature = "serde", derive(Serialize))] -pub struct CssCustomPropertyFields { - pub value: SyntaxResult, +pub struct CssCustomIdentifierFields { + pub value_token: SyntaxResult, +} +#[derive(Clone, PartialEq, Eq, Hash)] +pub struct CssDashedIdentifier { + pub(crate) syntax: SyntaxNode, +} +impl CssDashedIdentifier { + #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] + #[doc = r" or a match on [SyntaxNode::kind]"] + #[inline] + pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { + Self { syntax } + } + pub fn as_fields(&self) -> CssDashedIdentifierFields { + CssDashedIdentifierFields { + value_token: self.value_token(), + } + } + pub fn value_token(&self) -> SyntaxResult { + support::required_token(&self.syntax, 0usize) + } +} +#[cfg(feature = "serde")] +impl Serialize for CssDashedIdentifier { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.as_fields().serialize(serializer) + } +} +#[cfg_attr(feature = "serde", derive(Serialize))] +pub struct CssDashedIdentifierFields { + pub value_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct CssDeclaration { @@ -1422,7 +1458,7 @@ impl CssFontPaletteValuesAtRule { pub fn font_palette_values_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } pub fn block(&self) -> SyntaxResult { @@ -1441,7 +1477,7 @@ impl Serialize for CssFontPaletteValuesAtRule { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssFontPaletteValuesAtRuleFields { pub font_palette_values_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, pub block: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -1467,7 +1503,7 @@ impl CssIdSelector { pub fn hash_token(&self) -> SyntaxResult { support::required_token(&self.syntax, 0usize) } - pub fn name(&self) -> SyntaxResult { + pub fn name(&self) -> SyntaxResult { support::required_node(&self.syntax, 1usize) } } @@ -1483,7 +1519,7 @@ impl Serialize for CssIdSelector { #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssIdSelectorFields { pub hash_token: SyntaxResult, - pub name: SyntaxResult, + pub name: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] pub struct CssIdentifier { @@ -2625,7 +2661,7 @@ impl CssPageSelector { pseudos: self.pseudos(), } } - pub fn ty(&self) -> Option { + pub fn ty(&self) -> Option { support::node(&self.syntax, 0usize) } pub fn pseudos(&self) -> CssPageSelectorPseudoList { @@ -2643,7 +2679,7 @@ impl Serialize for CssPageSelector { } #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssPageSelectorFields { - pub ty: Option, + pub ty: Option, pub pseudos: CssPageSelectorPseudoList, } #[derive(Clone, PartialEq, Eq, Hash)] @@ -5076,103 +5112,6 @@ pub struct CssUrlValueRawFields { pub value_token: SyntaxResult, } #[derive(Clone, PartialEq, Eq, Hash)] -pub struct CssVarFunction { - pub(crate) syntax: SyntaxNode, -} -impl CssVarFunction { - #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] - #[doc = r""] - #[doc = r" # Safety"] - #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] - #[doc = r" or a match on [SyntaxNode::kind]"] - #[inline] - pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { - Self { syntax } - } - pub fn as_fields(&self) -> CssVarFunctionFields { - CssVarFunctionFields { - var_token: self.var_token(), - l_paren_token: self.l_paren_token(), - property: self.property(), - value: self.value(), - r_paren_token: self.r_paren_token(), - } - } - pub fn var_token(&self) -> SyntaxResult { - support::required_token(&self.syntax, 0usize) - } - pub fn l_paren_token(&self) -> SyntaxResult { - support::required_token(&self.syntax, 1usize) - } - pub fn property(&self) -> SyntaxResult { - support::required_node(&self.syntax, 2usize) - } - pub fn value(&self) -> Option { - support::node(&self.syntax, 3usize) - } - pub fn r_paren_token(&self) -> SyntaxResult { - support::required_token(&self.syntax, 4usize) - } -} -#[cfg(feature = "serde")] -impl Serialize for CssVarFunction { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - self.as_fields().serialize(serializer) - } -} -#[cfg_attr(feature = "serde", derive(Serialize))] -pub struct CssVarFunctionFields { - pub var_token: SyntaxResult, - pub l_paren_token: SyntaxResult, - pub property: SyntaxResult, - pub value: Option, - pub r_paren_token: SyntaxResult, -} -#[derive(Clone, PartialEq, Eq, Hash)] -pub struct CssVarFunctionValue { - pub(crate) syntax: SyntaxNode, -} -impl CssVarFunctionValue { - #[doc = r" Create an AstNode from a SyntaxNode without checking its kind"] - #[doc = r""] - #[doc = r" # Safety"] - #[doc = r" This function must be guarded with a call to [AstNode::can_cast]"] - #[doc = r" or a match on [SyntaxNode::kind]"] - #[inline] - pub const unsafe fn new_unchecked(syntax: SyntaxNode) -> Self { - Self { syntax } - } - pub fn as_fields(&self) -> CssVarFunctionValueFields { - CssVarFunctionValueFields { - comma_token: self.comma_token(), - value: self.value(), - } - } - pub fn comma_token(&self) -> SyntaxResult { - support::required_token(&self.syntax, 0usize) - } - pub fn value(&self) -> SyntaxResult { - support::required_node(&self.syntax, 1usize) - } -} -#[cfg(feature = "serde")] -impl Serialize for CssVarFunctionValue { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - self.as_fields().serialize(serializer) - } -} -#[cfg_attr(feature = "serde", derive(Serialize))] -pub struct CssVarFunctionValueFields { - pub comma_token: SyntaxResult, - pub value: SyntaxResult, -} -#[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] pub enum AnyCssAtRule { CssBogusAtRule(CssBogusAtRule), @@ -5538,13 +5477,13 @@ impl AnyCssDeclarationListBlock { #[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] pub enum AnyCssDeclarationName { - CssCustomProperty(CssCustomProperty), + CssDashedIdentifier(CssDashedIdentifier), CssIdentifier(CssIdentifier), } impl AnyCssDeclarationName { - pub fn as_css_custom_property(&self) -> Option<&CssCustomProperty> { + pub fn as_css_dashed_identifier(&self) -> Option<&CssDashedIdentifier> { match &self { - AnyCssDeclarationName::CssCustomProperty(item) => Some(item), + AnyCssDeclarationName::CssDashedIdentifier(item) => Some(item), _ => None, } } @@ -5647,13 +5586,13 @@ impl AnyCssFunction { #[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] pub enum AnyCssKeyframeName { - CssIdentifier(CssIdentifier), + CssCustomIdentifier(CssCustomIdentifier), CssString(CssString), } impl AnyCssKeyframeName { - pub fn as_css_identifier(&self) -> Option<&CssIdentifier> { + pub fn as_css_custom_identifier(&self) -> Option<&CssCustomIdentifier> { match &self { - AnyCssKeyframeName::CssIdentifier(item) => Some(item), + AnyCssKeyframeName::CssCustomIdentifier(item) => Some(item), _ => None, } } @@ -6645,7 +6584,8 @@ pub enum AnyCssValue { AnyCssDimension(AnyCssDimension), AnyCssFunction(AnyCssFunction), CssColor(CssColor), - CssCustomProperty(CssCustomProperty), + CssCustomIdentifier(CssCustomIdentifier), + CssDashedIdentifier(CssDashedIdentifier), CssIdentifier(CssIdentifier), CssNumber(CssNumber), CssRatio(CssRatio), @@ -6670,9 +6610,15 @@ impl AnyCssValue { _ => None, } } - pub fn as_css_custom_property(&self) -> Option<&CssCustomProperty> { + pub fn as_css_custom_identifier(&self) -> Option<&CssCustomIdentifier> { + match &self { + AnyCssValue::CssCustomIdentifier(item) => Some(item), + _ => None, + } + } + pub fn as_css_dashed_identifier(&self) -> Option<&CssDashedIdentifier> { match &self { - AnyCssValue::CssCustomProperty(item) => Some(item), + AnyCssValue::CssDashedIdentifier(item) => Some(item), _ => None, } } @@ -7719,12 +7665,12 @@ impl From for SyntaxElement { n.syntax.into() } } -impl AstNode for CssCustomProperty { +impl AstNode for CssCustomIdentifier { type Language = Language; const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(CSS_CUSTOM_PROPERTY as u16)); + SyntaxKindSet::from_raw(RawSyntaxKind(CSS_CUSTOM_IDENTIFIER as u16)); fn can_cast(kind: SyntaxKind) -> bool { - kind == CSS_CUSTOM_PROPERTY + kind == CSS_CUSTOM_IDENTIFIER } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { @@ -7740,20 +7686,64 @@ impl AstNode for CssCustomProperty { self.syntax } } -impl std::fmt::Debug for CssCustomProperty { +impl std::fmt::Debug for CssCustomIdentifier { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("CssCustomProperty") - .field("value", &support::DebugSyntaxResult(self.value())) + f.debug_struct("CssCustomIdentifier") + .field( + "value_token", + &support::DebugSyntaxResult(self.value_token()), + ) .finish() } } -impl From for SyntaxNode { - fn from(n: CssCustomProperty) -> SyntaxNode { +impl From for SyntaxNode { + fn from(n: CssCustomIdentifier) -> SyntaxNode { n.syntax } } -impl From for SyntaxElement { - fn from(n: CssCustomProperty) -> SyntaxElement { +impl From for SyntaxElement { + fn from(n: CssCustomIdentifier) -> SyntaxElement { + n.syntax.into() + } +} +impl AstNode for CssDashedIdentifier { + type Language = Language; + const KIND_SET: SyntaxKindSet = + SyntaxKindSet::from_raw(RawSyntaxKind(CSS_DASHED_IDENTIFIER as u16)); + fn can_cast(kind: SyntaxKind) -> bool { + kind == CSS_DASHED_IDENTIFIER + } + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } + fn into_syntax(self) -> SyntaxNode { + self.syntax + } +} +impl std::fmt::Debug for CssDashedIdentifier { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("CssDashedIdentifier") + .field( + "value_token", + &support::DebugSyntaxResult(self.value_token()), + ) + .finish() + } +} +impl From for SyntaxNode { + fn from(n: CssDashedIdentifier) -> SyntaxNode { + n.syntax + } +} +impl From for SyntaxElement { + fn from(n: CssDashedIdentifier) -> SyntaxElement { n.syntax.into() } } @@ -11613,96 +11603,6 @@ impl From for SyntaxElement { n.syntax.into() } } -impl AstNode for CssVarFunction { - type Language = Language; - const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(CSS_VAR_FUNCTION as u16)); - fn can_cast(kind: SyntaxKind) -> bool { - kind == CSS_VAR_FUNCTION - } - fn cast(syntax: SyntaxNode) -> Option { - if Self::can_cast(syntax.kind()) { - Some(Self { syntax }) - } else { - None - } - } - fn syntax(&self) -> &SyntaxNode { - &self.syntax - } - fn into_syntax(self) -> SyntaxNode { - self.syntax - } -} -impl std::fmt::Debug for CssVarFunction { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("CssVarFunction") - .field("var_token", &support::DebugSyntaxResult(self.var_token())) - .field( - "l_paren_token", - &support::DebugSyntaxResult(self.l_paren_token()), - ) - .field("property", &support::DebugSyntaxResult(self.property())) - .field("value", &support::DebugOptionalElement(self.value())) - .field( - "r_paren_token", - &support::DebugSyntaxResult(self.r_paren_token()), - ) - .finish() - } -} -impl From for SyntaxNode { - fn from(n: CssVarFunction) -> SyntaxNode { - n.syntax - } -} -impl From for SyntaxElement { - fn from(n: CssVarFunction) -> SyntaxElement { - n.syntax.into() - } -} -impl AstNode for CssVarFunctionValue { - type Language = Language; - const KIND_SET: SyntaxKindSet = - SyntaxKindSet::from_raw(RawSyntaxKind(CSS_VAR_FUNCTION_VALUE as u16)); - fn can_cast(kind: SyntaxKind) -> bool { - kind == CSS_VAR_FUNCTION_VALUE - } - fn cast(syntax: SyntaxNode) -> Option { - if Self::can_cast(syntax.kind()) { - Some(Self { syntax }) - } else { - None - } - } - fn syntax(&self) -> &SyntaxNode { - &self.syntax - } - fn into_syntax(self) -> SyntaxNode { - self.syntax - } -} -impl std::fmt::Debug for CssVarFunctionValue { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("CssVarFunctionValue") - .field( - "comma_token", - &support::DebugSyntaxResult(self.comma_token()), - ) - .field("value", &support::DebugSyntaxResult(self.value())) - .finish() - } -} -impl From for SyntaxNode { - fn from(n: CssVarFunctionValue) -> SyntaxNode { - n.syntax - } -} -impl From for SyntaxElement { - fn from(n: CssVarFunctionValue) -> SyntaxElement { - n.syntax.into() - } -} impl From for AnyCssAtRule { fn from(node: CssBogusAtRule) -> AnyCssAtRule { AnyCssAtRule::CssBogusAtRule(node) @@ -12775,9 +12675,9 @@ impl From for SyntaxElement { node.into() } } -impl From for AnyCssDeclarationName { - fn from(node: CssCustomProperty) -> AnyCssDeclarationName { - AnyCssDeclarationName::CssCustomProperty(node) +impl From for AnyCssDeclarationName { + fn from(node: CssDashedIdentifier) -> AnyCssDeclarationName { + AnyCssDeclarationName::CssDashedIdentifier(node) } } impl From for AnyCssDeclarationName { @@ -12788,14 +12688,14 @@ impl From for AnyCssDeclarationName { impl AstNode for AnyCssDeclarationName { type Language = Language; const KIND_SET: SyntaxKindSet = - CssCustomProperty::KIND_SET.union(CssIdentifier::KIND_SET); + CssDashedIdentifier::KIND_SET.union(CssIdentifier::KIND_SET); fn can_cast(kind: SyntaxKind) -> bool { - matches!(kind, CSS_CUSTOM_PROPERTY | CSS_IDENTIFIER) + matches!(kind, CSS_DASHED_IDENTIFIER | CSS_IDENTIFIER) } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { - CSS_CUSTOM_PROPERTY => { - AnyCssDeclarationName::CssCustomProperty(CssCustomProperty { syntax }) + CSS_DASHED_IDENTIFIER => { + AnyCssDeclarationName::CssDashedIdentifier(CssDashedIdentifier { syntax }) } CSS_IDENTIFIER => AnyCssDeclarationName::CssIdentifier(CssIdentifier { syntax }), _ => return None, @@ -12804,13 +12704,13 @@ impl AstNode for AnyCssDeclarationName { } fn syntax(&self) -> &SyntaxNode { match self { - AnyCssDeclarationName::CssCustomProperty(it) => &it.syntax, + AnyCssDeclarationName::CssDashedIdentifier(it) => &it.syntax, AnyCssDeclarationName::CssIdentifier(it) => &it.syntax, } } fn into_syntax(self) -> SyntaxNode { match self { - AnyCssDeclarationName::CssCustomProperty(it) => it.syntax, + AnyCssDeclarationName::CssDashedIdentifier(it) => it.syntax, AnyCssDeclarationName::CssIdentifier(it) => it.syntax, } } @@ -12818,7 +12718,7 @@ impl AstNode for AnyCssDeclarationName { impl std::fmt::Debug for AnyCssDeclarationName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - AnyCssDeclarationName::CssCustomProperty(it) => std::fmt::Debug::fmt(it, f), + AnyCssDeclarationName::CssDashedIdentifier(it) => std::fmt::Debug::fmt(it, f), AnyCssDeclarationName::CssIdentifier(it) => std::fmt::Debug::fmt(it, f), } } @@ -12826,7 +12726,7 @@ impl std::fmt::Debug for AnyCssDeclarationName { impl From for SyntaxNode { fn from(n: AnyCssDeclarationName) -> SyntaxNode { match n { - AnyCssDeclarationName::CssCustomProperty(it) => it.into(), + AnyCssDeclarationName::CssDashedIdentifier(it) => it.into(), AnyCssDeclarationName::CssIdentifier(it) => it.into(), } } @@ -13109,9 +13009,9 @@ impl From for SyntaxElement { node.into() } } -impl From for AnyCssKeyframeName { - fn from(node: CssIdentifier) -> AnyCssKeyframeName { - AnyCssKeyframeName::CssIdentifier(node) +impl From for AnyCssKeyframeName { + fn from(node: CssCustomIdentifier) -> AnyCssKeyframeName { + AnyCssKeyframeName::CssCustomIdentifier(node) } } impl From for AnyCssKeyframeName { @@ -13121,13 +13021,16 @@ impl From for AnyCssKeyframeName { } impl AstNode for AnyCssKeyframeName { type Language = Language; - const KIND_SET: SyntaxKindSet = CssIdentifier::KIND_SET.union(CssString::KIND_SET); + const KIND_SET: SyntaxKindSet = + CssCustomIdentifier::KIND_SET.union(CssString::KIND_SET); fn can_cast(kind: SyntaxKind) -> bool { - matches!(kind, CSS_IDENTIFIER | CSS_STRING) + matches!(kind, CSS_CUSTOM_IDENTIFIER | CSS_STRING) } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { - CSS_IDENTIFIER => AnyCssKeyframeName::CssIdentifier(CssIdentifier { syntax }), + CSS_CUSTOM_IDENTIFIER => { + AnyCssKeyframeName::CssCustomIdentifier(CssCustomIdentifier { syntax }) + } CSS_STRING => AnyCssKeyframeName::CssString(CssString { syntax }), _ => return None, }; @@ -13135,13 +13038,13 @@ impl AstNode for AnyCssKeyframeName { } fn syntax(&self) -> &SyntaxNode { match self { - AnyCssKeyframeName::CssIdentifier(it) => &it.syntax, + AnyCssKeyframeName::CssCustomIdentifier(it) => &it.syntax, AnyCssKeyframeName::CssString(it) => &it.syntax, } } fn into_syntax(self) -> SyntaxNode { match self { - AnyCssKeyframeName::CssIdentifier(it) => it.syntax, + AnyCssKeyframeName::CssCustomIdentifier(it) => it.syntax, AnyCssKeyframeName::CssString(it) => it.syntax, } } @@ -13149,7 +13052,7 @@ impl AstNode for AnyCssKeyframeName { impl std::fmt::Debug for AnyCssKeyframeName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - AnyCssKeyframeName::CssIdentifier(it) => std::fmt::Debug::fmt(it, f), + AnyCssKeyframeName::CssCustomIdentifier(it) => std::fmt::Debug::fmt(it, f), AnyCssKeyframeName::CssString(it) => std::fmt::Debug::fmt(it, f), } } @@ -13157,7 +13060,7 @@ impl std::fmt::Debug for AnyCssKeyframeName { impl From for SyntaxNode { fn from(n: AnyCssKeyframeName) -> SyntaxNode { match n { - AnyCssKeyframeName::CssIdentifier(it) => it.into(), + AnyCssKeyframeName::CssCustomIdentifier(it) => it.into(), AnyCssKeyframeName::CssString(it) => it.into(), } } @@ -16022,9 +15925,14 @@ impl From for AnyCssValue { AnyCssValue::CssColor(node) } } -impl From for AnyCssValue { - fn from(node: CssCustomProperty) -> AnyCssValue { - AnyCssValue::CssCustomProperty(node) +impl From for AnyCssValue { + fn from(node: CssCustomIdentifier) -> AnyCssValue { + AnyCssValue::CssCustomIdentifier(node) + } +} +impl From for AnyCssValue { + fn from(node: CssDashedIdentifier) -> AnyCssValue { + AnyCssValue::CssDashedIdentifier(node) } } impl From for AnyCssValue { @@ -16052,14 +15960,20 @@ impl AstNode for AnyCssValue { const KIND_SET: SyntaxKindSet = AnyCssDimension::KIND_SET .union(AnyCssFunction::KIND_SET) .union(CssColor::KIND_SET) - .union(CssCustomProperty::KIND_SET) + .union(CssCustomIdentifier::KIND_SET) + .union(CssDashedIdentifier::KIND_SET) .union(CssIdentifier::KIND_SET) .union(CssNumber::KIND_SET) .union(CssRatio::KIND_SET) .union(CssString::KIND_SET); fn can_cast(kind: SyntaxKind) -> bool { match kind { - CSS_COLOR | CSS_CUSTOM_PROPERTY | CSS_IDENTIFIER | CSS_NUMBER | CSS_RATIO + CSS_COLOR + | CSS_CUSTOM_IDENTIFIER + | CSS_DASHED_IDENTIFIER + | CSS_IDENTIFIER + | CSS_NUMBER + | CSS_RATIO | CSS_STRING => true, k if AnyCssDimension::can_cast(k) => true, k if AnyCssFunction::can_cast(k) => true, @@ -16069,7 +15983,12 @@ impl AstNode for AnyCssValue { fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { CSS_COLOR => AnyCssValue::CssColor(CssColor { syntax }), - CSS_CUSTOM_PROPERTY => AnyCssValue::CssCustomProperty(CssCustomProperty { syntax }), + CSS_CUSTOM_IDENTIFIER => { + AnyCssValue::CssCustomIdentifier(CssCustomIdentifier { syntax }) + } + CSS_DASHED_IDENTIFIER => { + AnyCssValue::CssDashedIdentifier(CssDashedIdentifier { syntax }) + } CSS_IDENTIFIER => AnyCssValue::CssIdentifier(CssIdentifier { syntax }), CSS_NUMBER => AnyCssValue::CssNumber(CssNumber { syntax }), CSS_RATIO => AnyCssValue::CssRatio(CssRatio { syntax }), @@ -16089,7 +16008,8 @@ impl AstNode for AnyCssValue { fn syntax(&self) -> &SyntaxNode { match self { AnyCssValue::CssColor(it) => &it.syntax, - AnyCssValue::CssCustomProperty(it) => &it.syntax, + AnyCssValue::CssCustomIdentifier(it) => &it.syntax, + AnyCssValue::CssDashedIdentifier(it) => &it.syntax, AnyCssValue::CssIdentifier(it) => &it.syntax, AnyCssValue::CssNumber(it) => &it.syntax, AnyCssValue::CssRatio(it) => &it.syntax, @@ -16101,7 +16021,8 @@ impl AstNode for AnyCssValue { fn into_syntax(self) -> SyntaxNode { match self { AnyCssValue::CssColor(it) => it.syntax, - AnyCssValue::CssCustomProperty(it) => it.syntax, + AnyCssValue::CssCustomIdentifier(it) => it.syntax, + AnyCssValue::CssDashedIdentifier(it) => it.syntax, AnyCssValue::CssIdentifier(it) => it.syntax, AnyCssValue::CssNumber(it) => it.syntax, AnyCssValue::CssRatio(it) => it.syntax, @@ -16117,7 +16038,8 @@ impl std::fmt::Debug for AnyCssValue { AnyCssValue::AnyCssDimension(it) => std::fmt::Debug::fmt(it, f), AnyCssValue::AnyCssFunction(it) => std::fmt::Debug::fmt(it, f), AnyCssValue::CssColor(it) => std::fmt::Debug::fmt(it, f), - AnyCssValue::CssCustomProperty(it) => std::fmt::Debug::fmt(it, f), + AnyCssValue::CssCustomIdentifier(it) => std::fmt::Debug::fmt(it, f), + AnyCssValue::CssDashedIdentifier(it) => std::fmt::Debug::fmt(it, f), AnyCssValue::CssIdentifier(it) => std::fmt::Debug::fmt(it, f), AnyCssValue::CssNumber(it) => std::fmt::Debug::fmt(it, f), AnyCssValue::CssRatio(it) => std::fmt::Debug::fmt(it, f), @@ -16131,7 +16053,8 @@ impl From for SyntaxNode { AnyCssValue::AnyCssDimension(it) => it.into(), AnyCssValue::AnyCssFunction(it) => it.into(), AnyCssValue::CssColor(it) => it.into(), - AnyCssValue::CssCustomProperty(it) => it.into(), + AnyCssValue::CssCustomIdentifier(it) => it.into(), + AnyCssValue::CssDashedIdentifier(it) => it.into(), AnyCssValue::CssIdentifier(it) => it.into(), AnyCssValue::CssNumber(it) => it.into(), AnyCssValue::CssRatio(it) => it.into(), @@ -16535,7 +16458,12 @@ impl std::fmt::Display for CssCounterStyleAtRule { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for CssCustomProperty { +impl std::fmt::Display for CssCustomIdentifier { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} +impl std::fmt::Display for CssDashedIdentifier { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } @@ -16995,16 +16923,6 @@ impl std::fmt::Display for CssUrlValueRaw { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for CssVarFunction { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} -impl std::fmt::Display for CssVarFunctionValue { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} #[derive(Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize))] pub struct CssBogus { diff --git a/crates/biome_css_syntax/src/generated/nodes_mut.rs b/crates/biome_css_syntax/src/generated/nodes_mut.rs index 12c2b4e18622..4643e58ddb17 100644 --- a/crates/biome_css_syntax/src/generated/nodes_mut.rs +++ b/crates/biome_css_syntax/src/generated/nodes_mut.rs @@ -132,7 +132,7 @@ impl CssClassSelector { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: CssIdentifier) -> Self { + pub fn with_name(self, element: CssCustomIdentifier) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -160,7 +160,7 @@ impl CssColorProfileAtRule { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: CssIdentifier) -> Self { + pub fn with_name(self, element: CssCustomIdentifier) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -240,7 +240,7 @@ impl CssContainerAtRule { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: Option) -> Self { + pub fn with_name(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( 1usize..=1usize, once(element.map(|element| element.into_syntax().into())), @@ -440,7 +440,7 @@ impl CssCounterStyleAtRule { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: CssIdentifier) -> Self { + pub fn with_name(self, element: CssCustomIdentifier) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -453,11 +453,19 @@ impl CssCounterStyleAtRule { ) } } -impl CssCustomProperty { - pub fn with_value(self, element: CssIdentifier) -> Self { +impl CssCustomIdentifier { + pub fn with_value_token(self, element: SyntaxToken) -> Self { Self::unwrap_cast( self.syntax - .splice_slots(0usize..=0usize, once(Some(element.into_syntax().into()))), + .splice_slots(0usize..=0usize, once(Some(element.into()))), + ) + } +} +impl CssDashedIdentifier { + pub fn with_value_token(self, element: SyntaxToken) -> Self { + Self::unwrap_cast( + self.syntax + .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } } @@ -576,7 +584,7 @@ impl CssFontPaletteValuesAtRule { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: CssIdentifier) -> Self { + pub fn with_name(self, element: CssDashedIdentifier) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -596,7 +604,7 @@ impl CssIdSelector { .splice_slots(0usize..=0usize, once(Some(element.into()))), ) } - pub fn with_name(self, element: CssIdentifier) -> Self { + pub fn with_name(self, element: CssCustomIdentifier) -> Self { Self::unwrap_cast( self.syntax .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), @@ -1000,7 +1008,7 @@ impl CssPageAtRuleBlock { } } impl CssPageSelector { - pub fn with_ty(self, element: Option) -> Self { + pub fn with_ty(self, element: Option) -> Self { Self::unwrap_cast(self.syntax.splice_slots( 0usize..=0usize, once(element.map(|element| element.into_syntax().into())), @@ -1999,49 +2007,3 @@ impl CssUrlValueRaw { ) } } -impl CssVarFunction { - pub fn with_var_token(self, element: SyntaxToken) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(0usize..=0usize, once(Some(element.into()))), - ) - } - pub fn with_l_paren_token(self, element: SyntaxToken) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(1usize..=1usize, once(Some(element.into()))), - ) - } - pub fn with_property(self, element: CssCustomProperty) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(2usize..=2usize, once(Some(element.into_syntax().into()))), - ) - } - pub fn with_value(self, element: Option) -> Self { - Self::unwrap_cast(self.syntax.splice_slots( - 3usize..=3usize, - once(element.map(|element| element.into_syntax().into())), - )) - } - pub fn with_r_paren_token(self, element: SyntaxToken) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(4usize..=4usize, once(Some(element.into()))), - ) - } -} -impl CssVarFunctionValue { - pub fn with_comma_token(self, element: SyntaxToken) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(0usize..=0usize, once(Some(element.into()))), - ) - } - pub fn with_value(self, element: CssIdentifier) -> Self { - Self::unwrap_cast( - self.syntax - .splice_slots(1usize..=1usize, once(Some(element.into_syntax().into()))), - ) - } -} diff --git a/xtask/codegen/css.ungram b/xtask/codegen/css.ungram index abd5cec54aa6..1bd1f108ede2 100644 --- a/xtask/codegen/css.ungram +++ b/xtask/codegen/css.ungram @@ -155,13 +155,13 @@ CssUniversalNamespacePrefix = // ^^^^ CssIdSelector = '#' - name: CssIdentifier + name: CssCustomIdentifier // .app {} // ^^^^ CssClassSelector = '.' - name: CssIdentifier + name: CssCustomIdentifier // [title = "title" i] {} // ^^^^^^^^^^^^^^^^^^^ @@ -452,7 +452,7 @@ CssDeclaration = CssComponentValueList = AnyCssValue* -AnyCssDeclarationName = CssIdentifier | CssCustomProperty +AnyCssDeclarationName = CssIdentifier | CssDashedIdentifier CssDeclarationImportant = '!' @@ -492,14 +492,15 @@ CssCharsetAtRule = // ^^^^^^^^^^^^^^^^^^^^^^^^ // @color-profile device-cmyk {} // ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// TODO: `name` should be ` | device-cmyk` instead CssColorProfileAtRule = 'color-profile' - name: CssIdentifier + name: CssCustomIdentifier block: AnyCssDeclarationListBlock CssCounterStyleAtRule = 'counter-style' - name: CssIdentifier + name: CssCustomIdentifier block: AnyCssDeclarationListBlock // @font-face {} @@ -513,7 +514,7 @@ CssFontFaceAtRule = // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CssFontPaletteValuesAtRule = 'font-palette-values' - name: CssIdentifier + name: CssDashedIdentifier block: AnyCssDeclarationListBlock @@ -543,7 +544,7 @@ CssFontPaletteValuesAtRule = // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CssContainerAtRule = 'container' - name: CssIdentifier? + name: CssCustomIdentifier? query: AnyCssContainerQuery block: AnyCssRuleListBlock @@ -684,7 +685,7 @@ AnyCssKeyframesBlock = // @keyframes "something" { from {} to {} } // ^^^^^^^^^^^ -AnyCssKeyframeName = CssIdentifier | CssString +AnyCssKeyframeName = CssCustomIdentifier | CssString // @keyframes "something" { from {} to {} } // ^^^^^^^^^^^^^^^^^ @@ -934,9 +935,12 @@ AnyCssPageSelector = | CssBogusSelector // @page name:first,:blank:first { } -// ^^^^^^^^^^ ^^^^^^^^^^^^ +// ^^^^^^^^^^ ^^^^^^^^^^^^ +// NOTE: The CSS Spec uses `` for the name, but also explicitly states +// that the name is case sensitive. For simplicity, `` gets the +// exact same behavior. CssPageSelector = - type: CssIdentifier? + type: CssCustomIdentifier? pseudos: CssPageSelectorPseudoList CssPageSelectorPseudoList = AnyCssPageSelectorPseudo* @@ -1162,12 +1166,13 @@ CssScopeEdge = AnyCssValue = CssIdentifier + | CssCustomIdentifier + | CssDashedIdentifier | CssString | CssNumber | AnyCssDimension | CssRatio | AnyCssFunction - | CssCustomProperty | CssColor @@ -1210,26 +1215,10 @@ AnyCssUrlValue = CssUrlValueRaw | CssString - -CssVarFunction = - 'var' - '(' - property: CssCustomProperty - value: CssVarFunctionValue? - ')' - -CssVarFunctionValue = - ',' - value: CssIdentifier - CssPercentage = value: CssNumber '%' - -// parsed with --ident -CssCustomProperty = value: CssIdentifier - CssParameterList = CssParameter (',' CssParameter)* ','? // cubic-bezier(0.1, 0.7, 1.0, 0.1) @@ -1262,7 +1251,14 @@ CssColor = '#' value:'css_color_literal' +// Any identifier. Case insensitve, used for standard property names, values, type selectors, etc. CssIdentifier = value: 'ident' +// Any non-standard identifier. Case sensitive, used for class names, ids, etc. Custom identifiers +// _may_ overlap with standard identifiers defined by CSS (e.g., `color`). +CssCustomIdentifier = value: 'ident' +// An identifier starting with two dashes, `--`. Case sensitive, used for custom property names. +// Dashed identifiers are guaranteed to never overlap with an identifier defined by CSS. +CssDashedIdentifier = value: 'ident' CssString = value: 'css_string_literal' CssNumber = value: 'css_number_literal' CssUrlValueRaw = value: 'css_url_value_raw_literal' diff --git a/xtask/codegen/src/css_kinds_src.rs b/xtask/codegen/src/css_kinds_src.rs index 1385adabca6d..604e0e72a8c3 100644 --- a/xtask/codegen/src/css_kinds_src.rs +++ b/xtask/codegen/src/css_kinds_src.rs @@ -202,7 +202,8 @@ pub const CSS_KINDS_SRC: KindsSrc = KindsSrc { literals: &[ "CSS_STRING_LITERAL", "CSS_NUMBER_LITERAL", - "CSS_CUSTOM_PROPERTY", + "CSS_DASHED_IDENTIFIER", + "CSS_CUSTOM_IDENTIFIER", "CSS_SPACE_LITERAL", "CSS_URL_VALUE_RAW_LITERAL", "CSS_COLOR_LITERAL",