swc/crates/swc_css_parser/tests/fixture/rome/functions/output.json

455 lines
12 KiB
JSON
Raw Normal View History

2021-08-19 08:16:32 +03:00
{
"type": "Stylesheet",
"span": {
"start": 1,
"end": 167,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
2021-08-19 08:16:32 +03:00
"span": {
"start": 1,
"end": 166,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 1,
"end": 7,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "ClassSelector",
2021-08-19 08:16:32 +03:00
"span": {
"start": 1,
"end": 7,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"text": {
"type": "Ident",
"span": {
"start": 2,
"end": 7,
"ctxt": 0
},
"value": "style",
"raw": "style"
}
2021-08-19 08:16:32 +03:00
}
]
}
]
}
]
},
2021-08-19 08:16:32 +03:00
"block": {
"type": "SimpleBlock",
2021-08-19 08:16:32 +03:00
"span": {
"start": 8,
"end": 166,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": "{",
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "Declaration",
2021-08-19 08:16:32 +03:00
"span": {
"start": 11,
"end": 23,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "DashedIdent",
2021-08-19 08:16:32 +03:00
"span": {
"start": 11,
"end": 18,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "--fancy",
"raw": "--fancy"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "PreservedToken",
2021-08-19 08:16:32 +03:00
"span": {
"start": 20,
"end": 23,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"token": {
"Dimension": {
"value": 2.0,
"raw_value": "2",
"unit": "px",
"raw_unit": "px",
"type": "integer"
}
}
2021-08-19 08:16:32 +03:00
}
],
"important": null
},
{
"type": "Declaration",
2021-08-19 08:16:32 +03:00
"span": {
"start": 26,
"end": 46,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 26,
"end": 32,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "border",
"raw": "border"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "Function",
2021-08-19 08:16:32 +03:00
"span": {
"start": 34,
"end": 46,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 34,
"end": 37,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "var",
"raw": "var"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "DashedIdent",
2021-08-19 08:16:32 +03:00
"span": {
"start": 38,
"end": 45,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "--fancy",
"raw": "--fancy"
2021-08-19 08:16:32 +03:00
}
]
}
],
"important": null
},
{
"type": "Declaration",
2021-08-19 08:16:32 +03:00
"span": {
"start": 49,
"end": 77,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 49,
"end": 58,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "font-size",
"raw": "font-size"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "Function",
2021-08-19 08:16:32 +03:00
"span": {
"start": 60,
"end": 77,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 60,
"end": 64,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "calc",
"raw": "calc"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "CalcSum",
2021-08-19 08:16:32 +03:00
"span": {
"start": 65,
"end": 76,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
2021-08-19 08:16:32 +03:00
"span": {
"start": 65,
"end": 69,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 65,
"end": 69,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 65,
"end": 67,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
},
"unit": {
"type": "Ident",
"span": {
"start": 67,
"end": 69,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
]
2021-08-19 08:16:32 +03:00
},
{
"type": "CalcOperator",
2021-08-19 08:16:32 +03:00
"span": {
"start": 70,
"end": 71,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "+"
2021-08-19 08:16:32 +03:00
},
{
"type": "CalcProduct",
2021-08-19 08:16:32 +03:00
"span": {
"start": 72,
"end": 76,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 72,
"end": 76,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": 5.0,
"raw": "5"
},
"unit": {
"type": "Ident",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"value": "rem",
"raw": "rem"
}
}
]
2021-08-19 08:16:32 +03:00
}
]
2021-08-19 08:16:32 +03:00
}
]
}
],
"important": null
},
{
"type": "Declaration",
2021-08-19 08:16:32 +03:00
"span": {
"start": 80,
"end": 99,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 80,
"end": 90,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "background",
"raw": "background"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "Url",
2021-08-19 08:16:32 +03:00
"span": {
"start": 92,
"end": 99,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 92,
"end": 95,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "url",
"raw": "url"
2021-08-19 08:16:32 +03:00
},
"value": {
"type": "String",
"span": {
"start": 96,
"end": 98,
"ctxt": 0
},
"value": "",
"raw": "\"\""
},
"modifiers": []
2021-08-19 08:16:32 +03:00
}
],
"important": null
},
{
"type": "Declaration",
2021-08-19 08:16:32 +03:00
"span": {
"start": 102,
"end": 130,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 102,
"end": 112,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "background",
"raw": "background"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "Url",
2021-08-19 08:16:32 +03:00
"span": {
"start": 114,
"end": 130,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 114,
"end": 117,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "url",
"raw": "url"
2021-08-19 08:16:32 +03:00
},
"value": {
"type": "String",
"span": {
"start": 118,
"end": 129,
"ctxt": 0
},
"value": "something",
"raw": "\"something\""
},
"modifiers": []
2021-08-19 08:16:32 +03:00
}
],
"important": null
},
{
"type": "Declaration",
2021-08-19 08:16:32 +03:00
"span": {
"start": 133,
"end": 163,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 133,
"end": 143,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "background",
"raw": "background"
2021-08-19 08:16:32 +03:00
},
"value": [
2021-08-19 08:16:32 +03:00
{
"type": "Url",
2021-08-19 08:16:32 +03:00
"span": {
"start": 145,
"end": 163,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"name": {
"type": "Ident",
2021-08-19 08:16:32 +03:00
"span": {
"start": 145,
"end": 148,
2021-08-19 08:16:32 +03:00
"ctxt": 0
},
"value": "url",
"raw": "url"
2021-08-19 08:16:32 +03:00
},
"value": {
"type": "String",
"span": {
"start": 149,
"end": 162,
"ctxt": 0
},
"value": "./something",
"raw": "\"./something\""
},
"modifiers": []
2021-08-19 08:16:32 +03:00
}
],
"important": null
}
]
}
}
]
}