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
---
name: Less
file_extensions:
- less
scope: source.less
variables:
property: '[A-Za-z-]+'
contexts:
prototype:
- include: comments
main:
- include: strings
- match: '@[A-Za-z_][A-Za-z0-9_-]*'
scope: variable.parameter.less
- match: '\b(?:when|not|and|@import|@plugin|@media|@arguments)\b'
scope: keyword.control.less
- match: '\b{{property}}(?=\s*:)'
scope: entity.other.attribute-name.less
- match: '[#.:%]?[A-Za-z_][A-Za-z0-9_-]*(?=\s*[{,])'
scope: entity.name.tag.less
- match: '#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})\b'
scope: support.constant.color.less
- match: '\b(?:0x[0-9A-Fa-f_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:px|rem|em|vh|vw|%)?)\b'
scope: constant.numeric.less
- match: '[-+*/=<>!]+'
scope: keyword.operator.less
comments:
- match: '//.*$'
scope: comment.line.double-slash.less
- match: '/\*'
push: block-comment
block-comment:
- meta_scope: comment.block.less
- match: '/\*'
push: block-comment
- match: '\*/'
pop: true
strings:
- match: '"'
push: double-quoted-string
- match: "'"
push: single-quoted-string
double-quoted-string:
- meta_scope: string.quoted.double.less
- match: '\\.'
scope: constant.character.escape.less
- match: '"'
pop: true
single-quoted-string:
- meta_scope: string.quoted.single.less
- match: '\\.'
scope: constant.character.escape.less
- match: "'"
pop: true