swc/css/parser/tests/fixture/at-rule/import/output.json
Alexander Akait cc5398b1a6
refactor(css/parser): Refactor parser for at rules (#2617)
swc_css_ast:
 - Move some at-rules to own files.

swc_css_parser:
 - Implement `Parse` for more types.
2021-11-02 11:13:23 +00:00

377 lines
7.2 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 323,
"ctxt": 0
},
"rules": [
{
"type": "ImportRule",
"span": {
"start": 0,
"end": 27,
"ctxt": 0
},
"src": {
"type": "FnValue",
"span": {
"start": 8,
"end": 26,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 8,
"end": 11,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 12,
"end": 25,
"ctxt": 0
},
"value": "./style.css",
"raw": "\"./style.css\""
}
]
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 28,
"end": 55,
"ctxt": 0
},
"src": {
"type": "FnValue",
"span": {
"start": 36,
"end": 54,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 40,
"end": 53,
"ctxt": 0
},
"value": "./style.css",
"raw": "'./style.css'"
}
]
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 56,
"end": 81,
"ctxt": 0
},
"src": {
"type": "UrlValue",
"span": {
"start": 64,
"end": 80,
"ctxt": 0
},
"url": "./style.css",
"raw": "./style.css"
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 82,
"end": 104,
"ctxt": 0
},
"src": {
"type": "String",
"span": {
"start": 90,
"end": 103,
"ctxt": 0
},
"value": "./style.css",
"raw": "'./style.css'"
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 105,
"end": 127,
"ctxt": 0
},
"src": {
"type": "String",
"span": {
"start": 113,
"end": 126,
"ctxt": 0
},
"value": "./style.css",
"raw": "\"./style.css\""
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 128,
"end": 155,
"ctxt": 0
},
"src": {
"type": "FnValue",
"span": {
"start": 136,
"end": 154,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 140,
"end": 153,
"ctxt": 0
},
"value": "./style.css",
"raw": "\"./style.css\""
}
]
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 156,
"end": 181,
"ctxt": 0
},
"src": {
"type": "UrlValue",
"span": {
"start": 164,
"end": 180,
"ctxt": 0
},
"url": "./style.css",
"raw": "./style.css"
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 182,
"end": 209,
"ctxt": 0
},
"src": {
"type": "FnValue",
"span": {
"start": 190,
"end": 208,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 190,
"end": 193,
"ctxt": 0
},
"value": "URL",
"raw": "URL"
},
"args": [
{
"type": "String",
"span": {
"start": 194,
"end": 207,
"ctxt": 0
},
"value": "./style.css",
"raw": "\"./style.css\""
}
]
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 210,
"end": 228,
"ctxt": 0
},
"src": {
"type": "String",
"span": {
"start": 217,
"end": 227,
"ctxt": 0
},
"value": "test.css",
"raw": "\"test.css\""
},
"condition": null
},
{
"type": "ImportRule",
"span": {
"start": 229,
"end": 257,
"ctxt": 0
},
"src": {
"type": "String",
"span": {
"start": 237,
"end": 249,
"ctxt": 0
},
"value": "common.css",
"raw": "\"common.css\""
},
"condition": {
"type": "Text",
"span": {
"start": 250,
"end": 256,
"ctxt": 0
},
"value": "screen",
"raw": "screen"
}
},
{
"type": "ImportRule",
"span": {
"start": 258,
"end": 322,
"ctxt": 0
},
"src": {
"type": "FnValue",
"span": {
"start": 266,
"end": 286,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 266,
"end": 269,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"args": [
{
"type": "String",
"span": {
"start": 270,
"end": 285,
"ctxt": 0
},
"value": "landscape.css",
"raw": "'landscape.css'"
}
]
},
"condition": {
"type": "AndMediaQuery",
"span": {
"start": 287,
"end": 321,
"ctxt": 0
},
"left": {
"type": "Text",
"span": {
"start": 287,
"end": 293,
"ctxt": 0
},
"value": "screen",
"raw": "screen"
},
"right": {
"type": "Declaration",
"span": {
"start": 299,
"end": 321,
"ctxt": 0
},
"property": {
"type": "Text",
"span": {
"start": 299,
"end": 310,
"ctxt": 0
},
"value": "orientation",
"raw": "orientation"
},
"value": [
{
"type": "Text",
"span": {
"start": 311,
"end": 320,
"ctxt": 0
},
"value": "landscape",
"raw": "landscape"
}
],
"important": null
}
}
}
]
}