refactor(css/ast): Refactor dashed ident (#6198)

This commit is contained in:
Alexander Akait 2022-10-19 06:58:16 +03:00 committed by GitHub
parent 14a612447f
commit 6c170e59c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 1589 additions and 992 deletions

View File

@ -726,6 +726,7 @@ counter-style
createClass
createReactClass
cubic-bezier
custom-media
cursor
data
datalist

View File

@ -1140,7 +1140,7 @@ where
})) => false,
_ => !self.config.minify,
},
ComponentValue::Ident(_) => match next {
ComponentValue::Ident(_) | ComponentValue::DashedIdent(_) => match next {
Some(ComponentValue::SimpleBlock(SimpleBlock { name, .. })) => {
if name.token == Token::LParen {
true
@ -1509,12 +1509,16 @@ where
#[emitter]
fn emit_dashed_ident(&mut self, n: &DashedIdent) -> Result {
if self.config.minify {
write_raw!(self, lo_span_offset!(n.span, 2), "--");
let serialized = serialize_ident(&n.value, n.raw.as_deref(), true);
write_raw!(self, n.span, &serialized);
} else if let Some(raw) = &n.raw {
write_raw!(self, n.span, raw);
} else {
write_raw!(self, lo_span_offset!(n.span, 2), "--");
let serialized = serialize_ident(&n.value, n.raw.as_deref(), false);
write_raw!(self, n.span, &serialized);

View File

@ -69,7 +69,7 @@ div {
@supports ( . --x : y , z ) { a { color: red; } }
* {
counter-reset: -- --a -a;
counter-reset: --a --a -a;
--dash:-;
}
@ -102,3 +102,7 @@ div {
counter-increment: -a;
content: counter(-a);
}
* {
counter-reset: --a "string";
}

View File

@ -161,7 +161,7 @@ div {
}
}
* {
counter-reset: -- --a -a;
counter-reset: --a --a -a;
--dash: -;
}
#test_1 span::before {
@ -188,3 +188,6 @@ div {
counter-increment: -a;
content: counter(-a);
}
* {
counter-reset: --a "string";
}

View File

@ -1,2 +1,2 @@
div{--y: ;--x:var(--y) ;--z:0px;--foo:if(x > 5) this.width = 10;--bar: ;--bar2: ;--yz:foo !important}div{width:var(--a,)}.motion-safe\:shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-1:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),
0 2px 4px -2px var(--tw-shadow-color)}*{--x: }*{--x: }*{--x: }*{--x: }*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x:y}*{--x:y}*{--x:y }*{--x:y, }*{--x:var(y,)}*{--x:var(y, )}*{--x:(y)}*{--x:(y) }*{--x:(y)}*{--x:(y )}*{--x:( y)}*{--x:f(y)}*{--x:f(y) }*{--x:f(y)}*{--x:f(y )}*{--x:f( y)}*{--x:[y]}*{--x:[y] }*{--x:[y]}*{--x:[y ]}*{--x:[ y]}*{--x:{y}}*{--x:{y} }*{--x:{y}}*{--x:{y }}*{--x:{ y}}@supports(--x:y , z ){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x ) {a{color:red}}@supports ( ) {a{color:red}}@supports ( . --x : y , z ) {a{color:red}}*{counter-reset:-- --a -a;--dash:-}#test_1 span::before{counter-increment:var(--dash)-;content:counter(--)}#test_2 span::before{counter-increment:var(--dash)-a;content:counter(--a)}#test_3 span::before{counter-increment:var(--dash)a;content:counter(-a)}#control_1 span::before{counter-increment:--;content:counter(--)}#control_2 span::before{counter-increment:--a;content:counter(--a)}#control_3 span::before{counter-increment:-a;content:counter(-a)}
0 2px 4px -2px var(--tw-shadow-color)}*{--x: }*{--x: }*{--x: }*{--x: }*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x: !important}*{--x:y}*{--x:y}*{--x:y }*{--x:y, }*{--x:var(y,)}*{--x:var(y, )}*{--x:(y)}*{--x:(y) }*{--x:(y)}*{--x:(y )}*{--x:( y)}*{--x:f(y)}*{--x:f(y) }*{--x:f(y)}*{--x:f(y )}*{--x:f( y)}*{--x:[y]}*{--x:[y] }*{--x:[y]}*{--x:[y ]}*{--x:[ y]}*{--x:{y}}*{--x:{y} }*{--x:{y}}*{--x:{y }}*{--x:{ y}}@supports(--x:y , z ){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x ) {a{color:red}}@supports ( ) {a{color:red}}@supports ( . --x : y , z ) {a{color:red}}*{counter-reset:--a --a -a;--dash:-}#test_1 span::before{counter-increment:var(--dash)-;content:counter(--)}#test_2 span::before{counter-increment:var(--dash)-a;content:counter(--a)}#test_3 span::before{counter-increment:var(--dash)a;content:counter(-a)}#control_1 span::before{counter-increment:--;content:counter(--)}#control_2 span::before{counter-increment:--a;content:counter(--a)}#control_3 span::before{counter-increment:-a;content:counter(-a)}*{counter-reset:--a"string"}

View File

@ -51,7 +51,7 @@ impl Visit for CustomPropertyNoMissingVarFunction {
self.ctx.report(
dashed_ident,
format!(
"Unexpected missing var function for '{}'.",
"Unexpected missing var function for '--{}'.",
dashed_ident.value
),
);

View File

@ -1,3 +1,4 @@
use swc_atoms::js_word;
use swc_common::{BytePos, Span};
use swc_css_ast::*;
@ -23,7 +24,6 @@ where
unreachable!()
}
};
let lowercased_name = &*at_keyword_name.0.to_ascii_lowercase();
let at_rule_name = if at_keyword_name.0.starts_with("--") {
AtRuleName::DashedIdent(DashedIdent {
span: Span::new(
@ -51,9 +51,16 @@ where
prelude: None,
block: None,
};
let lowercased_name = match &at_rule.name {
AtRuleName::Ident(ident) => ident.value.to_ascii_lowercase(),
AtRuleName::DashedIdent(dashed_ident) => dashed_ident.value.to_ascii_lowercase(),
};
let parse_prelude = |parser: &mut Parser<I>| -> PResult<Option<Box<AtRulePrelude>>> {
match lowercased_name {
"viewport" | "-ms-viewport" | "-o-viewport" | "font-face" => {
js_word!("viewport")
| js_word!("-ms-viewport")
| js_word!("-o-viewport")
| js_word!("font-face") => {
parser.input.skip_ws();
if !is!(parser, "{") {
@ -64,7 +71,7 @@ where
Ok(None)
}
"charset" => {
js_word!("charset") => {
parser.input.skip_ws();
let span = parser.input.cur_span();
@ -87,7 +94,7 @@ where
Ok(Some(Box::new(prelude)))
}
"container" => {
js_word!("container") => {
parser.input.skip_ws();
let prelude = AtRulePrelude::ContainerPrelude(parser.parse()?);
@ -102,7 +109,7 @@ where
Ok(Some(Box::new(prelude)))
}
"counter-style" => {
js_word!("counter-style") => {
parser.input.skip_ws();
let prelude = AtRulePrelude::CounterStylePrelude(parser.parse()?);
@ -117,7 +124,7 @@ where
Ok(Some(Box::new(prelude)))
}
"font-palette-values" => {
js_word!("font-palette-values") => {
parser.input.skip_ws();
let prelude = AtRulePrelude::FontPaletteValuesPrelude(parser.parse()?);
@ -132,7 +139,7 @@ where
Ok(Some(Box::new(prelude)))
}
"font-feature-values" => {
js_word!("font-feature-values") => {
parser.input.skip_ws();
let prelude = AtRulePrelude::FontFeatureValuesPrelude(parser.parse()?);
@ -147,15 +154,20 @@ where
Ok(Some(Box::new(prelude)))
}
"stylistic" | "historical-forms" | "styleset" | "character-variant" | "swash"
| "ornaments" | "annotation"
js_word!("stylistic")
| js_word!("historical-forms")
| js_word!("styleset")
| js_word!("character-variant")
| js_word!("swash")
| js_word!("ornaments")
| js_word!("annotation")
if parser.ctx.in_font_feature_values_at_rule =>
{
parser.input.skip_ws();
Ok(None)
}
"layer" => {
js_word!("layer") => {
parser.input.skip_ws();
let prelude = if is!(parser, Ident) {
@ -219,7 +231,7 @@ where
Ok(prelude.map(Box::new))
}
"document" | "-moz-document" => {
js_word!("document") | js_word!("-moz-document") => {
parser.input.skip_ws();
let span = parser.input.cur_span();
@ -253,7 +265,7 @@ where
Ok(Some(Box::new(prelude)))
}
"page" => {
js_word!("page") => {
parser.input.skip_ws();
let prelude = if !is!(parser, "{") {
@ -266,29 +278,29 @@ where
Ok(prelude.map(Box::new))
}
"top-left-corner"
| "top-left"
| "top-center"
| "top-right"
| "top-right-corner"
| "bottom-left-corner"
| "bottom-left"
| "bottom-center"
| "bottom-right"
| "bottom-right-corner"
| "left-top"
| "left-middle"
| "left-bottom"
| "right-top"
| "right-middle"
| "right-bottom"
js_word!("top-left-corner")
| js_word!("top-left")
| js_word!("top-center")
| js_word!("top-right")
| js_word!("top-right-corner")
| js_word!("bottom-left-corner")
| js_word!("bottom-left")
| js_word!("bottom-center")
| js_word!("bottom-right")
| js_word!("bottom-right-corner")
| js_word!("left-top")
| js_word!("left-middle")
| js_word!("left-bottom")
| js_word!("right-top")
| js_word!("right-middle")
| js_word!("right-bottom")
if parser.ctx.in_page_at_rule =>
{
parser.input.skip_ws();
Ok(None)
}
"property" => {
js_word!("property") => {
parser.input.skip_ws();
let prelude = AtRulePrelude::PropertyPrelude(parser.parse()?);
@ -303,7 +315,7 @@ where
Ok(Some(Box::new(prelude)))
}
"namespace" => {
js_word!("namespace") => {
parser.input.skip_ws();
let span = parser.input.cur_span();
@ -348,7 +360,7 @@ where
Ok(Some(Box::new(prelude)))
}
"color-profile" => {
js_word!("color-profile") => {
parser.input.skip_ws();
let name = match cur!(parser) {
@ -378,7 +390,7 @@ where
Ok(Some(prelude))
}
"nest" => {
js_word!("nest") => {
parser.input.skip_ws();
let prelude = Box::new(AtRulePrelude::NestPrelude(parser.parse()?));
@ -393,7 +405,7 @@ where
Ok(Some(prelude))
}
"media" => {
js_word!("media") => {
parser.input.skip_ws();
let media = if !is!(parser, "{") {
@ -408,7 +420,7 @@ where
Ok(media)
}
"supports" => {
js_word!("supports") => {
parser.input.skip_ws();
let prelude = Box::new(AtRulePrelude::SupportsPrelude(parser.parse()?));
@ -417,7 +429,7 @@ where
Ok(Some(prelude))
}
"import" => {
js_word!("import") => {
parser.input.skip_ws();
let span = parser.input.cur_span();
@ -541,8 +553,11 @@ where
Ok(Some(prelude))
}
"keyframes" | "-webkit-keyframes" | "-moz-keyframes" | "-o-keyframes"
| "-ms-keyframes" => {
js_word!("keyframes")
| js_word!("-webkit-keyframes")
| js_word!("-moz-keyframes")
| js_word!("-o-keyframes")
| js_word!("-ms-keyframes") => {
parser.input.skip_ws();
let prelude = Box::new(AtRulePrelude::KeyframesPrelude(parser.parse()?));
@ -557,7 +572,7 @@ where
Ok(Some(prelude))
}
"custom-media" => {
js_word!("custom-media") => {
parser.input.skip_ws();
let prelude = Box::new(AtRulePrelude::CustomMediaPrelude(parser.parse()?));
@ -575,69 +590,71 @@ where
};
let parse_simple_block = |parser: &mut Parser<I>| -> PResult<SimpleBlock> {
let ctx = match lowercased_name {
"viewport"
| "-o-viewport"
| "-ms-viewport"
| "font-face"
| "font-palette-values"
| "stylistic"
| "historical-forms"
| "styleset"
| "character-variant"
| "swash"
| "ornaments"
| "annotation"
| "property"
| "color-profile"
| "counter-style"
| "top-left-corner"
| "top-left"
| "top-center"
| "top-right"
| "top-right-corner"
| "bottom-left-corner"
| "bottom-left"
| "bottom-center"
| "bottom-right"
| "bottom-right-corner"
| "left-top"
| "left-middle"
| "left-bottom"
| "right-top"
| "right-middle"
| "right-bottom" => Ctx {
js_word!("viewport")
| js_word!("-o-viewport")
| js_word!("-ms-viewport")
| js_word!("font-face")
| js_word!("font-palette-values")
| js_word!("stylistic")
| js_word!("historical-forms")
| js_word!("styleset")
| js_word!("character-variant")
| js_word!("swash")
| js_word!("ornaments")
| js_word!("annotation")
| js_word!("property")
| js_word!("color-profile")
| js_word!("counter-style")
| js_word!("top-left-corner")
| js_word!("top-left")
| js_word!("top-center")
| js_word!("top-right")
| js_word!("top-right-corner")
| js_word!("bottom-left-corner")
| js_word!("bottom-left")
| js_word!("bottom-center")
| js_word!("bottom-right")
| js_word!("bottom-right-corner")
| js_word!("left-top")
| js_word!("left-middle")
| js_word!("left-bottom")
| js_word!("right-top")
| js_word!("right-middle")
| js_word!("right-bottom") => Ctx {
block_contents_grammar: BlockContentsGrammar::DeclarationList,
..parser.ctx
},
"font-feature-values" => Ctx {
js_word!("font-feature-values") => Ctx {
in_font_feature_values_at_rule: true,
block_contents_grammar: BlockContentsGrammar::DeclarationList,
..parser.ctx
},
"page" => Ctx {
js_word!("page") => Ctx {
in_page_at_rule: true,
block_contents_grammar: BlockContentsGrammar::DeclarationList,
..parser.ctx
},
"layer" => Ctx {
js_word!("layer") => Ctx {
block_contents_grammar: BlockContentsGrammar::Stylesheet,
..parser.ctx
},
"media" | "supports" | "container" | "document" | "-moz-document" => {
match parser.ctx.block_contents_grammar {
BlockContentsGrammar::StyleBlock => Ctx {
in_container_at_rule: lowercased_name == "container",
block_contents_grammar: BlockContentsGrammar::StyleBlock,
..parser.ctx
},
_ => Ctx {
in_container_at_rule: lowercased_name == "container",
block_contents_grammar: BlockContentsGrammar::Stylesheet,
..parser.ctx
},
}
}
"nest" => Ctx {
js_word!("media")
| js_word!("supports")
| js_word!("container")
| js_word!("document")
| js_word!("-moz-document") => match parser.ctx.block_contents_grammar {
BlockContentsGrammar::StyleBlock => Ctx {
in_container_at_rule: lowercased_name == js_word!("container"),
block_contents_grammar: BlockContentsGrammar::StyleBlock,
..parser.ctx
},
_ => Ctx {
in_container_at_rule: lowercased_name == js_word!("container"),
block_contents_grammar: BlockContentsGrammar::Stylesheet,
..parser.ctx
},
},
js_word!("nest") => Ctx {
block_contents_grammar: BlockContentsGrammar::StyleBlock,
..parser.ctx
},
@ -647,8 +664,11 @@ where
},
};
let block = match lowercased_name {
"keyframes" | "-moz-keyframes" | "-o-keyframes" | "-webkit-keyframes"
| "-ms-keyframes"
js_word!("keyframes")
| js_word!("-moz-keyframes")
| js_word!("-o-keyframes")
| js_word!("-webkit-keyframes")
| js_word!("-ms-keyframes")
if is!(parser, "{") =>
{
let span_block = parser.input.cur_span();

View File

@ -1032,7 +1032,7 @@ where
let ident = self.try_parse_variable_function(|parser| match cur!(parser) {
Token::Ident { value, .. } => {
if value.starts_with("--") {
if value.starts_with("--") && value.len() > 2 {
is_custom_params = true;
Ok(ComponentValue::DashedIdent(parser.parse()?))
@ -1456,9 +1456,16 @@ where
));
}
if value.len() < 3 {
return Err(Error::new(
span,
ErrorKind::Expected("dashed-ident must be at least 3 characters"),
));
}
Ok(DashedIdent {
span,
value,
value: value[2..].into(),
raw: Some(raw),
})
}

View File

@ -30,7 +30,7 @@
"end": 25,
"ctxt": 0
},
"value": "--fogra39",
"value": "fogra39",
"raw": "--fogra39"
},
"block": {

View File

@ -30,7 +30,7 @@
"end": 39,
"ctxt": 0
},
"value": "--SelectedPalette",
"value": "SelectedPalette",
"raw": "--SelectedPalette"
},
"block": {

View File

@ -6613,7 +6613,7 @@
"end": 2454,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
},
"value": [
@ -6777,7 +6777,7 @@
"end": 2504,
"ctxt": 0
},
"value": "--varName",
"value": "varName",
"raw": "--varName"
}
]

View File

@ -2341,7 +2341,7 @@
"end": 824,
"ctxt": 0
},
"value": "--custom1",
"value": "custom1",
"raw": "--custom1"
},
"value": [
@ -2460,7 +2460,7 @@
"end": 869,
"ctxt": 0
},
"value": "--custom2",
"value": "custom2",
"raw": "--custom2"
},
"value": [
@ -2855,7 +2855,7 @@
"end": 1029,
"ctxt": 0
},
"value": "--something",
"value": "something",
"raw": "--something"
},
{
@ -3636,7 +3636,7 @@
"end": 1296,
"ctxt": 0
},
"value": "--empty-var",
"value": "empty-var",
"raw": "--empty-var"
},
"value": [],
@ -3656,7 +3656,7 @@
"end": 1313,
"ctxt": 0
},
"value": "--bad-var",
"value": "bad-var",
"raw": "--bad-var"
},
"value": [],

View File

@ -95,7 +95,7 @@
"end": 25,
"ctxt": 0
},
"value": "--main-color",
"value": "main-color",
"raw": "--main-color"
},
"value": [
@ -131,7 +131,7 @@
"end": 51,
"ctxt": 0
},
"value": "--accent-color",
"value": "accent-color",
"raw": "--accent-color"
},
"value": [
@ -244,7 +244,7 @@
"end": 83,
"ctxt": 0
},
"value": "--fg-color",
"value": "fg-color",
"raw": "--fg-color"
},
"value": [
@ -431,7 +431,7 @@
"end": 131,
"ctxt": 0
},
"value": "--main-color",
"value": "main-color",
"raw": "--main-color"
}
]

View File

@ -287,7 +287,7 @@
"end": 62,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
},
"value": [
@ -2480,7 +2480,7 @@
"end": 620,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
}
]
@ -8623,7 +8623,7 @@
"end": 2287,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
}
]
@ -8790,7 +8790,7 @@
"end": 2334,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
}
]
@ -8957,7 +8957,7 @@
"end": 2376,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
}
]
@ -9124,7 +9124,7 @@
"end": 2420,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
}
]
@ -9291,7 +9291,7 @@
"end": 2467,
"ctxt": 0
},
"value": "--width",
"value": "width",
"raw": "--width"
}
]

View File

@ -94,7 +94,7 @@
"end": 16,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
},
"value": [
@ -129,7 +129,7 @@
"end": 38,
"ctxt": 0
},
"value": "--lore-ipsum",
"value": "lore-ipsum",
"raw": "--lore-ipsum"
},
"value": [
@ -164,7 +164,7 @@
"end": 55,
"ctxt": 0
},
"value": "--FANCY",
"value": "FANCY",
"raw": "--FANCY"
},
"value": [
@ -199,7 +199,7 @@
"end": 73,
"ctxt": 0
},
"value": "--test",
"value": "test",
"raw": "--test"
},
"value": [
@ -235,7 +235,7 @@
"end": 94,
"ctxt": 0
},
"value": "--percentage",
"value": "percentage",
"raw": "--percentage"
},
"value": [
@ -270,7 +270,7 @@
"end": 110,
"ctxt": 0
},
"value": "--number",
"value": "number",
"raw": "--number"
},
"value": [
@ -306,7 +306,7 @@
"end": 125,
"ctxt": 0
},
"value": "--length",
"value": "length",
"raw": "--length"
},
"value": [
@ -344,7 +344,7 @@
"end": 140,
"ctxt": 0
},
"value": "--time",
"value": "time",
"raw": "--time"
},
"value": [
@ -382,7 +382,7 @@
"end": 159,
"ctxt": 0
},
"value": "--function",
"value": "function",
"raw": "--function"
},
"value": [
@ -426,7 +426,7 @@
"end": 186,
"ctxt": 0
},
"value": "--nested-function",
"value": "nested-function",
"raw": "--nested-function"
},
"value": [
@ -493,7 +493,7 @@
"end": 214,
"ctxt": 0
},
"value": "--parentheses",
"value": "parentheses",
"raw": "--parentheses"
},
"value": [
@ -545,7 +545,7 @@
"end": 230,
"ctxt": 0
},
"value": "--braces",
"value": "braces",
"raw": "--braces"
},
"value": [
@ -597,7 +597,7 @@
"end": 248,
"ctxt": 0
},
"value": "--brackets",
"value": "brackets",
"raw": "--brackets"
},
"value": [
@ -649,7 +649,7 @@
"end": 276,
"ctxt": 0
},
"value": "--at-keyword-unknown",
"value": "at-keyword-unknown",
"raw": "--at-keyword-unknown"
},
"value": [
@ -684,7 +684,7 @@
"end": 306,
"ctxt": 0
},
"value": "--at-keyword-known",
"value": "at-keyword-known",
"raw": "--at-keyword-known"
},
"value": [
@ -719,7 +719,7 @@
"end": 343,
"ctxt": 0
},
"value": "--at-keyword-unknown-block",
"value": "at-keyword-unknown-block",
"raw": "--at-keyword-unknown-block"
},
"value": [
@ -785,7 +785,7 @@
"end": 382,
"ctxt": 0
},
"value": "--at-keyword-known-block",
"value": "at-keyword-known-block",
"raw": "--at-keyword-known-block"
},
"value": [
@ -851,7 +851,7 @@
"end": 414,
"ctxt": 0
},
"value": "--cdo-at-top-level",
"value": "cdo-at-top-level",
"raw": "--cdo-at-top-level"
},
"value": [
@ -881,7 +881,7 @@
"end": 441,
"ctxt": 0
},
"value": "--cdc-at-top-level",
"value": "cdc-at-top-level",
"raw": "--cdc-at-top-level"
},
"value": [
@ -911,7 +911,7 @@
"end": 468,
"ctxt": 0
},
"value": "--cdo-not-top-level",
"value": "cdo-not-top-level",
"raw": "--cdo-not-top-level"
},
"value": [
@ -959,7 +959,7 @@
"end": 498,
"ctxt": 0
},
"value": "--cdc-not-top-level",
"value": "cdc-not-top-level",
"raw": "--cdc-not-top-level"
},
"value": [

View File

@ -94,7 +94,7 @@
"end": 18,
"ctxt": 0
},
"value": "--fancy",
"value": "fancy",
"raw": "--fancy"
},
"value": [
@ -161,7 +161,7 @@
"end": 45,
"ctxt": 0
},
"value": "--fancy",
"value": "fancy",
"raw": "--fancy"
}
]

View File

@ -4047,7 +4047,7 @@
"end": 1323,
"ctxt": 0
},
"value": "--zero-size",
"value": "zero-size",
"raw": "--zero-size"
},
"value": [
@ -4245,7 +4245,7 @@
"end": 1387,
"ctxt": 0
},
"value": "--small-icon",
"value": "small-icon",
"raw": "--small-icon"
},
"value": [

View File

@ -1411,7 +1411,7 @@
"end": 474,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -1450,7 +1450,7 @@
"end": 488,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -1489,7 +1489,7 @@
"end": 501,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -1560,7 +1560,7 @@
"end": 529,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -1590,7 +1590,7 @@
"end": 542,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -1620,7 +1620,7 @@
"end": 554,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -1691,7 +1691,7 @@
"end": 582,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -1721,7 +1721,7 @@
"end": 595,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -1751,7 +1751,7 @@
"end": 607,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -1790,7 +1790,7 @@
"end": 622,
"ctxt": 0
},
"value": "--alpha",
"value": "alpha",
"raw": "--alpha"
}
]
@ -3527,7 +3527,7 @@
"end": 1197,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -3566,7 +3566,7 @@
"end": 1211,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -3605,7 +3605,7 @@
"end": 1224,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -3644,7 +3644,7 @@
"end": 1238,
"ctxt": 0
},
"value": "--alpha",
"value": "alpha",
"raw": "--alpha"
}
]
@ -4511,7 +4511,7 @@
"end": 1504,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -4550,7 +4550,7 @@
"end": 1514,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -4589,7 +4589,7 @@
"end": 1524,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -4660,7 +4660,7 @@
"end": 1550,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -4699,7 +4699,7 @@
"end": 1560,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -4738,7 +4738,7 @@
"end": 1570,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -4777,7 +4777,7 @@
"end": 1580,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -4848,7 +4848,7 @@
"end": 1606,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -4878,7 +4878,7 @@
"end": 1615,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -4908,7 +4908,7 @@
"end": 1624,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -4979,7 +4979,7 @@
"end": 1650,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -5009,7 +5009,7 @@
"end": 1659,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -5039,7 +5039,7 @@
"end": 1668,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -5078,7 +5078,7 @@
"end": 1679,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -5456,7 +5456,7 @@
"end": 1790,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -5495,7 +5495,7 @@
"end": 1800,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -5534,7 +5534,7 @@
"end": 1810,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -5573,7 +5573,7 @@
"end": 1820,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -6183,7 +6183,7 @@
"end": 2001,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -6213,7 +6213,7 @@
"end": 2010,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -6243,7 +6243,7 @@
"end": 2019,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -6314,7 +6314,7 @@
"end": 2045,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -6344,7 +6344,7 @@
"end": 2054,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -6374,7 +6374,7 @@
"end": 2063,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -6413,7 +6413,7 @@
"end": 2074,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -6852,7 +6852,7 @@
"end": 2249,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -6882,7 +6882,7 @@
"end": 2258,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -6912,7 +6912,7 @@
"end": 2267,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -6983,7 +6983,7 @@
"end": 2293,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -7013,7 +7013,7 @@
"end": 2302,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -7043,7 +7043,7 @@
"end": 2311,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -7082,7 +7082,7 @@
"end": 2322,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -7813,7 +7813,7 @@
"end": 2588,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -7843,7 +7843,7 @@
"end": 2597,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -7873,7 +7873,7 @@
"end": 2606,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -7944,7 +7944,7 @@
"end": 2632,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -7974,7 +7974,7 @@
"end": 2641,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -8004,7 +8004,7 @@
"end": 2650,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -8043,7 +8043,7 @@
"end": 2661,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -8270,7 +8270,7 @@
"end": 2742,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -8300,7 +8300,7 @@
"end": 2751,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -8330,7 +8330,7 @@
"end": 2760,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -8655,7 +8655,7 @@
"end": 2878,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -8685,7 +8685,7 @@
"end": 2887,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -8715,7 +8715,7 @@
"end": 2896,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -8786,7 +8786,7 @@
"end": 2924,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -8816,7 +8816,7 @@
"end": 2933,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -8846,7 +8846,7 @@
"end": 2942,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -8885,7 +8885,7 @@
"end": 2953,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -10791,7 +10791,7 @@
"end": 3939,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -10821,7 +10821,7 @@
"end": 3948,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -10851,7 +10851,7 @@
"end": 3957,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -10881,7 +10881,7 @@
"end": 3966,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -10952,7 +10952,7 @@
"end": 3994,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -10982,7 +10982,7 @@
"end": 4003,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -11012,7 +11012,7 @@
"end": 4012,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -11042,7 +11042,7 @@
"end": 4021,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -11081,7 +11081,7 @@
"end": 4032,
"ctxt": 0
},
"value": "--e",
"value": "e",
"raw": "--e"
}
]
@ -11118,7 +11118,7 @@
"end": 4067,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
"block": {
@ -11308,7 +11308,7 @@
"end": 4203,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
{
@ -11429,7 +11429,7 @@
"end": 4310,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
{
@ -11550,7 +11550,7 @@
"end": 4417,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
{
@ -11671,7 +11671,7 @@
"end": 4524,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
{
@ -11792,7 +11792,7 @@
"end": 4631,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
{
@ -11913,7 +11913,7 @@
"end": 4738,
"ctxt": 0
},
"value": "--fogra55beta",
"value": "fogra55beta",
"raw": "--fogra55beta"
},
{
@ -12541,7 +12541,7 @@
"end": 5006,
"ctxt": 0
},
"value": "--a",
"value": "a",
"raw": "--a"
}
]
@ -12571,7 +12571,7 @@
"end": 5015,
"ctxt": 0
},
"value": "--b",
"value": "b",
"raw": "--b"
}
]
@ -12601,7 +12601,7 @@
"end": 5024,
"ctxt": 0
},
"value": "--c",
"value": "c",
"raw": "--c"
}
]
@ -12631,7 +12631,7 @@
"end": 5033,
"ctxt": 0
},
"value": "--d",
"value": "d",
"raw": "--d"
}
]
@ -16851,7 +16851,7 @@
"end": 6400,
"ctxt": 0
},
"value": "--mygray",
"value": "mygray",
"raw": "--mygray"
}
]
@ -17583,7 +17583,7 @@
"end": 6738,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -17613,7 +17613,7 @@
"end": 6751,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -17643,7 +17643,7 @@
"end": 6763,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -17714,7 +17714,7 @@
"end": 6791,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -17744,7 +17744,7 @@
"end": 6804,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -17774,7 +17774,7 @@
"end": 6816,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -17813,7 +17813,7 @@
"end": 6831,
"ctxt": 0
},
"value": "--alpha",
"value": "alpha",
"raw": "--alpha"
}
]
@ -17884,7 +17884,7 @@
"end": 6860,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -17914,7 +17914,7 @@
"end": 6873,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -17944,7 +17944,7 @@
"end": 6885,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -18015,7 +18015,7 @@
"end": 6913,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -18045,7 +18045,7 @@
"end": 6926,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -18075,7 +18075,7 @@
"end": 6938,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -18114,7 +18114,7 @@
"end": 6953,
"ctxt": 0
},
"value": "--alpha",
"value": "alpha",
"raw": "--alpha"
}
]
@ -18185,7 +18185,7 @@
"end": 6987,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -18215,7 +18215,7 @@
"end": 7005,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -18245,7 +18245,7 @@
"end": 7022,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -18316,7 +18316,7 @@
"end": 7055,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -18346,7 +18346,7 @@
"end": 7073,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]
@ -18376,7 +18376,7 @@
"end": 7090,
"ctxt": 0
},
"value": "--blue",
"value": "blue",
"raw": "--blue"
}
]
@ -18415,7 +18415,7 @@
"end": 7110,
"ctxt": 0
},
"value": "--alpha",
"value": "alpha",
"raw": "--alpha"
}
]

View File

@ -1,5 +1,5 @@
:root {
--:value;
---:value;
--important:value!important;
--important1: value!important;

View File

@ -2,7 +2,7 @@
x Stylesheet
,-[$DIR/tests/fixture/value/custom-property/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
2 | | ---:value;
3 | |
4 | | --important:value!important;
5 | | --important1: value!important;
@ -73,7 +73,7 @@
x Rule
,-[$DIR/tests/fixture/value/custom-property/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
2 | | ---:value;
3 | |
4 | | --important:value!important;
5 | | --important1: value!important;
@ -134,7 +134,7 @@
x QualifiedRule
,-[$DIR/tests/fixture/value/custom-property/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
2 | | ---:value;
3 | |
4 | | --important:value!important;
5 | | --important1: value!important;
@ -231,7 +231,7 @@
x SimpleBlock
,-[$DIR/tests/fixture/value/custom-property/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
2 | | ---:value;
3 | |
4 | | --important:value!important;
5 | | --important1: value!important;
@ -297,44 +297,44 @@
x ComponentValue
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^^^^^^^
2 | ---:value;
: ^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^^^^^^^
2 | ---:value;
: ^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^^^^^^^
2 | ---:value;
: ^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^
2 | ---:value;
: ^^^
`----
x DashedIdent
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^
2 | ---:value;
: ^^^
`----
x ComponentValue
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^^^^
2 | ---:value;
: ^^^^^
`----
x Ident { value: Atom('value' type=inline), raw: Atom('value' type=inline) }
,-[$DIR/tests/fixture/value/custom-property/input.css:2:5]
2 | --:value;
: ^^^^^
2 | ---:value;
: ^^^^^
`----
x ComponentValue

View File

@ -790,7 +790,7 @@
"end": 720,
"ctxt": 0
},
"value": "--color",
"value": "color",
"raw": "--color"
},
{
@ -818,7 +818,7 @@
"end": 740,
"ctxt": 0
},
"value": "--primary-color",
"value": "primary-color",
"raw": "--primary-color"
}
]
@ -996,7 +996,7 @@
"end": 829,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
},
"value": [
@ -1179,7 +1179,7 @@
"end": 1017,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
}
]

View File

@ -870,7 +870,7 @@
"end": 334,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -941,7 +941,7 @@
"end": 362,
"ctxt": 0
},
"value": "--red",
"value": "red",
"raw": "--red"
}
]
@ -971,7 +971,7 @@
"end": 375,
"ctxt": 0
},
"value": "--green",
"value": "green",
"raw": "--green"
}
]

View File

@ -620,7 +620,7 @@
"end": 142,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
},
"value": [
@ -732,7 +732,7 @@
"end": 172,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
},
"value": [

View File

@ -0,0 +1,7 @@
:root {
--:value;
}
.a {
counter-reset: -- --a -a;
}

View File

@ -0,0 +1,276 @@
{
"type": "Stylesheet",
"span": {
"start": 1,
"end": 63,
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
"span": {
"start": 1,
"end": 24,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "PseudoClassSelector",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 2,
"end": 6,
"ctxt": 0
},
"value": "root",
"raw": "root"
},
"children": null
}
]
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 7,
"end": 24,
"ctxt": 0
},
"name": {
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LBrace"
},
"value": [
{
"type": "ListOfComponentValues",
"span": {
"start": 13,
"end": 22,
"ctxt": 0
},
"children": [
{
"type": "PreservedToken",
"span": {
"start": 13,
"end": 15,
"ctxt": 0
},
"token": {
"Ident": {
"value": "--",
"raw": "--"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 16,
"end": 21,
"ctxt": 0
},
"token": {
"Ident": {
"value": "value",
"raw": "value"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"token": "Semi"
}
]
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 26,
"end": 62,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 26,
"end": 28,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 26,
"end": 28,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 26,
"end": 28,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "ClassSelector",
"span": {
"start": 26,
"end": 28,
"ctxt": 0
},
"text": {
"type": "Ident",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
]
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 29,
"end": 62,
"ctxt": 0
},
"name": {
"type": "PreservedToken",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"token": "LBrace"
},
"value": [
{
"type": "Declaration",
"span": {
"start": 35,
"end": 59,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 35,
"end": 48,
"ctxt": 0
},
"value": "counter-reset",
"raw": "counter-reset"
},
"value": [
{
"type": "PreservedToken",
"span": {
"start": 50,
"end": 52,
"ctxt": 0
},
"token": {
"Ident": {
"value": "--",
"raw": "--"
}
}
},
{
"type": "DashedIdent",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"value": "a",
"raw": "--a"
},
{
"type": "Ident",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"value": "-a",
"raw": "-a"
}
],
"important": null
}
]
}
}
]
}

View File

@ -0,0 +1,12 @@
x Expected dashed-ident must be at least 3 characters
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^
`----
x Expected dashed-ident must be at least 3 characters
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^
`----

View File

@ -0,0 +1,263 @@
x Stylesheet
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
3 | | }
4 | |
5 | | .a {
6 | | counter-reset: -- --a -a;
7 | `-> }
`----
x Rule
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
3 | `-> }
`----
x QualifiedRule
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
3 | `-> }
`----
x SelectorList
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^^^^^
`----
x ComplexSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^^^^^
`----
x CompoundSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^^^^^
`----
x SubclassSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^^^^^
`----
x PseudoClassSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^^^^^
`----
x Ident
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^^^^
`----
x SimpleBlock
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | ,-> :root {
2 | | --:value;
3 | `-> }
`----
x LBrace
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:1:1]
1 | :root {
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^
`----
x Ident { value: Atom('--' type=inline), raw: Atom('--' type=inline) }
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^
`----
x Colon
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^^^^
`----
x Ident { value: Atom('value' type=inline), raw: Atom('value' type=inline) }
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^
`----
x Semi
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:2:5]
2 | --:value;
: ^
`----
x Rule
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | ,-> .a {
6 | | counter-reset: -- --a -a;
7 | `-> }
`----
x QualifiedRule
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | ,-> .a {
6 | | counter-reset: -- --a -a;
7 | `-> }
`----
x SelectorList
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^^
`----
x ComplexSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^^
`----
x CompoundSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^^
`----
x SubclassSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^^
`----
x ClassSelector
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^^
`----
x Ident
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^
`----
x SimpleBlock
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | ,-> .a {
6 | | counter-reset: -- --a -a;
7 | `-> }
`----
x LBrace
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:5:1]
5 | .a {
: ^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x StyleBlock
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x Declaration
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^^^^^^^^^^^^^^^^^^^^^^
`----
x DeclarationName
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^^^^^^^^^^^
`----
x Ident
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^^^^^^^^^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^
`----
x Ident { value: Atom('--' type=inline), raw: Atom('--' type=inline) }
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^
`----
x DashedIdent
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^^
`----
x ComponentValue
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^
`----
x Ident
,-[$DIR/tests/recovery/value/custom-properties/only-dashed/input.css:6:5]
6 | counter-reset: -- --a -a;
: ^^
`----

View File

@ -101,7 +101,7 @@
"end": 16,
"ctxt": 0
},
"value": "--foo",
"value": "foo",
"raw": "--foo"
},
"value": [