7
|
1 " Vim syntax file
|
3830
|
2 " Language: Cascading Style Sheets
|
|
3 " Previous Contributor List:
|
|
4 " Claudio Fleiner <claudio@fleiner.com> (Maintainer)
|
|
5 " Yeti (Add full CSS2, HTML4 support)
|
|
6 " Nikolai Weibull (Add CSS2 support)
|
|
7 " Maintainer: Jules Wang <w.jq0722@gmail.com>
|
3893
|
8 " URL: https://github.com/JulesWang/css.vim
|
5239
|
9 " Last Change: 2013 Jul 23
|
7
|
10
|
|
11 " For version 5.x: Clear all syntax items
|
|
12 " For version 6.x: Quit when a syntax file was already loaded
|
|
13 if !exists("main_syntax")
|
|
14 if version < 600
|
|
15 syntax clear
|
|
16 elseif exists("b:current_syntax")
|
5239
|
17 finish
|
|
18 endif
|
|
19 let main_syntax = 'css'
|
|
20 elseif exists("b:current_syntax") && b:current_syntax == "css"
|
7
|
21 finish
|
|
22 endif
|
|
23
|
3854
|
24 let s:cpo_save = &cpo
|
|
25 set cpo&vim
|
|
26
|
7
|
27 syn case ignore
|
|
28
|
3830
|
29 " All HTML4 tags
|
7
|
30 syn keyword cssTagName abbr acronym address applet area a b base
|
|
31 syn keyword cssTagName basefont bdo big blockquote body br button
|
|
32 syn keyword cssTagName caption center cite code col colgroup dd del
|
|
33 syn keyword cssTagName dfn dir div dl dt em fieldset font form frame
|
|
34 syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i
|
|
35 syn keyword cssTagName iframe img input ins isindex kbd label legend li
|
|
36 syn keyword cssTagName link map menu meta noframes noscript ol optgroup
|
|
37 syn keyword cssTagName option p param pre q s samp script select small
|
3830
|
38 syn keyword cssTagName span strike strong style sub sup table tbody td
|
7
|
39 syn keyword cssTagName textarea tfoot th thead title tr tt ul u var
|
3830
|
40 syn keyword cssTagName object
|
|
41
|
|
42 " HTML5 new tags 5*6=30
|
|
43 syn keyword cssTagName article aside audio bdi canvas command
|
|
44 syn keyword cssTagName datalist details embed figcaption figure footer
|
|
45 syn keyword cssTagName header hgroup keygen mark meter nav
|
|
46 syn keyword cssTagName output progress rt rp ruby section
|
|
47 syn keyword cssTagName source summary time track video wbr
|
|
48
|
|
49 " Tags not supported in HTML5
|
|
50 syn keyword cssDeprecated acronym applet basefont big center dir
|
|
51 syn keyword cssDeprecated font frame frameset noframes strike tt
|
|
52
|
|
53 "syn match cssTagName "\<table\>"
|
7
|
54 syn match cssTagName "\*"
|
|
55
|
3830
|
56 " selectors
|
|
57 syn match cssSelectorOp "[,>+]"
|
|
58 syn match cssSelectorOp2 "[~|^$*]\?=" contained
|
|
59 " FIXME: add HTML5 attribute
|
|
60 syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
|
7
|
61
|
3830
|
62 " .class and #id
|
|
63 syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+"
|
7
|
64
|
557
|
65 try
|
36
|
66 syn match cssIdentifier "#[A-Za-zĄ-’_@][A-Za-zĄ-’0-9_@-]*"
|
557
|
67 catch /^.*/
|
|
68 syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*"
|
|
69 endtry
|
|
70
|
3830
|
71 syn match cssTagName "@page\>" nextgroup=cssDefinition
|
|
72 " FIXME: use cssVendor here
|
|
73 syn match cssTagName "@\(-\(webkit\|moz\|o\|ms\)-\)\=keyframes\>" nextgroup=cssDefinition
|
7
|
74
|
|
75 syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl
|
|
76 syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl
|
3830
|
77 "syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl
|
7
|
78 syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssError,cssComment,cssDefinition,cssURL,cssUnicodeEscape,cssIdentifier
|
|
79
|
|
80 syn match cssValueInteger contained "[-+]\=\d\+"
|
|
81 syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\="
|
3830
|
82 syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\)"
|
7
|
83 syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)"
|
|
84 syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)"
|
|
85 syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)"
|
|
86
|
|
87 syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
|
|
88 syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr
|
|
89 syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>"
|
|
90 syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline
|
|
91 syn keyword cssFontDescriptorAttr contained all
|
|
92 syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
|
|
93 syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+"
|
|
94 syn match cssUnicodeRange contained "U+\x\+-\x\+"
|
|
95
|
3893
|
96 " The 16 basic color names
|
7
|
97 syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
|
3893
|
98
|
|
99 " 130 more color names
|
|
100 syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
|
|
101 syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
|
|
102 syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
|
|
103 syn match cssColor contained /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/
|
|
104 syn match cssColor contained /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/
|
|
105 syn match cssColor contained /darkslate\(blue\|gray\|grey\)/
|
|
106 syn match cssColor contained /dark\(turquoise\|violet\)/
|
|
107 syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
|
|
108 syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
|
|
109 syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
|
|
110 syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
|
|
111 syn keyword cssColor contained lemonchiffon limegreen linen magenta
|
|
112 syn match cssColor contained /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/
|
|
113 syn match cssColor contained /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/
|
|
114 syn match cssColor contained /light\(slategray\|slategrey\|steelblue\)/
|
|
115 syn match cssColor contained /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/
|
|
116 syn match cssColor contained /medium\(slateblue\|springgreen\|turquoise\|violetred\)/
|
|
117 syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
|
|
118 syn keyword cssColor contained oldlace olivedrab orange orangered orchid
|
|
119 syn match cssColor contained /pale\(goldenrod\|green\|turquoise\|violetred\)/
|
|
120 syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
|
|
121 syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
|
|
122 syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
|
|
123 syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
|
|
124 syn keyword cssColor contained thistle tomato turquoise violet wheat
|
|
125 syn keyword cssColor contained whitesmoke yellowgreen
|
|
126
|
7
|
127 " FIXME: These are actually case-insentivie too, but (a) specs recommend using
|
|
128 " mixed-case (b) it's hard to highlight the word `Background' correctly in
|
|
129 " all situations
|
|
130 syn case match
|
|
131 syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background
|
|
132 syn case ignore
|
3830
|
133
|
|
134 syn match cssImportant contained "!\s*important\>"
|
|
135
|
7
|
136 syn match cssColor contained "\<transparent\>"
|
|
137 syn match cssColor contained "\<white\>"
|
|
138 syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>"
|
|
139 syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>"
|
|
140
|
3830
|
141 syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" oneline keepend
|
|
142 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\)\s*(" end=")" oneline keepend
|
|
143 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\)\s*(" end=")" oneline keepend
|
|
144 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear\|radial\)-gradient\s*(" end=")" oneline keepend
|
|
145 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y|\Z\)\=\|translate\(3d\|X\|Y|\Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y|\Z\)\=\|perspective\)\s*(" end=")" oneline keepend
|
7
|
146
|
3830
|
147 " Prop and Attr
|
|
148 " Reference: http://www.w3schools.com/cssref/default.asp
|
|
149 syn keyword cssCommonAttr contained auto none inherit all
|
7
|
150 syn keyword cssCommonAttr contained top bottom
|
|
151 syn keyword cssCommonAttr contained medium normal
|
|
152
|
3830
|
153
|
|
154 syn match cssAnimationProp contained "\<animation\(-\(name\|duration\|timing-function\|delay\|iteration-cout\|play-state\)\)\=\>"
|
|
155
|
|
156
|
|
157 syn keyword cssAnimationAttr contained infinite alternate paused running
|
|
158 " bugfix: escape linear-gradient
|
|
159 syn match cssAnimationAttr contained "\<linear\(-gradient\)\@!\>"
|
|
160 syn match cssAnimationAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>"
|
|
161
|
|
162 syn match cssBackgroundProp contained "\<background\(-\(color\|image\|attachment\|position\|clip\|origin\|size\)\)\=\>"
|
|
163 syn keyword cssBackgroundAttr contained center fixed over contain
|
|
164 syn match cssBackgroundAttr contained "\<no-repeat\>"
|
|
165 syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
|
|
166 syn match cssBackgroundAttr contained "\<\(border\|content\|padding\)-box\>"
|
|
167
|
|
168
|
|
169 syn match cssBorderOutlineProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>"
|
|
170 syn match cssBorderOutlineProp contained "\<outline\(-\(width\|style\|color\)\)\=\>"
|
|
171 syn match cssBorderOutlineProp contained "\<border-\(top\|bottom\)-\(left\|right\)\(-radius\)\=\>"
|
|
172 syn match cssBorderOutlineProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>"
|
|
173 syn match cssBorderOutlineProp contained "\<border-radius\>"
|
|
174 syn keyword cssBorderOutlineAttr contained thin thick medium
|
|
175 syn keyword cssBorderOutlineAttr contained dotted dashed solid double groove ridge inset outset
|
|
176 syn keyword cssBorderOutlineAttr contained hidden visible scroll collapse
|
|
177 syn keyword cssBorderOutlineAttr contained stretch round
|
|
178
|
|
179
|
|
180 syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>"
|
|
181 syn match cssBoxProp contained "\<rotation\(-point\)=\>"
|
|
182 syn keyword cssBoxAttr contained visible hidden scroll auto
|
|
183 syn match cssBoxAttr contained "\<no-\(display\|content\)\>"
|
|
184
|
|
185 syn keyword cssColorProp contained opacity
|
|
186 syn match cssColorProp contained "\<color-profile\>"
|
|
187 syn match cssColorProp contained "\<rendering-intent\>"
|
|
188
|
|
189
|
|
190 syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
|
|
191 syn keyword cssDimensionProp contained height
|
|
192 syn keyword cssDimensionProp contained width
|
|
193
|
|
194 " shadow and sizing are in other property groups
|
|
195 syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
|
|
196 syn keyword cssFlexibleBoxAttr contained start end center baseline stretch
|
|
197 syn keyword cssFlexibleBoxAttr contained normal reverse
|
|
198 syn keyword cssFlexibleBoxAttr contained single mulitple
|
|
199 syn keyword cssFlexibleBoxAttr contained horizontal
|
|
200 " bugfix: escape vertial-align
|
|
201 syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>"
|
|
202 syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
|
|
203
|
|
204
|
2421
|
205 syn match cssFontProp contained "\<font\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\)\=\>"
|
7
|
206 syn match cssFontAttr contained "\<\(sans-\)\=\<serif\>"
|
2421
|
207 syn match cssFontAttr contained "\<small\(-\(caps\|caption\)\)\=\>"
|
7
|
208 syn match cssFontAttr contained "\<x\{1,2\}-\(large\|small\)\>"
|
|
209 syn match cssFontAttr contained "\<message-box\>"
|
|
210 syn match cssFontAttr contained "\<status-bar\>"
|
|
211 syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\|status-bar\)-\)\=\(condensed\|expanded\)\>"
|
|
212 syn keyword cssFontAttr contained cursive fantasy monospace italic oblique
|
3830
|
213 syn keyword cssFontAttr contained bold bolder light lighter larger smaller
|
|
214 syn keyword cssFontAttr contained icon menu caption
|
|
215 syn keyword cssFontAttr contained large smaller larger narrower wider
|
|
216 syn keyword cssFontAttr contained Courier Arial Georgia Times
|
|
217
|
|
218
|
|
219 syn keyword cssGeneratedContentProp contained content quotes crop
|
|
220 syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
|
|
221 syn match cssGeneratedContentProp contained "\<move-to\>"
|
|
222 syn match cssGeneratedContentProp contained "\<page-policy\>"
|
|
223 syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
|
|
224
|
|
225
|
|
226 syn match cssGridProp contained "\<grid-\(columns\|rows\)\>"
|
|
227
|
|
228 syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
|
|
229
|
|
230 syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
|
|
231 syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
|
|
232 syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
|
|
233 syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
|
|
234 syn keyword cssListAttr contained disc circle square hebrew armenian georgian
|
|
235 syn keyword cssListAttr contained inside outside
|
|
236
|
|
237
|
|
238 syn match cssMarginProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>"
|
|
239
|
|
240 syn match cssMultiColumnProp contained "\<column\(-\(\break-\(after\|before\)\|count\|gap\|rule\(-\(color\|style\|width\)\)\=\)\|span\|width\)\=\>"
|
7
|
241
|
3830
|
242
|
|
243 syn match cssPaddingProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>"
|
|
244
|
|
245 syn keyword cssPositioningProp contained bottom clear clip display float left
|
|
246 syn keyword cssPositioningProp contained position right top visibility
|
|
247 syn match cssPositioningProp contained "\<z-index\>"
|
|
248 syn keyword cssPositioningAttr contained block inline compact
|
|
249 syn match cssPositioningAttr contained "\<table\(-\(row-gorup\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
|
|
250 syn keyword cssPositioningAttr contained left right both
|
|
251 syn match cssPositioningAttr contained "\<list-item\>"
|
|
252 syn match cssPositioningAttr contained "\<inline-\(block\|table\)\>"
|
|
253 syn keyword cssPositioningAttr contained static relative absolute fixed
|
7
|
254
|
3830
|
255 syn match cssPrintProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
|
|
256 syn keyword cssPrintProp contained orphans widows
|
|
257 syn keyword cssPrintAttr contained landscape portrait crop cross always avoid
|
|
258
|
|
259 syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>"
|
|
260 syn keyword cssTableAttr contained fixed collapse separate show hide once always
|
|
261
|
|
262
|
|
263 syn keyword cssTextProp contained color direction
|
7
|
264 syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
|
3830
|
265 syn match cssTextProp contained "\<text-\(justify\|\outline\|overflow\|warp\|align-last\)\>"
|
|
266 syn match cssTextProp contained "\<word-\(break\|\wrap\)\>"
|
|
267 syn match cssTextProp contained "\<white-space\>"
|
|
268 syn match cssTextProp contained "\<hanging-punctuation\>"
|
|
269 syn match cssTextProp contained "\<punctuation-trim\>"
|
7
|
270 syn match cssTextAttr contained "\<line-through\>"
|
|
271 syn match cssTextAttr contained "\<text-indent\>"
|
|
272 syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>"
|
3830
|
273 syn keyword cssTextAttr contained ltr rtl embed nowrap
|
7
|
274 syn keyword cssTextAttr contained underline overline blink sub super middle
|
3830
|
275 syn keyword cssTextAttr contained capitalize uppercase lowercase
|
|
276 syn keyword cssTextAttr contained center justify baseline sub super
|
|
277 syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>"
|
|
278 syn match cssTextAttr contained "\<\(allow\|force\)-end\>"
|
|
279 syn keyword cssTextAttr contained start end adjacent
|
|
280 syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>"
|
|
281 syn keyword cssTextAttr contained distribute kashida first last
|
|
282 syn keyword cssTextAttr contained clip ellipsis unrestricted suppress
|
|
283 syn match cssTextAttr contained "\<break-all\>"
|
|
284 syn match cssTextAttr contained "\<break-word\>"
|
|
285 syn keyword cssTextAttr contained hyphenate
|
7
|
286
|
3830
|
287
|
|
288 syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>"
|
|
289 syn match cssTransformProp contained "\<perspective\(-origin\)\=\>"
|
|
290 syn match cssTransformProp contained "\<backface-visibility\>"
|
7
|
291
|
3830
|
292 syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>"
|
7
|
293
|
3830
|
294 syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>"
|
|
295 syn match cssUIProp contained "\<outline-offset\>"
|
|
296 syn match cssUIProp contained "\<box-sizing\>"
|
|
297 syn keyword cssUIProp contained appearance icon resize
|
|
298 syn keyword cssUIAttr contained window button menu field
|
7
|
299
|
|
300 syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>"
|
|
301 syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numerals\)\)\=\)\>"
|
|
302 syn keyword cssAuralProp contained volume during azimuth elevation stress richness
|
|
303 syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>"
|
|
304 syn keyword cssAuralAttr contained silent
|
|
305 syn match cssAuralAttr contained "\<spell-out\>"
|
|
306 syn keyword cssAuralAttr contained non mix
|
|
307 syn match cssAuralAttr contained "\<\(left\|right\)-side\>"
|
|
308 syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>"
|
|
309 syn keyword cssAuralAttr contained leftwards rightwards behind
|
|
310 syn keyword cssAuralAttr contained below level above higher
|
|
311 syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\)\>"
|
|
312 syn keyword cssAuralAttr contained faster slower
|
|
313 syn keyword cssAuralAttr contained male female child code digits continuous
|
3830
|
314 syn match cssAuralAttr contained "\<lower\>"
|
7
|
315
|
3830
|
316 " cursor
|
|
317 syn keyword cssUIProp contained cursor
|
|
318 syn match cssUIAttr contained "\<[ns]\=[ew]\=-resize\>"
|
|
319 syn keyword cssUIAttr contained crosshair default help move pointer
|
|
320 syn keyword cssUIAttr contained progress wait
|
|
321
|
|
322 " FIXME: I could not find them in reference
|
|
323 syn keyword cssUIAttr contained invert maker size zoom
|
|
324 syn match cssRenderAttr contained "\<run-in\>"
|
|
325 syn match cssRenderAttr contained "\<text-rendering\>"
|
|
326 syn match cssRenderAttr contained "\<font-smoothing\>"
|
|
327 syn match cssRenderProp contained "\<marker-offset\>"
|
|
328 syn match cssRenderAttr contained "\<bidi-override\>"
|
|
329
|
7
|
330
|
|
331 " FIXME: This allows cssMediaBlock before the semicolon, which is wrong.
|
|
332 syn region cssInclude start="@import" end=";" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
|
|
333 syn match cssBraces contained "[{}]"
|
|
334 syn match cssError contained "{@<>"
|
3830
|
335 syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition
|
7
|
336 syn match cssBraceError "}"
|
|
337
|
3830
|
338 " Pseudo class
|
3224
|
339 syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssPseudoClassId,cssUnicodeEscape
|
3830
|
340 syn keyword cssPseudoClassId link visited active hover focus before after left right lang
|
7
|
341 syn match cssPseudoClassId contained "\<first\(-\(line\|letter\|child\)\)\=\>"
|
3830
|
342 " FIXME: handle functions.
|
|
343 "syn region cssPseudoClassLang matchgroup=cssPseudoClassId start="lang(" end=")"
|
|
344 syn match cssPseudoClassId contained "\<\(last\|only\|nth\|nth-last\)-child\>"
|
|
345 syn match cssPseudoClassId contained "\<\(first\|last\|only\|nth\|nth-last\)-of-type\>"
|
|
346 syn keyword cssPseudoClassId root empty target enable disabled checked not invalid
|
|
347 syn match cssPseudoClassId contained "::\(-moz-\)\=selection"
|
7
|
348
|
3830
|
349 " Comment
|
1285
|
350 syn region cssComment start="/\*" end="\*/" contains=@Spell
|
3830
|
351 syn region cssComment start="//" skip="\\$" end="$" keepend contains=@Spell
|
7
|
352
|
|
353 syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
|
|
354 syn match cssSpecialCharQQ +\\"+ contained
|
|
355 syn match cssSpecialCharQ +\\'+ contained
|
|
356 syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ
|
|
357 syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
|
3830
|
358
|
|
359 " Vendor Prefix
|
|
360 syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)"
|
|
361
|
7
|
362
|
|
363 if main_syntax == "css"
|
|
364 syn sync minlines=10
|
|
365 endif
|
|
366
|
|
367 " Define the default highlighting.
|
|
368 " For version 5.7 and earlier: only when not done already
|
|
369 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
370 if version >= 508 || !exists("did_css_syn_inits")
|
|
371 if version < 508
|
|
372 let did_css_syn_inits = 1
|
|
373 command -nargs=+ HiLink hi link <args>
|
|
374 else
|
|
375 command -nargs=+ HiLink hi def link <args>
|
|
376 endif
|
|
377
|
|
378 HiLink cssComment Comment
|
3830
|
379 HiLink cssVendor Comment
|
7
|
380 HiLink cssTagName Statement
|
3830
|
381 HiLink cssDeprecated Error
|
7
|
382 HiLink cssSelectorOp Special
|
|
383 HiLink cssSelectorOp2 Special
|
3830
|
384
|
|
385 HiLink cssAnimationProp StorageClass
|
|
386 HiLink cssBackgroundProp StorageClass
|
|
387 HiLink cssBorderOutlineProp StorageClass
|
|
388 HiLink cssBoxProp StorageClass
|
|
389 HiLink cssColorProp StorageClass
|
|
390 HiLink cssContentForPagedMediaProp StorageClass
|
|
391 HiLink cssDimensionProp StorageClass
|
|
392 HiLink cssFlexibleBoxProp StorageClass
|
7
|
393 HiLink cssFontProp StorageClass
|
3830
|
394 HiLink cssGeneratedContentProp StorageClass
|
|
395 HiLink cssGridProp StorageClass
|
|
396 HiLink cssHyerlinkProp StorageClass
|
|
397 HiLink cssLineboxProp StorageClass
|
|
398 HiLink cssListProp StorageClass
|
|
399 HiLink cssMarginProp StorageClass
|
|
400 HiLink cssMarqueeProp StorageClass
|
|
401 HiLink cssMultiColumnProp StorageClass
|
|
402 HiLink cssPaddingProp StorageClass
|
|
403 HiLink cssPagedMediaProp StorageClass
|
|
404 HiLink cssPositioningProp StorageClass
|
|
405 HiLink cssPrintProp StorageClass
|
|
406 HiLink cssRubyProp StorageClass
|
|
407 HiLink cssSpeechProp StorageClass
|
|
408 HiLink cssTableProp StorageClass
|
7
|
409 HiLink cssTextProp StorageClass
|
3830
|
410 HiLink cssTransformProp StorageClass
|
|
411 HiLink cssTransitionProp StorageClass
|
|
412 HiLink cssUIProp StorageClass
|
7
|
413 HiLink cssAuralProp StorageClass
|
|
414 HiLink cssRenderProp StorageClass
|
3830
|
415
|
|
416 HiLink cssAnimationAttr Type
|
|
417 HiLink cssBackgroundAttr Type
|
|
418 HiLink cssBorderOutlineAttr Type
|
7
|
419 HiLink cssBoxAttr Type
|
3830
|
420 HiLink cssColorAttr Type
|
|
421 HiLink cssContentForPagedMediaAttr Type
|
|
422 HiLink cssDimensionAttr Type
|
|
423 HiLink cssFlexibleBoxAttr Type
|
|
424 HiLink cssFontAttr Type
|
7
|
425 HiLink cssGeneratedContentAttr Type
|
3830
|
426 HiLink cssGridAttr Type
|
|
427 HiLink cssHyerlinkAttr Type
|
|
428 HiLink cssLineboxAttr Type
|
|
429 HiLink cssListAttr Type
|
|
430 HiLink cssMarginAttr Type
|
|
431 HiLink cssMarqueeAttr Type
|
|
432 HiLink cssMultiColumnAttr Type
|
|
433 HiLink cssPaddingAttr Type
|
|
434 HiLink cssPagedMediaAttr Type
|
|
435 HiLink cssPositioningAttr Type
|
|
436 HiLink cssPrintAttr Type
|
|
437 HiLink cssRubyAttr Type
|
|
438 HiLink cssSpeechAttr Type
|
7
|
439 HiLink cssTableAttr Type
|
3830
|
440 HiLink cssTextAttr Type
|
|
441 HiLink cssTransformAttr Type
|
|
442 HiLink cssTransitionAttr Type
|
7
|
443 HiLink cssUIAttr Type
|
3830
|
444 HiLink cssAuralAttr Type
|
|
445 HiLink cssRenderAttr Type
|
7
|
446 HiLink cssCommonAttr Type
|
3830
|
447
|
7
|
448 HiLink cssPseudoClassId PreProc
|
|
449 HiLink cssPseudoClassLang Constant
|
|
450 HiLink cssValueLength Number
|
|
451 HiLink cssValueInteger Number
|
|
452 HiLink cssValueNumber Number
|
|
453 HiLink cssValueAngle Number
|
|
454 HiLink cssValueTime Number
|
|
455 HiLink cssValueFrequency Number
|
|
456 HiLink cssFunction Constant
|
|
457 HiLink cssURL String
|
|
458 HiLink cssFunctionName Function
|
|
459 HiLink cssColor Constant
|
|
460 HiLink cssIdentifier Function
|
|
461 HiLink cssInclude Include
|
|
462 HiLink cssImportant Special
|
|
463 HiLink cssBraces Function
|
|
464 HiLink cssBraceError Error
|
|
465 HiLink cssError Error
|
|
466 HiLink cssInclude Include
|
|
467 HiLink cssUnicodeEscape Special
|
|
468 HiLink cssStringQQ String
|
|
469 HiLink cssStringQ String
|
|
470 HiLink cssMedia Special
|
|
471 HiLink cssMediaType Special
|
|
472 HiLink cssMediaComma Normal
|
|
473 HiLink cssFontDescriptor Special
|
|
474 HiLink cssFontDescriptorFunction Constant
|
|
475 HiLink cssFontDescriptorProp StorageClass
|
|
476 HiLink cssFontDescriptorAttr Type
|
|
477 HiLink cssUnicodeRange Constant
|
1285
|
478 HiLink cssClassName Function
|
7
|
479 delcommand HiLink
|
|
480 endif
|
|
481
|
|
482 let b:current_syntax = "css"
|
|
483
|
|
484 if main_syntax == 'css'
|
|
485 unlet main_syntax
|
|
486 endif
|
|
487
|
3854
|
488 let &cpo = s:cpo_save
|
|
489 unlet s:cpo_save
|
7
|
490 " vim: ts=8
|
|
491
|