forked from hawx/sass.sugar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SASS-new.xml
159 lines (134 loc) · 4.41 KB
/
SASS-new.xml
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
<?xml version="1.0"?>
<syntax name="styling.sass">
<zones>
<include collection="at-rules"/>
<include collection="variables"/>
<include collection="mixins"/>
<include collection="comments"/>
<include collection="style-lists"/>
</zones>
<library>
<collection name="at-rules">
<zone name="at-rule.import">
<starts-with>
<expression>^\s*((@)import\b)</expression>
<capture number="1" name="keyword.control"/>
<capture number="2" name="punctuation.definition.keyword"/>
</starts-with>
<ends-with>
<expression>$</expression>
<capture number="0" name="punctuation.definition.end"/>
</ends-with>
</zone>
</collection>
<!--
This is meant to match a list of styles belonging to one selector, eg.
p
border: 1px solid red
background: aqua
-->
<collection name="style-lists">
<zone name="style-list">
<!-- begins with #, ., &, >, or a letter -->
<starts-with>^\s*(?=([.#&>a-zA-Z]))</starts-with>
<!-- ends with a blank line (not exactly the best way of finding the end) -->
<ends-with>^\s*\n</ends-with>
<subzones>
<include collection="selectors"/>
<include collection="properties"/>
<include collection="comments"/>
</subzones>
</zone>
</collection>
<!--
Selectors can be any of the following...
#somestring
.somestring
somestring
&somestring
somestring:somestring
+somestring
somestring[somestring=somestring] or with quotes or double quotes
*
-->
<collection name="selectors">
<zone name="selector">
<expression>((\+|#|\.|&)?[a-zA-Z0-9_:\[\]='"-]+|\*)</expression>
</zone>
</collection>
<!--
The property name is before a : and the value anything after it, eg.
border: 12px
name: value
There may be multiple values also possibly separated with a comma.
border: 12px solid red, 10px solid blue
-->
<collection name="properties">
<zone name="property-name">
<expression>(?=[a-z-])[a-z-]*(?=:)</expression>
</zone>
<zone name="property-value">
<starts-with>
<expression>(:)(?=\s*)</expression>
<capture number="0" name="punctuation.seperator.key-value"/>
</starts-with>
<ends-with>
<expression>\n</expression>
</ends-with>
</zone>
</collection>
<collection name="values">
</collection>
<!--
A comment is any line that begins with // or any text surrounded by
/* and */
-->
<collection name="comments">
<zone name="comment.block">
<starts-with>
<expression>/\*</expression>
<capture number="0" name="punctuation.begin"/>
</starts-with>
<ends-with>
<expression>^\s*(?!\*)$</expression>
<capture number="0" name="punctuation.end"/>
</ends-with>
</zone>
</collection>
<!--
A mixin is either +somestring with optional arguments followed by properties
or @mixin somestring with optional arguments followed by properties
-->
<collection name="mixins">
<zone name="mixin.definition">
<expression>(\=|@mixin\s+)([a-zA-Z0-9_-]+)(\(.*\))?$</expression>
</zone>
<zone name="mixin">
<expression>(\+|@include\s+)([a-zA-Z0-9_-]+)(\(.*\))?$</expression>
</zone>
</collection>
<!--
A variable is $somestring and is defined with $somestring: values
-->
<collection name="variables">
<zone name="variable.definition">
<starts-with>
<expression>(\$)(.+)(?=:)</expression>
<capture number="1" name="punctuation.variable"/>
<capture number="2" name="variable.property-name"/>
</starts-with>
<ends-with>
<expression>$</expression>
</ends-with>
<subzones>
<include collection="values"/>
</subzones>
</zone>
<zone name="variable">
<expression>(\$)([a-zA-Z0-9_-]+)</expression>
<capture number="1" name="punctuation.variable"/>
<capture number="2" name="variable.property-name"/>
</zone>
</collection>
</library>
</syntax>