swc/crates/swc_css_parser/tests/recovery/declaration/output.json
Alexander Akait 30c29a30cf
feat(css): Improve codegen where minify: true (#3414)
swc_css_codegen:
 - Improve minification.

swc_css_parser:
 - Add parsing rule for `sum`.
2022-02-01 12:30:44 +00:00

296 lines
6.8 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 81,
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
"span": {
"start": 0,
"end": 38,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "ClassSelector",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"text": {
"type": "Identifier",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"value": "class",
"raw": "class"
}
}
]
}
]
}
]
},
"block": {
"type": "Block",
"span": {
"start": 7,
"end": 38,
"ctxt": 0
},
"value": [
{
"type": "Declaration",
"span": {
"start": 13,
"end": 19,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 13,
"end": 17,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 25,
"end": 35,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 25,
"end": 30,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Identifier",
"span": {
"start": 32,
"end": 35,
"ctxt": 0
},
"value": "red",
"raw": "red"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 40,
"end": 80,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "ClassSelector",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"text": {
"type": "Identifier",
"span": {
"start": 41,
"end": 46,
"ctxt": 0
},
"value": "class",
"raw": "class"
}
}
]
}
]
}
]
},
"block": {
"type": "Block",
"span": {
"start": 47,
"end": 80,
"ctxt": 0
},
"value": [
{
"type": "Tokens",
"span": {
"start": 53,
"end": 61,
"ctxt": 0
},
"tokens": [
{
"span": {
"start": 53,
"end": 57,
"ctxt": 0
},
"token": {
"Ident": {
"value": "prop",
"raw": "prop"
}
}
},
{
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"token": "Colon"
},
{
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"token": {
"WhiteSpace": {
"value": " "
}
}
},
{
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"token": {
"Delim": {
"value": "!"
}
}
},
{
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"token": {
"Delim": {
"value": "!"
}
}
}
]
},
{
"type": "Declaration",
"span": {
"start": 67,
"end": 77,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 67,
"end": 72,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Identifier",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"value": "red",
"raw": "red"
}
],
"important": null
}
]
}
}
]
}