File size: 5,861 Bytes
2d39154 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | {
"name": "DSSL",
"scopeName": "source.dssl",
"patterns": [
{ "include": "#comments" },
{ "include": "#at-rules" },
{ "include": "#block-keywords" },
{ "include": "#use" },
{ "include": "#state-headers" },
{ "include": "#strings" },
{ "include": "#properties" },
{ "include": "#values" },
{ "include": "#selectors" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.dssl",
"match": "//.*$"
},
{
"name": "comment.block.dssl",
"begin": "/\\*",
"end": "\\*/",
"patterns": [{ "include": "#values" }]
}
]
},
"strings": {
"patterns": [
{ "name": "string.quoted.double.dssl", "begin": "\"", "end": "\"", "patterns": [{ "include": "#values" }] },
{ "name": "string.quoted.single.dssl", "begin": "'", "end": "'", "patterns": [{ "include": "#values" }] }
]
},
"at-rules": {
"patterns": [
{
"name": "meta.at-rule.dssl",
"match": "(@)(media|container|signal|layer|supports)\\b([^\\n{]*)",
"captures": {
"1": { "name": "punctuation.definition.at-rule.dssl" },
"2": { "name": "keyword.control.at-rule.dssl" },
"3": {
"patterns": [
{ "include": "#values" },
{ "name": "entity.name.condition.dssl", "match": "[\\w-]+\\s*\\(" },
{ "name": "variable.other.signal.dssl", "match": "\\b[a-z][\\w-]*\\b" }
]
}
}
}
]
},
"block-keywords": {
"patterns": [
{
"name": "meta.tokens-block.dssl",
"match": "^\\s*(tokens|pin)(?=\\s*\\{)",
"captures": { "1": { "name": "keyword.control.block.dssl" } }
},
{
"name": "meta.named-block.dssl",
"match": "^\\s*(behavior|motion)\\s+([\\w-]+)(?=\\s*\\{)",
"captures": {
"1": { "name": "keyword.control.block.dssl" },
"2": { "name": "entity.name.function.dssl" }
}
}
]
},
"use": {
"patterns": [
{
"name": "meta.use-behavior.dssl",
"match": "(?<=^\\s*|;\\s*)(use)\\s+([\\w-]+)",
"captures": {
"1": { "name": "keyword.control.use.dssl" },
"2": { "name": "entity.name.function.dssl" }
}
}
]
},
"state-headers": {
"patterns": [
{
"name": "meta.state-block.dssl",
"match": "^\\s*(hover|focus|focus-visible|active|press|pressed|disabled|checked|empty|target|seen|before|after)(?=\\s*\\{)",
"captures": { "1": { "name": "keyword.control.state.dssl" } }
}
]
},
"properties": {
"patterns": [
{
"name": "meta.property.dssl",
"match": "(?<=^\\s*|;\\s*|\\{\\s*)(--?[\\w-]+)\\s*:(?![^;\\n]*\\{)",
"captures": {
"1": {
"patterns": [
{
"name": "support.type.property-name.custom.dssl",
"match": "^--"
},
{
"name": "support.type.property-name.dssl",
"match": ".+"
}
]
}
}
}
]
},
"values": {
"patterns": [
{ "include": "#comments" },
{ "include": "#strings" },
{
"name": "constant.numeric.token-ref.dssl",
"match": "(?<=[\\s:(,])([\\w-]+\\.[\\w-]+(?:\\.[\\w-]+)*)",
"captures": { "1": { "name": "variable.other.token.dssl" } }
},
{
"name": "constant.other.color.hex.dssl",
"match": "#[0-9a-fA-F]{3,8}\\b"
},
{
"name": "constant.numeric.dssl",
"match": "(?<![\\w.#-])-?\\d+(?:\\.\\d+)?(?:%|px|s|ms|deg|fr|em|rem|vh|vw|ch)?"
},
{
"name": "support.constant.keyword.dssl",
"match": "\\b(infinite|alternate|alternate-reverse|reverse|snap|essential|linear|ease|ease-in|ease-out|ease-in-out|from|to|odd|even|flex-start|flex-end|center|stretch|baseline|nowrap|wrap|bold|manual|pixelated|crisp-edges|solid|dashed|dotted|hidden|visible|sticky|absolute|relative|fixed|block|inline|flex|grid|left|right|top|bottom|both|forwards|backwards|none|auto|inherit|initial|unset|revert)\\b"
},
{
"name": "keyword.operator.arrow.dssl",
"match": "->"
},
{
"name": "keyword.operator.alpha.dssl",
"match": "(?<=\\w)/\\d+"
},
{
"name": "punctuation.separator.comma.dssl",
"match": ","
}
]
},
"selectors": {
"patterns": [
{
"name": "meta.selector.dssl",
"match": "(?<![\\w-])\\.[\\w-]+",
"captures": { "0": { "name": "entity.other.attribute-name.class.dssl" } }
},
{
"name": "meta.selector.id.dssl",
"match": "(?<![\\w-])#[\\w-]+",
"captures": { "0": { "name": "entity.other.attribute-name.id.dssl" } }
},
{
"name": "keyword.operator.parent.dssl",
"match": "&"
},
{
"name": "keyword.operator.combinator.dssl",
"match": ">"
},
{
"name": "entity.name.tag.dssl",
"match": "(?<![\\w.\\-#])([a-zA-Z][\\w-]*)(?=[\\s,{>:])"
},
{
"name": "entity.other.pseudo-class.dssl",
"match": "::?(-webkit-|-moz-|-ms-)?[\\w-]+(?![\\w-])"
},
{
"name": "punctuation.section.block.begin.dssl",
"match": "\\{"
},
{
"name": "punctuation.section.block.end.dssl",
"match": "\\}"
}
]
}
}
}
|