forked from svitalij/sciter.tm.syntax
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SciterSelectors.YAML-tmLanguage
59 lines (55 loc) · 2.07 KB
/
SciterSelectors.YAML-tmLanguage
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
scopeName: source.sciter.selectors
name: Sciter CSS Selectors
fileTypes:
-
uuid: cccd98df-a526-4251-82a2-3908400ca427
hideFromUser: true
patterns:
- include: '#selector'
repository:
selector:
patterns:
- include: '#attribute-selector'
- include: '#class-selector'
- include: '#id-selector'
- include: '#simple-pseudo-class-selector'
- include: '#after-before'
- include: '#not-selector'
- include: '#child-selector'
attribute-selector:
begin: '\['
end: '\]'
name: entity.name.selector
class-selector:
match: '\.[\w-]+'
name: entity.name.selector
id-selector:
match: '\#[\w-]+'
name: entity.name.selector
simple-pseudo-class-selector:
# keep in sync with #property-value
match: '(:)(first-child|last-child|link|visited|active|hover|focus|tab-focus|focusable|current|checked|disabled|read-only|expanded|collapsed|incomplete|busy|empty|has-children(-of-type)?|has-child(-of-type)?|animating|popup|owns-popup|synthetic|drop-target|drag-over|moving|copying|drag-source|rtl|ltr|invalid|drop-marker|content-editable|node|root)'
name: entity.name.selector
after-before:
match: '(::)(after|before)'
name: entity.name.selector
not-selector:
begin: '\s*(:not)\s*(\()\s*'
beginCaptures:
'1': { name: keyword.control.c }
'2': { name: punctuation.section.function.css }
end: '\s*(\))\s*'
endCaptures:
'1': { name: punctuation.section.function.css}
patterns:
- include: '#selector'
child-selector:
begin: '\s*(:(?:nth-child|nth-last-child|only-child|only-of-type|has-child-of-type|has-children-of-type))\s*(\()\s*'
beginCaptures:
'1': { name: keyword.control.c }
'2': { name: punctuation.section.function.css }
end: '\s*(\))\s*'
endCaptures:
'1': { name: punctuation.section.function.css}
patterns:
- include: '#selector'