swc/css/parser/tests/fixture/esbuild/misc/O2EvcnNp_CVyX3xq5-eM-g/output.json
강동윤 7381644f6b
feat(css): Implement codegen for css (#2115)
swc_css_ast:
 - Remove unused tokens.
 - `SubclassSelector::PseudoClass` => `SubclassSelector::Pseudo`.
 - Fix `AttrSelectorOp`
 - `AttrSelector.value`: `Option<Text>` => `Option<Str>`.

swc_css_codegen:
 - Implement a code generator.

swc_css_parser:
 - Implement `Parse<Stylesheet>` for the parser.
 - Fix parsing of pseudo selectors.
 - Fix parsing of unknown at-rules.
2021-08-20 12:38:15 +00:00

127 lines
2.9 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 27,
"ctxt": 0
},
"rules": [
{
"type": "StyleRule",
"span": {
"start": 0,
"end": 27,
"ctxt": 0
},
"selectors": [
{
"type": "ComplexSelector",
"span": {
"start": 0,
"end": 7,
"ctxt": 0
},
"selectors": [
{
"type": "CompoundSelector",
"span": {
"start": 0,
"end": 7,
"ctxt": 0
},
"hasNestPrefix": false,
"combinator": null,
"typeSelector": {
"type": "NamespacedName",
"span": {
"start": 0,
"end": 1,
"ctxt": 0
},
"prefix": null,
"name": {
"type": "Text",
"span": {
"start": 0,
"end": 1,
"ctxt": 0
},
"value": "a"
}
},
"subclassSelectors": [
{
"type": "PseudoSelector",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"isElement": false,
"name": {
"type": "Text",
"span": {
"start": 2,
"end": 7,
"ctxt": 0
},
"value": "after"
},
"args": {
"type": "Tokens",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"tokens": []
}
}
]
}
]
}
],
"block": {
"type": "DeclBlock",
"span": {
"start": 8,
"end": 27,
"ctxt": 0
},
"properties": [
{
"type": "Property",
"span": {
"start": 10,
"end": 25,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 10,
"end": 17,
"ctxt": 0
},
"value": "content"
},
"values": [
{
"type": "String",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"value": "a\nb"
}
],
"important": null
}
]
}
}
]
}