fix(css/parser): Fix parsing of component values (#3611)

This commit is contained in:
Alexander Akait 2022-02-17 17:20:17 +03:00 committed by GitHub
parent 36a1ea8e46
commit b7dcccc748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 9228 additions and 1106 deletions

View File

@ -0,0 +1,7 @@
@supports ( --x : y , z ) { a { color: red; } }
@supports ( --x : ) { a { color: red; } }
@supports (--x: ) { a { color: red; } }
@supports ( --x y , z ) { a { color: red; } }
@supports ( --x ) { a { color: red; } }
@supports ( ) { a { color: red; } }
@supports ( . --x : y , z ) { a { color: red; } }

View File

@ -0,0 +1,19 @@
@supports (--x: y , z ) {
a {
color: red;
}
}
@supports (--x: ) {
a {
color: red;
}
}
@supports (--x: ) {
a {
color: red;
}
}
@supports ( --x y , z ) { a { color: red; } }
@supports ( --x ) { a { color: red; } }
@supports ( ) { a { color: red; } }
@supports ( . --x : y , z ) { a { color: red; } }

View File

@ -0,0 +1 @@
@supports(--x:y , z ){a{color:red}}@supports(--x: ){a{color:red}}@supports(--x: ){a{color:red}}@supports ( --x y , z ) { a { color: red; } }@supports ( --x ) { a { color: red; } }@supports ( ) { a { color: red; } }@supports ( . --x : y , z ) { a { color: red; } }

View File

@ -6,3 +6,15 @@
@unknown url( image.png"" img ) {}
@unknown url( image.png\ img ) {}
@unknown url( image.png\) ) {}
@unknown;
@unknown x;
@unknown x{}
@unknown x {}
@unknown{}
@unknown{a: b; c: d;}
@unknown x ( a + b ) ;
@unknown x ( a - b ) ;
@unknown x ( a , b ) ;
@unknown x( a , b ) ;

View File

@ -6,3 +6,13 @@
@unknown url( image.png"" img ) {}
@unknown url( image.png\ img ) {}
@unknown url( image.png\) ) {}
@unknown;
@unknown x;
@unknown x{}
@unknown x {}
@unknown{}
@unknown{a: b; c: d;}
@unknown x ( a + b ) ;
@unknown x ( a - b ) ;
@unknown x ( a , b ) ;
@unknown x(a, b) ;

View File

@ -1 +1 @@
@unknown {}@unknown url(image.png) {}@unknown url( image.png ) {}@unknown url("image.png") {}@unknown url( image.png img ) {}@unknown url( image.png"" img ) {}@unknown url( image.png\ img ) {}@unknown url( image.png\) ) {}
@unknown {}@unknown url(image.png) {}@unknown url( image.png ) {}@unknown url("image.png") {}@unknown url( image.png img ) {}@unknown url( image.png"" img ) {}@unknown url( image.png\ img ) {}@unknown url( image.png\) ) {}@unknown;@unknown x;@unknown x{}@unknown x {}@unknown{}@unknown{a: b; c: d;}@unknown x ( a + b ) ;@unknown x ( a - b ) ;@unknown x ( a , b ) ;@unknown x(a,b) ;

View File

@ -11,3 +11,21 @@ div {
color: red ! IMPORTANT;
color: red ! iMpOrTaNt;
}
a { b: c!important }
.class {
& div {
color: red !important
}
}
.class {
& div {
color: red !important;
}
}
.foo {
color: red !ie;
}

View File

@ -10,3 +10,18 @@ color: red !important;
color: red !IMPORTANT;
color: red !iMpOrTaNt;
}
a {
b: c !important;
}
.class {
& div {
color: red !important;
}
}
.class {
& div {
color: red !important;
}
}
.foo {
color: red !ie}

View File

@ -1 +1 @@
:root{--foo:red !important;--foo:red!important}div{color:red!important;color:red!important;color:red!important;color:red!important;color:red!important;color:red!important}
:root{--foo:red !important;--foo:red!important}div{color:red!important;color:red!important;color:red!important;color:red!important;color:red!important;color:red!important}a{b:c!important}.class{& div{color:red!important}}.class{& div{color:red!important}}.foo{color: red !ie}

View File

@ -0,0 +1,11 @@
/** { unknown: x (a+b) }*/
/** { unknown: x (a-b) }*/
/** { unknown: x (a,b) }*/
/** { unknown: x ( a + b ) }*/
/** { unknown: x ( a - b ) }*/
/** { unknown: x ( a , b ) }*/
a { b: c, d }
a { b: c, (d, e) }
a { b: c, d, e }
a { b: c, (d, e), f }

View File

@ -0,0 +1,12 @@
a {
b: c, d;
}
a {
b: c, (d,e);
}
a {
b: c, d, e;
}
a {
b: c, (d,e), f;
}

View File

@ -0,0 +1 @@
a{b:c,d}a{b:c,(d,e)}a{b:c,d,e}a{b:c,(d,e),f}

View File

@ -0,0 +1,35 @@
*{--x:}
*{--x: }
* { --x:; }
* { --x: ; }
* { --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}; }

View File

@ -0,0 +1,87 @@
* {
--x: ;
}
* {
--x: ;
}
* {
--x: ;
}
* {
--x: ;
}
* {
--x: y;
}
* {
--x: y;
}
* {
--x: y ;
}
* {
--x: 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};
}

View File

@ -0,0 +1 @@
*{--x: }*{--x: }*{--x: }*{--x: }*{--x:y}*{--x:y}*{--x:y }*{--x: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}}

View File

@ -28,3 +28,6 @@ a[ class = "test" ] {}
[ href *= "insensitive" i ] {}
[ href ] {}
[frame=hsides i] {}
[🐈] {}
[🐈=🐈] {}
[🐈|🐈=🐈] {}

View File

@ -28,3 +28,6 @@ a[class="test"] {}
[href*="insensitive" i] {}
[href] {}
[frame=hsides i] {}
[🐈] {}
[🐈=🐈] {}
[🐈|🐈=🐈] {}

View File

@ -1 +1 @@
[title]{}[title=foo]{}[title="foo"]{}[title="foo"]{}[title="foo"]{}[lang~="en-us"]{}[lang|="zh"]{}[href^="#"]{}[href$=".org"]{}[href*="example"]{}[href*="insensitive"i]{}[href*="insensitive"I]{}[href*="cAsE"s]{}[href*="cAsE"S]{}[foo|att=val]{}[*|att]{}[*|att]{}[|att]{}[|att]{}[|att]{}[att]{}[att]{}[att]{}a[class="test"]{}a[class="test"]{}[href*="insensitive"i]{}[href*="insensitive"i]{}[href*="insensitive"i]{}[href]{}[frame=hsides i]{}
[title]{}[title=foo]{}[title="foo"]{}[title="foo"]{}[title="foo"]{}[lang~="en-us"]{}[lang|="zh"]{}[href^="#"]{}[href$=".org"]{}[href*="example"]{}[href*="insensitive"i]{}[href*="insensitive"I]{}[href*="cAsE"s]{}[href*="cAsE"S]{}[foo|att=val]{}[*|att]{}[*|att]{}[|att]{}[|att]{}[|att]{}[att]{}[att]{}[att]{}a[class="test"]{}a[class="test"]{}[href*="insensitive"i]{}[href*="insensitive"i]{}[href*="insensitive"i]{}[href]{}[frame=hsides i]{}[🐈]{}[🐈=🐈]{}[🐈|🐈=🐈]{}

View File

@ -0,0 +1,4 @@
.\10FFF abc:after { content: '\\10FFF abc' }
.\10FFFFabc:after { content: '\\10FFFFabc' }
.\10FFFF abc:after { content: '\\10FFFF abc' }
.\FEFF:after { content: '\uFEFF' }

View File

@ -0,0 +1,12 @@
.\10FFF abc:after {
content: '\\10FFF abc';
}
.\10FFFFabc:after {
content: '\\10FFFFabc';
}
.\10FFFF abc:after {
content: '\\10FFFF abc';
}
.\FEFF:after {
content: '\uFEFF';
}

View File

@ -0,0 +1 @@
.\10FFF abc:after{content:"\\10FFF abc"}.\10FFFFabc:after{content:"\\10FFFFabc"}.\10FFFF abc:after{content:"\\10FFFF abc"}.\FEFF:after{content:"uFEFF"}

View File

@ -0,0 +1 @@
a + b c > d ~ e {}

View File

@ -0,0 +1 @@
a+b c>d~e {}

View File

@ -0,0 +1 @@
a+b c>d~e{}

View File

@ -0,0 +1,3 @@
a { &b {} }
a { & b {} }
a { & :b {} }

View File

@ -0,0 +1,9 @@
a {
&b {}
}
a {
& b {}
}
a {
& :b {}
}

View File

@ -0,0 +1 @@
a{&b{}}a{& b{}}a{& :b{}}

View File

@ -0,0 +1,6 @@
:unknown( x (a+b), 'c' ) {}
:unknown( x (a-b), 'c' ) {}
:unknown( x (a,b), 'c' ) {}
:unknown( x ( a + b ), 'c' ) {}
:unknown( x ( a - b ), 'c' ) {}
:unknown( x ( a , b ), 'c' ) {}

View File

@ -0,0 +1,6 @@
:unknown( x (a+b), 'c' ) {}
:unknown( x (a-b), 'c' ) {}
:unknown( x (a,b), 'c' ) {}
:unknown( x ( a + b ), 'c' ) {}
:unknown( x ( a - b ), 'c' ) {}
:unknown( x ( a , b ), 'c' ) {}

View File

@ -0,0 +1 @@
:unknown( x (a+b), 'c' ){}:unknown( x (a-b), 'c' ){}:unknown( x (a,b), 'c' ){}:unknown( x ( a + b ), 'c' ){}:unknown( x ( a - b ), 'c' ){}:unknown( x ( a , b ), 'c' ){}

View File

@ -41,3 +41,13 @@ https://example.com/image.png
div {
background: url(foo.img) red;
}
* {
background: url('foo');
background: url('f o');
background: url('f o');
background: url('foo)');
background: url('(foo');
background: url('(foo)');
background: url('\"foo\"');
}

View File

@ -35,3 +35,12 @@ background: url(image.png\D799);
div {
background: url(foo.img) red;
}
* {
background: url('foo');
background: url('f o');
background: url('f o');
background: url('foo)');
background: url('(foo');
background: url('(foo)');
background: url('\"foo\"');
}

View File

@ -1 +1 @@
div{background:url(https://example.com/image.png);background:URL(https://example.com/image.png);background:\URL(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:URL("https://example.com/image.png");background:\URL("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:SRC("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:u\rl(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}
div{background:url(https://example.com/image.png);background:URL(https://example.com/image.png);background:\URL(https://example.com/image.png);background:url("https://example.com/image.png");background:url("https://example.com/image.png");background:URL("https://example.com/image.png");background:\URL("https://example.com/image.png");background:url(data:image/png;base64,iRxVB0);background:url(#IDofSVGpath);background:url("//aa.com/img.svg"prefetch);background:url("//aa.com/img.svg"foo bar baz func(test));background:url("http://example.com/image.svg"param(--color var(--primary-color)));background:url();background:url("");background:url("");--foo:"http://www.example.com/pinkish.gif";background:src("http://www.example.com/pinkish.gif");background:SRC("http://www.example.com/pinkish.gif");background:src(var(--foo));background:url(https://example.com/image.png);background:u\rl(https://example.com/image.png);background:url(https://example.com/image.png);background:url(https://example.com/image.png);background:url(image.png힙)}div{background:url(foo.img)red}*{background:url("foo");background:url("f o");background:url("f o");background:url("foo)");background:url("(foo");background:url("(foo)");background:url('"foo"')}

View File

@ -277,11 +277,11 @@ where
return Ok(simple_block);
}
_ => {
let token = self.input.bump()?.unwrap();
let component_value = self.parse_component_value()?;
simple_block
.value
.push(ComponentValue::Value(Value::PreservedToken(token)));
.push(ComponentValue::Value(component_value));
}
}
}
@ -289,9 +289,21 @@ where
pub fn parse_component_value(&mut self) -> PResult<Value> {
match cur!(self) {
tok!("[") => Ok(Value::SimpleBlock(self.parse_simple_block(']')?)),
tok!("(") => Ok(Value::SimpleBlock(self.parse_simple_block(')')?)),
tok!("{") => Ok(Value::SimpleBlock(self.parse_simple_block('}')?)),
tok!("[") => {
self.input.bump()?;
Ok(Value::SimpleBlock(self.parse_simple_block(']')?))
}
tok!("(") => {
self.input.bump()?;
Ok(Value::SimpleBlock(self.parse_simple_block(')')?))
}
tok!("{") => {
self.input.bump()?;
Ok(Value::SimpleBlock(self.parse_simple_block('}')?))
}
tok!("function") => Ok(Value::Function(self.parse()?)),
_ => {
let token = self.input.bump()?;

View File

@ -1,9 +1,3 @@
error: Invalid selector
--> $DIR/tests/errors/rome/invalid/page/space/input.css:3:14
|
3 | margin-left: 4cm;
| ^
error: Expected 'left', 'right', 'first' or 'blank' ident
--> $DIR/tests/errors/rome/invalid/page/space/input.css:1:11
|

View File

@ -12,8 +12,8 @@
@unknown a b {}
@unknown {p:v}
@unknown x y {p:v}
/*@unknown x, y x(1) {p:v}*/
/*@unknown x, y x(1+2) {p:v}*/
@unknown x, y x(1) {p:v}
@unknown x, y x(1+2) {p:v}
@unknown/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}
/*@unknown!*test*!x!*test*! y!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/
/*@unknown!*test*!x!*test*!,!*test*!y!*test*! x(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}*/
@ -23,16 +23,16 @@
@unknown {s{p:v}}
@unknown x y {s{p:v}}
/*@unknown x, y f(1) {s{p:v}}*/
/*@unknown x, y f(1+2) {s{p:v}}*/
@unknown x, y f(1) {s{p:v}}
@unknown x, y f(1+2) {s{p:v}}
@unknown { .a { p: v; } .b { p: v } }
@unknown/*test*/{/*test*/s/*test*/{/*test*/p/*test*/:/*test*/v/*test*/}/*test*/}
/*@unknown!*test*!x!*test*! y!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/
/*@unknown!*test*!x!*test*!,!*test*!y!*test*! f(!*test*!1!*test*!+!*test*!2!*test*!)!*test*!{!*test*!s!*test*!{!*test*!p!*test*!:!*test*!v!*test*!}!*test*!}*/
@unknown { s { p : v } }
@unknown x y { s { p : v } }
/*@unknown x , y f( 1 ) { s { p : v } }*/
/*@unknown x , y f( 1 2 ) { s { p : v } }*/
@unknown x , y f( 1 ) { s { p : v } }
@unknown x , y f( 1 2 ) { s { p : v } }
@unknown {
--> {}
@ -54,3 +54,11 @@
color: red;
}
@unknown x ( a , b ) ;
@unknown x ( a , b ) { foo: bar }
@unknown x( a, b ) { foo: bar }
/*@unknown x ( a + b ) ;*/
/*@unknown x ( a - b ) ;*/
/*@unknown x ( a * b ) ;*/
/*@unknown x ( a / b ) ;*/

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"type": "Stylesheet",
"span": {
"start": 0,
"end": 27,
"end": 29,
"ctxt": 0
},
"rules": [
@ -10,7 +10,7 @@
"type": "UnknownAtRule",
"span": {
"start": 0,
"end": 26,
"end": 28,
"ctxt": 0
},
"name": {
@ -69,7 +69,7 @@
"type": "SimpleBlock",
"span": {
"start": 15,
"end": 26,
"end": 28,
"ctxt": 0
},
"name": "{",
@ -116,24 +116,39 @@
}
},
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 21,
"end": 22,
"end": 26,
"ctxt": 0
},
"token": "LBrace"
"name": "{",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n\n\t"
}
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 22,
"end": 25,
"start": 26,
"end": 27,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n\n\t"
"value": "\n"
}
}
}

View File

@ -2,7 +2,7 @@
"type": "Stylesheet",
"span": {
"start": 0,
"end": 77,
"end": 79,
"ctxt": 0
},
"rules": [
@ -10,7 +10,7 @@
"type": "UnknownAtRule",
"span": {
"start": 0,
"end": 76,
"end": 78,
"ctxt": 0
},
"name": {
@ -154,7 +154,7 @@
"type": "SimpleBlock",
"span": {
"start": 40,
"end": 76,
"end": 78,
"ctxt": 0
},
"name": "{",
@ -213,96 +213,111 @@
}
},
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 49,
"end": 50,
"end": 76,
"ctxt": 0
},
"token": "LBrace"
"name": "{",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 50,
"end": 59,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 59,
"end": 64,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"token": {
"Ident": {
"value": "red",
"raw": "red"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 70,
"end": 75,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 50,
"end": 59,
"start": 76,
"end": 77,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 59,
"end": 64,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"token": {
"Ident": {
"value": "red",
"raw": "red"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 70,
"end": 75,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
"value": "\n"
}
}
}

View File

@ -2,7 +2,7 @@
"type": "Stylesheet",
"span": {
"start": 0,
"end": 168,
"end": 169,
"ctxt": 0
},
"rules": [
@ -10,7 +10,7 @@
"type": "UnknownAtRule",
"span": {
"start": 0,
"end": 68,
"end": 169,
"ctxt": 0
},
"name": {
@ -69,7 +69,7 @@
"type": "SimpleBlock",
"span": {
"start": 19,
"end": 68,
"end": 169,
"ctxt": 0
},
"name": "{",
@ -151,19 +151,192 @@
}
},
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 32,
"end": 33,
"end": 68,
"ctxt": 0
},
"token": "LBrace"
"name": "{",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 34,
"end": 39,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 41,
"end": 47,
"ctxt": 0
},
"token": {
"Ident": {
"value": "maroon",
"raw": "maroon"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 49,
"end": 59,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 61,
"end": 66,
"ctxt": 0
},
"token": {
"Ident": {
"value": "white",
"raw": "white"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"token": "Semi"
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 33,
"end": 34,
"start": 68,
"end": 74,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 74,
"end": 80,
"ctxt": 0
},
"token": {
"AtKeyword": {
"value": "media",
"raw": "media"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"token": {
@ -173,396 +346,358 @@
}
},
{
"type": "PreservedToken",
"span": {
"start": 34,
"end": 39,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 41,
"end": 47,
"ctxt": 0
},
"token": {
"Ident": {
"value": "maroon",
"raw": "maroon"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 49,
"end": 59,
"ctxt": 0
},
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 61,
"end": 66,
"ctxt": 0
},
"token": {
"Ident": {
"value": "white",
"raw": "white"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"token": "Semi"
}
]
}
},
{
"type": "MediaRule",
"span": {
"start": 74,
"end": 167,
"ctxt": 0
},
"media": {
"type": "MediaQueryList",
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"queries": [
{
"type": "MediaQuery",
"type": "SimpleBlock",
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"modifier": null,
"mediaType": null,
"condition": {
"type": "MediaCondition",
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"conditions": [
{
"type": "MediaFeaturePlain",
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 82,
"end": 102,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 82,
"end": 102,
"ctxt": 0
},
"token": {
"Ident": {
"value": "prefers-color-scheme",
"raw": "prefers-color-scheme"
},
"value": {
"type": "Ident",
"span": {
"start": 104,
"end": 108,
"ctxt": 0
},
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 104,
"end": 108,
"ctxt": 0
},
"token": {
"Ident": {
"value": "dark",
"raw": "dark"
}
}
]
}
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 110,
"end": 167,
"ctxt": 0
},
"name": "{",
"value": [
}
]
},
{
"type": "QualifiedRule",
"type": "PreservedToken",
"span": {
"start": 120,
"end": 161,
"start": 109,
"end": 110,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 120,
"end": 126,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"value": "h1",
"raw": "h1"
}
}
},
"subclassSelectors": []
}
]
},
{
"type": "ComplexSelector",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"value": "h2",
"raw": "h2"
}
}
},
"subclassSelectors": []
}
]
}
]
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "SimpleBlock",
"span": {
"start": 110,
"end": 167,
"ctxt": 0
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 127,
"end": 161,
"ctxt": 0
"name": "{",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 111,
"end": 120,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 129,
"end": 139,
"ctxt": 0
{
"type": "PreservedToken",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"token": {
"Ident": {
"value": "h1",
"raw": "h1"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"token": "Comma"
},
{
"type": "PreservedToken",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"token": {
"Ident": {
"value": "h2",
"raw": "h2"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "SimpleBlock",
"span": {
"start": 127,
"end": 161,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
"name": {
"type": "Ident",
{
"type": "PreservedToken",
"span": {
"start": 129,
"end": 134,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "red",
"raw": "red"
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 141,
"end": 158,
"ctxt": 0
},
"name": {
"type": "Ident",
{
"type": "PreservedToken",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"token": {
"Ident": {
"value": "red",
"raw": "red"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 141,
"end": 151,
"ctxt": 0
},
"value": "background",
"raw": "background"
},
"value": [
{
"type": "Ident",
"span": {
"start": 153,
"end": 158,
"ctxt": 0
},
"value": "black",
"raw": "black"
"token": {
"Ident": {
"value": "background",
"raw": "background"
}
}
],
"important": null
},
{
"type": "PreservedToken",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 152,
"end": 153,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 153,
"end": 158,
"ctxt": 0
},
"token": {
"Ident": {
"value": "black",
"raw": "black"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 161,
"end": 166,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
]
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n"
}
}
}
]

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 21,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -150,21 +141,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 25,
"start": 26,
"end": 39,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -260,21 +242,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 47,
"start": 48,
"end": 58,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -94,21 +94,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 17,
"start": 18,
"end": 36,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -207,21 +198,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 39,
"start": 40,
"end": 59,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 21,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -150,21 +141,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 29,
"start": 30,
"end": 43,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 19,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 17,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 26,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 24,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 32,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 34,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 31,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 32,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 32,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 23,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 25,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 6,
"start": 7,
"end": 26,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {

View File

@ -2,7 +2,7 @@
"type": "Stylesheet",
"span": {
"start": 0,
"end": 72,
"end": 74,
"ctxt": 0
},
"rules": [
@ -10,7 +10,7 @@
"type": "UnknownAtRule",
"span": {
"start": 0,
"end": 71,
"end": 73,
"ctxt": 0
},
"name": {
@ -69,7 +69,7 @@
"type": "SimpleBlock",
"span": {
"start": 13,
"end": 71,
"end": 73,
"ctxt": 0
},
"name": "{",
@ -187,96 +187,111 @@
}
},
{
"type": "PreservedToken",
"type": "SimpleBlock",
"span": {
"start": 41,
"end": 42,
"end": 71,
"ctxt": 0
},
"token": "LBrace"
"name": "{",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 42,
"end": 51,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 51,
"end": 56,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"token": {
"Ident": {
"value": "orange",
"raw": "orange"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 42,
"end": 51,
"start": 71,
"end": 72,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 51,
"end": 56,
"ctxt": 0
},
"token": {
"Ident": {
"value": "color",
"raw": "color"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"token": "Colon"
},
{
"type": "PreservedToken",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"token": {
"Ident": {
"value": "orange",
"raw": "orange"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"token": "Semi"
},
{
"type": "PreservedToken",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": "\n "
"value": "\n"
}
}
}

View File

@ -40,21 +40,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 9,
"start": 10,
"end": 38,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -150,21 +141,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 41,
"start": 42,
"end": 63,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -260,21 +242,12 @@
{
"type": "SimpleBlock",
"span": {
"start": 67,
"end": 93,
"start": 68,
"end": 94,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "PreservedToken",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"token": "LParen"
},
{
"type": "PreservedToken",
"span": {
@ -312,47 +285,55 @@
}
},
{
"type": "PreservedToken",
"type": "Function",
"span": {
"start": 80,
"end": 87,
"end": 93,
"ctxt": 0
},
"token": {
"Function": {
"value": "rotate",
"raw": "rotate"
}
}
},
{
"type": "PreservedToken",
"span": {
"start": 87,
"end": 92,
"ctxt": 0
"name": {
"type": "Ident",
"span": {
"start": 80,
"end": 86,
"ctxt": 0
},
"value": "rotate",
"raw": "rotate"
},
"token": {
"Dimension": {
"value": 10.0,
"raw_value": "10",
"unit": "deg",
"raw_unit": "deg",
"type": "integer"
"value": [
{
"type": "Angle",
"span": {
"start": 87,
"end": 92,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 87,
"end": 89,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
},
"unit": {
"type": "Ident",
"span": {
"start": 89,
"end": 92,
"ctxt": 0
},
"value": "deg",
"raw": "deg"
}
}
}
]
}
]
},
{
"type": "PreservedToken",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"token": "RParen"
},
{
"type": "PreservedToken",
"span": {