swc/crates/swc_css_parser/tests/fixture/declaration/output.json

1652 lines
41 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 613,
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
"span": {
"start": 0,
"end": 534,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 0,
"end": 3,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 0,
"end": 3,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 0,
"end": 3,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 0,
"end": 3,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 0,
"end": 3,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 0,
"end": 3,
"ctxt": 0
},
"value": "div",
"raw": "div"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 4,
"end": 534,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 10,
"end": 21,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 10,
"end": 14,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 16,
"end": 21,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 27,
"end": 40,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 27,
"end": 31,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 33,
"end": 40,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "Ident",
"span": {
"start": 34,
"end": 39,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 46,
"end": 59,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 46,
"end": 50,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 52,
"end": 59,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Ident",
"span": {
"start": 53,
"end": 58,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 65,
"end": 78,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 65,
"end": 69,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 71,
"end": 78,
"ctxt": 0
},
"name": "[",
"value": [
{
"type": "Ident",
"span": {
"start": 72,
"end": 77,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 84,
"end": 99,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 84,
"end": 88,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Function",
"span": {
"start": 90,
"end": 99,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"value": "fn",
"raw": "fn"
},
"value": [
{
"type": "Ident",
"span": {
"start": 93,
"end": 98,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 105,
"end": 129,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 105,
"end": 109,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Function",
"span": {
"start": 111,
"end": 120,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": "fn",
"raw": "fn"
},
"value": [
{
"type": "Ident",
"span": {
"start": 114,
"end": 119,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "Function",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"value": "fn",
"raw": "fn"
},
"value": [
{
"type": "Ident",
"span": {
"start": 123,
"end": 128,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 135,
"end": 153,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 135,
"end": 139,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 141,
"end": 146,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 148,
"end": 153,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 159,
"end": 177,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 165,
"end": 170,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 183,
"end": 200,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 183,
"end": 187,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 189,
"end": 194,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 195,
"end": 200,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 206,
"end": 225,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 206,
"end": 210,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 212,
"end": 217,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 220,
"end": 225,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 231,
"end": 245,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 231,
"end": 235,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Percentage",
"span": {
"start": 237,
"end": 241,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"value": 100.0,
"raw": "100"
}
},
{
"type": "Percentage",
"span": {
"start": 241,
"end": 245,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 241,
"end": 244,
"ctxt": 0
},
"value": 100.0,
"raw": "100"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 251,
"end": 273,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 251,
"end": 255,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "String",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
},
{
"type": "String",
"span": {
"start": 265,
"end": 273,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 279,
"end": 293,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 279,
"end": 283,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "HexColor",
"span": {
"start": 285,
"end": 289,
"ctxt": 0
},
"value": "ccc",
"raw": "ccc"
},
{
"type": "HexColor",
"span": {
"start": 289,
"end": 293,
"ctxt": 0
},
"value": "ccc",
"raw": "ccc"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 299,
"end": 325,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 299,
"end": 303,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Url",
"span": {
"start": 305,
"end": 315,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 305,
"end": 308,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "UrlValueRaw",
"span": {
"start": 309,
"end": 314,
"ctxt": 0
},
"before": "",
"after": "",
"value": "value",
"raw": "value"
},
"modifiers": null
},
{
"type": "Url",
"span": {
"start": 315,
"end": 325,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 315,
"end": 318,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "UrlValueRaw",
"span": {
"start": 319,
"end": 324,
"ctxt": 0
},
"before": "",
"after": "",
"value": "value",
"raw": "value"
},
"modifiers": null
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 331,
"end": 351,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 331,
"end": 335,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 337,
"end": 344,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "Ident",
"span": {
"start": 338,
"end": 343,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "SimpleBlock",
"span": {
"start": 344,
"end": 351,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "Ident",
"span": {
"start": 345,
"end": 350,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 357,
"end": 377,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 357,
"end": 361,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 363,
"end": 370,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Ident",
"span": {
"start": 364,
"end": 369,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "SimpleBlock",
"span": {
"start": 370,
"end": 377,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Ident",
"span": {
"start": 371,
"end": 376,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 383,
"end": 403,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 383,
"end": 387,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 389,
"end": 396,
"ctxt": 0
},
"name": "[",
"value": [
{
"type": "Ident",
"span": {
"start": 390,
"end": 395,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "SimpleBlock",
"span": {
"start": 396,
"end": 403,
"ctxt": 0
},
"name": "[",
"value": [
{
"type": "Ident",
"span": {
"start": 397,
"end": 402,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 409,
"end": 425,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 409,
"end": 413,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 415,
"end": 421,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 422,
"end": 425,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 423,
"end": 425,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 431,
"end": 448,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 431,
"end": 435,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 437,
"end": 443,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 443,
"end": 444,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 445,
"end": 448,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 445,
"end": 446,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 446,
"end": 448,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 454,
"end": 471,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 454,
"end": 458,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 460,
"end": 466,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 468,
"end": 471,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 469,
"end": 471,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 477,
"end": 495,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 477,
"end": 481,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 483,
"end": 489,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 490,
"end": 491,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 492,
"end": 495,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 493,
"end": 495,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 501,
"end": 512,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 501,
"end": 507,
"ctxt": 0
},
"value": "color",
"raw": "c\\olor"
},
"value": [
{
"type": "Ident",
"span": {
"start": 509,
"end": 512,
"ctxt": 0
},
"value": "red",
"raw": "red"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 518,
"end": 531,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 518,
"end": 522,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 528,
"end": 531,
"ctxt": 0
},
"value": "big",
"raw": "big"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 536,
"end": 562,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 538,
"end": 562,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 540,
"end": 557,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 540,
"end": 545,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 547,
"end": 548,
"ctxt": 0
},
"value": "a",
"raw": "a"
},
{
"type": "Ident",
"span": {
"start": 556,
"end": 557,
"ctxt": 0
},
"value": "b",
"raw": "b"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 563,
"end": 577,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 564,
"end": 577,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 565,
"end": 576,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 565,
"end": 570,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 571,
"end": 576,
"ctxt": 0
},
"value": "black",
"raw": "black"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 579,
"end": 612,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 581,
"end": 612,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 589,
"end": 601,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 589,
"end": 594,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 596,
"end": 601,
"ctxt": 0
},
"value": "black",
"raw": "black"
}
],
"important": null
}
]
}
}
]
}