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

1652 lines
41 KiB
JSON
Raw Normal View History

{
"type": "Stylesheet",
"span": {
"start": 1,
"end": 614,
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
"span": {
"start": 1,
"end": 535,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 1,
"end": 4,
"ctxt": 0
},
"value": "div",
"raw": "div"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 5,
"end": 535,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 11,
"end": 22,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 11,
"end": 15,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 17,
"end": 22,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 28,
"end": 41,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 28,
"end": 32,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 34,
"end": 41,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "Ident",
"span": {
"start": 35,
"end": 40,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 47,
"end": 60,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 47,
"end": 51,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 53,
"end": 60,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Ident",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 66,
"end": 79,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 66,
"end": 70,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 72,
"end": 79,
"ctxt": 0
},
"name": "[",
"value": [
{
"type": "Ident",
"span": {
"start": 73,
"end": 78,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 85,
"end": 100,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 85,
"end": 89,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Function",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 91,
"end": 93,
"ctxt": 0
},
"value": "fn",
"raw": "fn"
},
"value": [
{
"type": "Ident",
"span": {
"start": 94,
"end": 99,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 106,
"end": 130,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 106,
"end": 110,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Function",
"span": {
"start": 112,
"end": 121,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 112,
"end": 114,
"ctxt": 0
},
"value": "fn",
"raw": "fn"
},
"value": [
{
"type": "Ident",
"span": {
"start": 115,
"end": 120,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "Function",
"span": {
"start": 121,
"end": 130,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"value": "fn",
"raw": "fn"
},
"value": [
{
"type": "Ident",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 136,
"end": 154,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 142,
"end": 147,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 149,
"end": 154,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 160,
"end": 178,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 160,
"end": 164,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 166,
"end": 171,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 173,
"end": 178,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 184,
"end": 201,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 190,
"end": 195,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 196,
"end": 201,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 207,
"end": 226,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 207,
"end": 211,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 213,
"end": 218,
"ctxt": 0
},
"value": "value",
"raw": "value"
},
{
"type": "Delimiter",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": ","
},
{
"type": "Ident",
"span": {
"start": 221,
"end": 226,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 232,
"end": 246,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 232,
"end": 236,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Percentage",
"span": {
"start": 238,
"end": 242,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 238,
"end": 241,
"ctxt": 0
},
"value": 100.0,
"raw": "100"
}
},
{
"type": "Percentage",
"span": {
"start": 242,
"end": 246,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 242,
"end": 245,
"ctxt": 0
},
"value": 100.0,
"raw": "100"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 252,
"end": 274,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 252,
"end": 256,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "String",
"span": {
"start": 258,
"end": 266,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
},
{
"type": "String",
"span": {
"start": 266,
"end": 274,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 280,
"end": 294,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 280,
"end": 284,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "HexColor",
"span": {
"start": 286,
"end": 290,
"ctxt": 0
},
"value": "ccc",
"raw": "ccc"
},
{
"type": "HexColor",
"span": {
"start": 290,
"end": 294,
"ctxt": 0
},
"value": "ccc",
"raw": "ccc"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 300,
"end": 326,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 300,
"end": 304,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Url",
"span": {
"start": 306,
"end": 316,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 306,
"end": 309,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "UrlValueRaw",
"span": {
"start": 310,
"end": 315,
"ctxt": 0
},
"before": "",
"after": "",
"value": "value",
"raw": "value"
},
"modifiers": null
},
{
"type": "Url",
"span": {
"start": 316,
"end": 326,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 316,
"end": 319,
"ctxt": 0
},
"value": "url",
"raw": "url"
},
"value": {
"type": "UrlValueRaw",
"span": {
"start": 320,
"end": 325,
"ctxt": 0
},
"before": "",
"after": "",
"value": "value",
"raw": "value"
},
"modifiers": null
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 332,
"end": 352,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 332,
"end": 336,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 338,
"end": 345,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "Ident",
"span": {
"start": 339,
"end": 344,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "SimpleBlock",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"name": "(",
"value": [
{
"type": "Ident",
"span": {
"start": 346,
"end": 351,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 358,
"end": 378,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 358,
"end": 362,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 364,
"end": 371,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Ident",
"span": {
"start": 365,
"end": 370,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "SimpleBlock",
"span": {
"start": 371,
"end": 378,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Ident",
"span": {
"start": 372,
"end": 377,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 384,
"end": 404,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 384,
"end": 388,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "SimpleBlock",
"span": {
"start": 390,
"end": 397,
"ctxt": 0
},
"name": "[",
"value": [
{
"type": "Ident",
"span": {
"start": 391,
"end": 396,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
},
{
"type": "SimpleBlock",
"span": {
"start": 397,
"end": 404,
"ctxt": 0
},
"name": "[",
"value": [
{
"type": "Ident",
"span": {
"start": 398,
"end": 403,
"ctxt": 0
},
"value": "value",
"raw": "value"
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 410,
"end": 426,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 410,
"end": 414,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 416,
"end": 422,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 423,
"end": 426,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 424,
"end": 426,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 432,
"end": 449,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 432,
"end": 436,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 438,
"end": 444,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 444,
"end": 445,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 446,
"end": 449,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 447,
"end": 449,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 455,
"end": 472,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 455,
"end": 459,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 461,
"end": 467,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 469,
"end": 472,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 469,
"end": 470,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 470,
"end": 472,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 478,
"end": 496,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 478,
"end": 482,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 484,
"end": 490,
"ctxt": 0
},
"value": "center",
"raw": "center"
},
{
"type": "Delimiter",
"span": {
"start": 491,
"end": 492,
"ctxt": 0
},
"value": "/"
},
{
"type": "Length",
"span": {
"start": 493,
"end": 496,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 493,
"end": 494,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 494,
"end": 496,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 502,
"end": 513,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 502,
"end": 508,
"ctxt": 0
},
"value": "color",
"raw": "c\\olor"
},
"value": [
{
"type": "Ident",
"span": {
"start": 510,
"end": 513,
"ctxt": 0
},
"value": "red",
"raw": "red"
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 519,
"end": 532,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 519,
"end": 523,
"ctxt": 0
},
"value": "prop",
"raw": "prop"
},
"value": [
{
"type": "Ident",
"span": {
"start": 529,
"end": 532,
"ctxt": 0
},
"value": "big",
"raw": "big"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 537,
"end": 563,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 539,
"end": 563,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 541,
"end": 558,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 541,
"end": 546,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 548,
"end": 549,
"ctxt": 0
},
"value": "a",
"raw": "a"
},
{
"type": "Ident",
"span": {
"start": 557,
"end": 558,
"ctxt": 0
},
"value": "b",
"raw": "b"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 564,
"end": 578,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 565,
"end": 578,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 566,
"end": 577,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 566,
"end": 571,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 572,
"end": 577,
"ctxt": 0
},
"value": "black",
"raw": "black"
}
],
"important": null
}
]
}
},
{
"type": "QualifiedRule",
"span": {
"start": 580,
"end": 613,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 580,
"end": 581,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 580,
"end": 581,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 580,
"end": 581,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": {
"type": "TagNameSelector",
"span": {
"start": 580,
"end": 581,
"ctxt": 0
},
"name": {
"type": "WqName",
"span": {
"start": 580,
"end": 581,
"ctxt": 0
},
"prefix": null,
"value": {
"type": "Ident",
"span": {
"start": 580,
"end": 581,
"ctxt": 0
},
"value": "a",
"raw": "a"
}
}
},
"subclassSelectors": []
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 582,
"end": 613,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 590,
"end": 602,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 590,
"end": 595,
"ctxt": 0
},
"value": "color",
"raw": "color"
},
"value": [
{
"type": "Ident",
"span": {
"start": 597,
"end": 602,
"ctxt": 0
},
"value": "black",
"raw": "black"
}
],
"important": null
}
]
}
}
]
}