| 1 |
{ |
| 2 |
"information_for_contributors": [ |
| 3 |
"This file has been converted from https://github.com/atom/language-less/blob/master/grammars/less.cson", |
| 4 |
"If you want to provide a fix or improvement, please create a pull request against the original repository.", |
| 5 |
"Once accepted there, we are happy to receive an update request." |
| 6 |
], |
| 7 |
"version": "https://github.com/atom/language-less/commit/87d4d59e8de6796b506b81a16e1dc1fafc99d30f", |
| 8 |
"name": "less", |
| 9 |
"scopeName": "source.css.less", |
| 10 |
"patterns": [ |
| 11 |
{ |
| 12 |
"include": "#strings" |
| 13 |
}, |
| 14 |
{ |
| 15 |
"captures": { |
| 16 |
"1": { |
| 17 |
"name": "entity.other.attribute-name.class.mixin.css" |
| 18 |
} |
| 19 |
}, |
| 20 |
"match": "(\\.[_a-zA-Z][a-zA-Z0-9_-]*(?=\\())" |
| 21 |
}, |
| 22 |
{ |
| 23 |
"captures": { |
| 24 |
"1": { |
| 25 |
"name": "entity.other.attribute-name.class.css" |
| 26 |
}, |
| 27 |
"2": { |
| 28 |
"name": "punctuation.definition.entity.css" |
| 29 |
}, |
| 30 |
"4": { |
| 31 |
"name": "variable.other.interpolation.less" |
| 32 |
} |
| 33 |
}, |
| 34 |
"match": "((\\.)([_a-zA-Z]|(@{[a-zA-Z0-9_-]+}))[a-zA-Z0-9_-]*)" |
| 35 |
}, |
| 36 |
{ |
| 37 |
"captures": { |
| 38 |
"0": { |
| 39 |
"name": "entity.other.attribute-name.parent-selector.css" |
| 40 |
}, |
| 41 |
"1": { |
| 42 |
"name": "punctuation.definition.entity.css" |
| 43 |
} |
| 44 |
}, |
| 45 |
"match": "(&)[a-zA-Z0-9_-]*" |
| 46 |
}, |
| 47 |
{ |
| 48 |
"begin": "(format|local|url|attr|counter|counters)\\s*(\\()", |
| 49 |
"beginCaptures": { |
| 50 |
"1": { |
| 51 |
"name": "support.function.misc.css" |
| 52 |
}, |
| 53 |
"2": { |
| 54 |
"name": "punctuation.section.function.css" |
| 55 |
} |
| 56 |
}, |
| 57 |
"end": "\\)", |
| 58 |
"endCaptures": { |
| 59 |
"0": { |
| 60 |
"name": "punctuation.section.function.css" |
| 61 |
} |
| 62 |
}, |
| 63 |
"patterns": [ |
| 64 |
{ |
| 65 |
"begin": "'", |
| 66 |
"beginCaptures": { |
| 67 |
"0": { |
| 68 |
"name": "punctuation.definition.string.begin.css" |
| 69 |
} |
| 70 |
}, |
| 71 |
"end": "'", |
| 72 |
"endCaptures": { |
| 73 |
"0": { |
| 74 |
"name": "punctuation.definition.string.end.css" |
| 75 |
} |
| 76 |
}, |
| 77 |
"name": "string.quoted.single.css", |
| 78 |
"patterns": [ |
| 79 |
{ |
| 80 |
"match": "\\\\.", |
| 81 |
"name": "constant.character.escape.css" |
| 82 |
} |
| 83 |
] |
| 84 |
}, |
| 85 |
{ |
| 86 |
"begin": "\"", |
| 87 |
"beginCaptures": { |
| 88 |
"0": { |
| 89 |
"name": "punctuation.definition.string.begin.css" |
| 90 |
} |
| 91 |
}, |
| 92 |
"end": "\"", |
| 93 |
"endCaptures": { |
| 94 |
"0": { |
| 95 |
"name": "punctuation.definition.string.end.css" |
| 96 |
} |
| 97 |
}, |
| 98 |
"name": "string.quoted.double.css", |
| 99 |
"patterns": [ |
| 100 |
{ |
| 101 |
"match": "\\\\(\\d{1,6}|.)", |
| 102 |
"name": "constant.character.escape.css" |
| 103 |
} |
| 104 |
] |
| 105 |
}, |
| 106 |
{ |
| 107 |
"match": "[^'\") \\t]+", |
| 108 |
"name": "variable.parameter.misc.css" |
| 109 |
} |
| 110 |
] |
| 111 |
}, |
| 112 |
{ |
| 113 |
"match": "(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\\b(?!.*?(?<!@){)", |
| 114 |
"name": "constant.other.rgb-value.css" |
| 115 |
}, |
| 116 |
{ |
| 117 |
"captures": { |
| 118 |
"1": { |
| 119 |
"name": "entity.other.attribute-name.id" |
| 120 |
}, |
| 121 |
"2": { |
| 122 |
"name": "punctuation.definition.entity.css" |
| 123 |
}, |
| 124 |
"4": { |
| 125 |
"name": "variable.other.interpolation.less" |
| 126 |
} |
| 127 |
}, |
| 128 |
"match": "((#)([_a-zA-Z]|(@{[a-zA-Z0-9_-]+}))[a-zA-Z0-9_-]*)", |
| 129 |
"name": "meta.selector.css" |
| 130 |
}, |
| 131 |
{ |
| 132 |
"begin": "/\\*", |
| 133 |
"beginCaptures": { |
| 134 |
"0": { |
| 135 |
"name": "punctuation.definition.comment.begin.css" |
| 136 |
} |
| 137 |
}, |
| 138 |
"end": "\\*/", |
| 139 |
"endCaptures": { |
| 140 |
"0": { |
| 141 |
"name": "punctuation.definition.comment.end.css" |
| 142 |
} |
| 143 |
}, |
| 144 |
"name": "comment.block.css" |
| 145 |
}, |
| 146 |
{ |
| 147 |
"include": "source.css#numeric-values" |
| 148 |
}, |
| 149 |
{ |
| 150 |
"captures": { |
| 151 |
"1": { |
| 152 |
"name": "punctuation.definition.begin.entity.css" |
| 153 |
}, |
| 154 |
"2": { |
| 155 |
"name": "entity.other.attribute-name.attribute.css" |
| 156 |
}, |
| 157 |
"3": { |
| 158 |
"name": "punctuation.separator.operator.css" |
| 159 |
}, |
| 160 |
"4": { |
| 161 |
"name": "string.unquoted.attribute-value.css" |
| 162 |
}, |
| 163 |
"5": { |
| 164 |
"name": "string.quoted.double.attribute-value.css" |
| 165 |
}, |
| 166 |
"6": { |
| 167 |
"name": "punctuation.definition.string.begin.css" |
| 168 |
}, |
| 169 |
"7": { |
| 170 |
"name": "punctuation.definition.string.end.css" |
| 171 |
}, |
| 172 |
"8": { |
| 173 |
"name": "punctuation.definition.end.entity.css" |
| 174 |
} |
| 175 |
}, |
| 176 |
"match": "(?i)(\\[)\\s*(-?[_a-z\\\\[[:^ascii:]]][_a-z0-9\\-\\\\[[:^ascii:]]]*)(?:\\s*([~|^$*]?=)\\s*(?:(-?[_a-z\\\\[[:^ascii:]]][_a-z0-9\\-\\\\[[:^ascii:]]]*)|((?>(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(\\])", |
| 177 |
"name": "meta.attribute-selector.css" |
| 178 |
}, |
| 179 |
{ |
| 180 |
"begin": "((@)import\\b)", |
| 181 |
"beginCaptures": { |
| 182 |
"1": { |
| 183 |
"name": "keyword.control.at-rule.import.less" |
| 184 |
}, |
| 185 |
"2": { |
| 186 |
"name": "punctuation.definition.keyword.less" |
| 187 |
} |
| 188 |
}, |
| 189 |
"end": ";", |
| 190 |
"endCaptures": { |
| 191 |
"0": { |
| 192 |
"name": "punctuation.terminator.rule.css" |
| 193 |
} |
| 194 |
}, |
| 195 |
"name": "meta.at-rule.import.css", |
| 196 |
"patterns": [ |
| 197 |
{ |
| 198 |
"match": "(?<=\\(|,|\\s)\\b(reference|optional|once|multiple|less|inline)\\b(?=\\)|,)", |
| 199 |
"name": "keyword.control.import.option.less" |
| 200 |
}, |
| 201 |
{ |
| 202 |
"include": "#brace_round" |
| 203 |
}, |
| 204 |
{ |
| 205 |
"include": "source.css#commas" |
| 206 |
}, |
| 207 |
{ |
| 208 |
"include": "#strings" |
| 209 |
} |
| 210 |
] |
| 211 |
}, |
| 212 |
{ |
| 213 |
"captures": { |
| 214 |
"1": { |
| 215 |
"name": "keyword.control.at-rule.fontface.css" |
| 216 |
}, |
| 217 |
"2": { |
| 218 |
"name": "punctuation.definition.keyword.css" |
| 219 |
} |
| 220 |
}, |
| 221 |
"match": "^\\s*((@)font-face\\b)", |
| 222 |
"name": "meta.at-rule.fontface.css" |
| 223 |
}, |
| 224 |
{ |
| 225 |
"captures": { |
| 226 |
"1": { |
| 227 |
"name": "keyword.control.at-rule.media.css" |
| 228 |
}, |
| 229 |
"2": { |
| 230 |
"name": "punctuation.definition.keyword.css" |
| 231 |
} |
| 232 |
}, |
| 233 |
"match": "^\\s*((@)media\\b)", |
| 234 |
"name": "meta.at-rule.media.css" |
| 235 |
}, |
| 236 |
{ |
| 237 |
"include": "source.css#media-features" |
| 238 |
}, |
| 239 |
{ |
| 240 |
"match": "\\b(tv|tty|screen|projection|print|handheld|embossed|braille|aural|all)\\b", |
| 241 |
"name": "support.constant.media-type.media.css" |
| 242 |
}, |
| 243 |
{ |
| 244 |
"match": "\\b(portrait|landscape)\\b", |
| 245 |
"name": "support.constant.property-value.media-property.media.css" |
| 246 |
}, |
| 247 |
{ |
| 248 |
"captures": { |
| 249 |
"1": { |
| 250 |
"name": "support.function.less" |
| 251 |
} |
| 252 |
}, |
| 253 |
"match": "(\\.[a-zA-Z0-9_-]+)\\s*(;|\\()" |
| 254 |
}, |
| 255 |
{ |
| 256 |
"begin": "(^[ \\t]+)?(?=//)", |
| 257 |
"beginCaptures": { |
| 258 |
"1": { |
| 259 |
"name": "punctuation.whitespace.comment.leading.less" |
| 260 |
} |
| 261 |
}, |
| 262 |
"end": "(?!\\G)", |
| 263 |
"patterns": [ |
| 264 |
{ |
| 265 |
"begin": "//", |
| 266 |
"beginCaptures": { |
| 267 |
"0": { |
| 268 |
"name": "punctuation.definition.comment.less" |
| 269 |
} |
| 270 |
}, |
| 271 |
"end": "\\n", |
| 272 |
"name": "comment.line.double-slash.less" |
| 273 |
} |
| 274 |
] |
| 275 |
}, |
| 276 |
{ |
| 277 |
"match": "(@|\\-\\-)[\\w-]+(?=\\s*)", |
| 278 |
"name": "variable.other.less", |
| 279 |
"captures": { |
| 280 |
"1": { |
| 281 |
"name": "punctuation.definition.variable.less" |
| 282 |
} |
| 283 |
} |
| 284 |
}, |
| 285 |
{ |
| 286 |
"include": "#variable_interpolation" |
| 287 |
}, |
| 288 |
{ |
| 289 |
"begin": "{", |
| 290 |
"beginCaptures": { |
| 291 |
"0": { |
| 292 |
"name": "punctuation.section.property-list.begin.bracket.curly.css" |
| 293 |
} |
| 294 |
}, |
| 295 |
"end": "}", |
| 296 |
"endCaptures": { |
| 297 |
"0": { |
| 298 |
"name": "punctuation.section.property-list.end.bracket.curly.css" |
| 299 |
} |
| 300 |
}, |
| 301 |
"name": "meta.property-list.css", |
| 302 |
"patterns": [ |
| 303 |
{ |
| 304 |
"include": "source.css#pseudo-elements" |
| 305 |
}, |
| 306 |
{ |
| 307 |
"include": "source.css#pseudo-classes" |
| 308 |
}, |
| 309 |
{ |
| 310 |
"include": "source.css#tag-names" |
| 311 |
}, |
| 312 |
{ |
| 313 |
"include": "source.css#commas" |
| 314 |
}, |
| 315 |
{ |
| 316 |
"include": "#variable_interpolation" |
| 317 |
}, |
| 318 |
{ |
| 319 |
"include": "source.css#property-names" |
| 320 |
}, |
| 321 |
{ |
| 322 |
"include": "#property_values" |
| 323 |
}, |
| 324 |
{ |
| 325 |
"include": "$self" |
| 326 |
} |
| 327 |
] |
| 328 |
}, |
| 329 |
{ |
| 330 |
"match": "\\!\\s*important", |
| 331 |
"name": "keyword.other.important.css" |
| 332 |
}, |
| 333 |
{ |
| 334 |
"match": "\\*|\\/|\\-|\\+|~|=|<=|>=|<|>", |
| 335 |
"name": "keyword.operator.less" |
| 336 |
}, |
| 337 |
{ |
| 338 |
"match": "\\b(not|and|when)\\b", |
| 339 |
"name": "keyword.control.logical.operator.less" |
| 340 |
}, |
| 341 |
{ |
| 342 |
"include": "source.css#tag-names" |
| 343 |
}, |
| 344 |
{ |
| 345 |
"match": "(?<![\\w-])[a-z][\\w&&[^A-Z]]*+-[\\w-&&[^A-Z]]+", |
| 346 |
"name": "entity.name.tag.custom.css" |
| 347 |
}, |
| 348 |
{ |
| 349 |
"include": "source.css#pseudo-elements" |
| 350 |
}, |
| 351 |
{ |
| 352 |
"include": "source.css#pseudo-classes" |
| 353 |
}, |
| 354 |
{ |
| 355 |
"captures": { |
| 356 |
"1": { |
| 357 |
"name": "punctuation.section.property-list.begin.css" |
| 358 |
}, |
| 359 |
"2": { |
| 360 |
"name": "punctuation.section.property-list.end.css" |
| 361 |
} |
| 362 |
}, |
| 363 |
"match": "(\\{)(\\})", |
| 364 |
"name": "meta.brace.curly.css" |
| 365 |
}, |
| 366 |
{ |
| 367 |
"match": "\\{|\\}", |
| 368 |
"name": "meta.brace.curly.css" |
| 369 |
}, |
| 370 |
{ |
| 371 |
"include": "#brace_round" |
| 372 |
}, |
| 373 |
{ |
| 374 |
"match": "\\[|\\]", |
| 375 |
"name": "meta.brace.square.less" |
| 376 |
}, |
| 377 |
{ |
| 378 |
"match": ";", |
| 379 |
"name": "punctuation.terminator.rule.css" |
| 380 |
}, |
| 381 |
{ |
| 382 |
"match": ":", |
| 383 |
"name": "punctuation.separator.key-value.css" |
| 384 |
}, |
| 385 |
{ |
| 386 |
"match": "\\btrue\\b", |
| 387 |
"name": "constant.language.boolean.less" |
| 388 |
}, |
| 389 |
{ |
| 390 |
"match": "\\bdefault\\b", |
| 391 |
"name": "support.function.default.less" |
| 392 |
}, |
| 393 |
{ |
| 394 |
"match": "\\b(isurl|isstring|isnumber|iskeyword|iscolor)\\b", |
| 395 |
"name": "support.function.type-checking.less" |
| 396 |
}, |
| 397 |
{ |
| 398 |
"match": "\\b(isunit|ispixel|ispercentage|isem)\\b", |
| 399 |
"name": "support.function.unit-checking.less" |
| 400 |
}, |
| 401 |
{ |
| 402 |
"include": "source.css#property-keywords" |
| 403 |
}, |
| 404 |
{ |
| 405 |
"include": "source.css#color-keywords" |
| 406 |
}, |
| 407 |
{ |
| 408 |
"include": "source.css#commas" |
| 409 |
}, |
| 410 |
{ |
| 411 |
"include": "#less_builtin_functions" |
| 412 |
}, |
| 413 |
{ |
| 414 |
"include": "source.css#functions" |
| 415 |
} |
| 416 |
], |
| 417 |
"repository": { |
| 418 |
"variable_interpolation": { |
| 419 |
"match": "@{[a-zA-Z0-9_-]+}", |
| 420 |
"name": "variable.other.interpolation.less" |
| 421 |
}, |
| 422 |
"strings": { |
| 423 |
"patterns": [ |
| 424 |
{ |
| 425 |
"begin": "\"", |
| 426 |
"beginCaptures": { |
| 427 |
"0": { |
| 428 |
"name": "punctuation.definition.string.begin.css" |
| 429 |
} |
| 430 |
}, |
| 431 |
"end": "\"", |
| 432 |
"endCaptures": { |
| 433 |
"0": { |
| 434 |
"name": "punctuation.definition.string.end.css" |
| 435 |
} |
| 436 |
}, |
| 437 |
"name": "string.quoted.double.css", |
| 438 |
"patterns": [ |
| 439 |
{ |
| 440 |
"match": "\\\\([0-9A-Fa-f]{1,6}|.)", |
| 441 |
"name": "constant.character.escape.css" |
| 442 |
}, |
| 443 |
{ |
| 444 |
"include": "#variable_interpolation" |
| 445 |
} |
| 446 |
] |
| 447 |
}, |
| 448 |
{ |
| 449 |
"begin": "'", |
| 450 |
"beginCaptures": { |
| 451 |
"0": { |
| 452 |
"name": "punctuation.definition.string.begin.css" |
| 453 |
} |
| 454 |
}, |
| 455 |
"end": "'", |
| 456 |
"endCaptures": { |
| 457 |
"0": { |
| 458 |
"name": "punctuation.definition.string.end.css" |
| 459 |
} |
| 460 |
}, |
| 461 |
"name": "string.quoted.single.css", |
| 462 |
"patterns": [ |
| 463 |
{ |
| 464 |
"match": "\\\\([0-9A-Fa-f]{1,6}|.)", |
| 465 |
"name": "constant.character.escape.css" |
| 466 |
}, |
| 467 |
{ |
| 468 |
"include": "#variable_interpolation" |
| 469 |
} |
| 470 |
] |
| 471 |
} |
| 472 |
] |
| 473 |
}, |
| 474 |
"brace_round": { |
| 475 |
"match": "\\(|\\)", |
| 476 |
"name": "meta.brace.round.css" |
| 477 |
}, |
| 478 |
"property_values": { |
| 479 |
"begin": "(?<!&)(:)\\s*(?!(\\s*{))(?!.*(?<!@){)", |
| 480 |
"beginCaptures": { |
| 481 |
"1": { |
| 482 |
"name": "punctuation.separator.key-value.css" |
| 483 |
} |
| 484 |
}, |
| 485 |
"end": "\\s*(;)|\\s*(?=})", |
| 486 |
"endCaptures": { |
| 487 |
"1": { |
| 488 |
"name": "punctuation.terminator.rule.css" |
| 489 |
} |
| 490 |
}, |
| 491 |
"contentName": "meta.property-value.css", |
| 492 |
"patterns": [ |
| 493 |
{ |
| 494 |
"begin": "url(\\()", |
| 495 |
"beginCaptures": { |
| 496 |
"1": { |
| 497 |
"name": "meta.brace.round.css" |
| 498 |
} |
| 499 |
}, |
| 500 |
"end": "\\)", |
| 501 |
"endCaptures": { |
| 502 |
"0": { |
| 503 |
"name": "meta.brace.round.css" |
| 504 |
} |
| 505 |
}, |
| 506 |
"name": "support.function.any-method.builtin.url.css", |
| 507 |
"patterns": [ |
| 508 |
{ |
| 509 |
"include": "#strings" |
| 510 |
}, |
| 511 |
{ |
| 512 |
"match": "(\\b|\\.{0,2}/)[^)]*\\b", |
| 513 |
"name": "string.url.css" |
| 514 |
} |
| 515 |
] |
| 516 |
}, |
| 517 |
{ |
| 518 |
"include": "source.css#property-keywords" |
| 519 |
}, |
| 520 |
{ |
| 521 |
"include": "source.css#color-keywords" |
| 522 |
}, |
| 523 |
{ |
| 524 |
"include": "source.css#commas" |
| 525 |
}, |
| 526 |
{ |
| 527 |
"include": "#less_builtin_functions" |
| 528 |
}, |
| 529 |
{ |
| 530 |
"include": "source.css#functions" |
| 531 |
}, |
| 532 |
{ |
| 533 |
"include": "$self" |
| 534 |
} |
| 535 |
] |
| 536 |
}, |
| 537 |
"less_builtin_functions": { |
| 538 |
"match": "\\b(abs|acos|alpha|argb|asin|atan|average|blue|calc|ceil|color|contrast|convert|convert|cos|darken|data-uri|desaturate|difference|e|escape|exclusion|extract|fade|fadein|fadeout|floor|format|green|greyscale|hardlight|hsl|hsla|hsv|hsva|hsvhue|hsvsaturation|hsvvalue|hue|length|lighten|lightness|luma|max|min|mix|mod|multiply|negation|overlay|percentage|pi|pow|red|replace|round|saturate|saturation|screen|sin|softlight|spin|sqrt|tan|unit)\\b", |
| 539 |
"name": "support.function.any-method.builtin.less" |
| 540 |
} |
| 541 |
} |
| 542 |
} |
| 543 |
|