xref: /vim-8.2.3635/runtime/syntax/css.vim (revision 01a6c216)
1" Vim syntax file
2" Language:     Cascading Style Sheets
3" Previous Contributor List:
4"               Claudio Fleiner <[email protected]> (Maintainer)
5"               Yeti            (Add full CSS2, HTML4 support)
6"               Nikolai Weibull (Add CSS2 support)
7" URL:          https://github.com/JulesWang/css.vim
8" Maintainer:   Jules Wang      <[email protected]>
9" Last Change:  2018 Feb. 27
10"               cssClassName updated by Ryuichi Hayashida Jan 2016
11
12" quit when a syntax file was already loaded
13if !exists("main_syntax")
14  if exists("b:current_syntax")
15    finish
16  endif
17  let main_syntax = 'css'
18elseif exists("b:current_syntax") && b:current_syntax == "css"
19  finish
20endif
21
22let s:cpo_save = &cpo
23set cpo&vim
24
25syn case ignore
26
27" HTML4 tags
28syn keyword cssTagName abbr address area a b base
29syn keyword cssTagName bdo blockquote body br button
30syn keyword cssTagName caption cite code col colgroup dd del
31syn keyword cssTagName dfn div dl dt em fieldset form
32syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i
33syn keyword cssTagName iframe input ins isindex kbd label legend li
34syn keyword cssTagName link map menu meta noscript ol optgroup
35syn keyword cssTagName option p param pre q s samp script small
36syn keyword cssTagName span strong sub sup tbody td
37syn keyword cssTagName textarea tfoot th thead title tr ul u var
38syn keyword cssTagName object svg
39syn match   cssTagName /\<select\>\|\<style\>\|\<table\>/
40
41" 34 HTML5 tags
42syn keyword cssTagName article aside audio bdi canvas command data
43syn keyword cssTagName datalist details dialog embed figcaption figure footer
44syn keyword cssTagName header hgroup keygen main mark menuitem meter nav
45syn keyword cssTagName output progress rt rp ruby section
46syn keyword cssTagName source summary time track video wbr
47
48" Tags not supported in HTML5
49" acronym applet basefont big center dir
50" font frame frameset noframes strike tt
51
52syn match cssTagName "\*"
53
54" selectors
55syn match cssSelectorOp "[,>+~]"
56syn match cssSelectorOp2 "[~|^$*]\?=" contained
57syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
58
59" .class and #id
60syn match cssClassName "\.-\=[A-Za-z_][A-Za-z0-9_-]*" contains=cssClassNameDot
61syn match cssClassNameDot contained '\.'
62
63try
64syn match cssIdentifier "#[A-Za-z�-�_@][A-Za-z�-�0-9_@-]*"
65catch /^.*/
66syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*"
67endtry
68
69" digits
70syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
71syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
72syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators
73syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=%" contains=cssUnitDecorators
74syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators
75syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators
76syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators
77
78" The 16 basic color names
79syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
80
81" 130 more color names
82syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
83syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
84syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
85syn match cssColor contained /\<dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/
86syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/
87syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/
88syn match cssColor contained /\<dark\(turquoise\|violet\)\>/
89syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
90syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
91syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
92syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
93syn keyword cssColor contained lemonchiffon limegreen linen magenta
94syn match cssColor contained /\<light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)\>/
95syn match cssColor contained /\<light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/
96syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/
97syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/
98syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/
99syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
100syn keyword cssColor contained oldlace olivedrab orange orangered orchid
101syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
102syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
103syn keyword cssColor contained rosybrown royalblue rebeccapurple saddlebrown salmon
104syn keyword cssColor contained sandybrown seagreen seashell sienna skyblue slateblue
105syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
106syn keyword cssColor contained thistle tomato turquoise violet wheat
107syn keyword cssColor contained whitesmoke yellowgreen
108
109" FIXME: These are actually case-insensitive too, but (a) specs recommend using
110" mixed-case (b) it's hard to highlight the word `Background' correctly in
111" all situations
112syn case match
113syn 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
114syn case ignore
115
116syn match cssImportant contained "!\s*important\>"
117
118syn match cssColor contained "\<transparent\>"
119syn match cssColor contained "\<currentColor\>"
120syn match cssColor contained "\<white\>"
121syn match cssColor contained "#\x\{3,4\}\>" contains=cssUnitDecorators
122syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators
123syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators
124
125syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
126syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline  contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
127syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline  contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
128syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline  contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
129syn 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 contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
130syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at
131syn match cssFunctionComma contained ","
132
133" Common Prop and Attr
134syn keyword cssCommonAttr contained auto none inherit all default normal
135syn keyword cssCommonAttr contained top bottom center stretch hidden visible
136"------------------------------------------------
137" CSS Animations
138" http://www.w3.org/TR/css3-animations/
139syn match cssAnimationProp contained "\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>"
140
141" animation-direction attributes
142syn keyword cssAnimationAttr contained alternate reverse
143syn match cssAnimationAttr contained "\<alternate-reverse\>"
144
145" animation-fill-mode attributes
146syn keyword cssAnimationAttr contained forwards backwards both
147
148" animation-play-state attributes
149syn keyword cssAnimationAttr contained running paused
150
151" animation-iteration-count attributes
152syn keyword cssAnimationAttr contained infinite
153"------------------------------------------------
154"  CSS Backgrounds and Borders Module Level 3
155"  http://www.w3.org/TR/css3-background/
156syn match cssBackgroundProp contained "\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>"
157" background-attachment attributes
158syn keyword cssBackgroundAttr contained scroll fixed local
159
160" background-position attributes
161syn keyword cssBackgroundAttr contained left center right top bottom
162
163" background-repeat attributes
164syn match cssBackgroundAttr contained "\<no-repeat\>"
165syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
166
167" background-size attributes
168syn keyword cssBackgroundAttr contained cover contain
169
170syn match cssBorderProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>"
171syn match cssBorderProp contained "\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>"
172syn match cssBorderProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>"
173syn match cssBorderProp contained "\<box-decoration-break\>"
174syn match cssBorderProp contained "\<box-shadow\>"
175
176" border-image attributes
177syn keyword cssBorderAttr contained stretch round fill
178
179" border-style attributes
180syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset
181
182" border-width attributes
183syn keyword cssBorderAttr contained thin thick medium
184
185" box-decoration-break attributes
186syn keyword cssBorderAttr contained clone slice
187"------------------------------------------------
188
189syn match cssBoxProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>"
190syn match cssBoxProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>"
191syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>"
192syn match cssBoxProp contained "\<rotation\(-point\)\=\>"
193syn keyword cssBoxAttr contained visible hidden scroll auto
194syn match cssBoxAttr contained "\<no-\(display\|content\)\>"
195
196syn keyword cssColorProp contained opacity
197syn match cssColorProp contained "\<color-profile\>"
198syn match cssColorProp contained "\<rendering-intent\>"
199
200
201syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
202syn keyword cssDimensionProp contained height
203syn keyword cssDimensionProp contained width
204
205" CSS Flexible Box Layout Module Level 1
206" http://www.w3.org/TR/css3-flexbox/
207" CSS Box Alignment Module Level 3
208" http://www.w3.org/TR/css-align-3/
209syn match cssFlexibleBoxProp contained "\<flex\(-\(direction\|wrap\|flow\|grow\|shrink\|basis\)\)\=\>"
210syn match cssFlexibleBoxProp contained "\<\(align\|justify\)\(-\(items\|self\|content\)\)\=\>"
211syn keyword cssFlexibleBoxProp contained order
212
213syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>"
214syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center
215syn match cssFlexibleBoxAttr contained "\<flex\(-\(start\|end\)\)\=\>"
216syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\)\)\=\>"
217
218" CSS Fonts Module Level 3
219" http://www.w3.org/TR/css-fonts-3/
220syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>"
221
222" font attributes
223syn keyword cssFontAttr contained icon menu caption
224syn match cssFontAttr contained "\<message-box\>"
225syn match cssFontAttr contained "\<status-bar\>"
226syn keyword cssFontAttr contained larger smaller
227syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
228syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
229" font-family attributes
230syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
231syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf
232syn keyword cssFontAttr contained cursive fantasy monospace
233" font-feature-settings attributes
234syn keyword cssFontAttr contained on off
235" font-stretch attributes
236syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
237" font-style attributes
238syn keyword cssFontAttr contained italic oblique
239" font-synthesis attributes
240syn keyword cssFontAttr contained weight style
241" font-weight attributes
242syn keyword cssFontAttr contained bold bolder lighter
243" TODO: font-variant-* attributes
244"------------------------------------------------
245
246" Webkit specific property/attributes
247syn match cssFontProp contained "\<font-smooth\>"
248syn match cssFontAttr contained "\<\(subpixel-\)\=\antialiased\>"
249
250
251" CSS Multi-column Layout Module
252" http://www.w3.org/TR/css3-multicol/
253syn match cssMultiColumnProp contained "\<break-\(after\|before\|inside\)\>"
254syn match cssMultiColumnProp contained "\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>"
255syn keyword cssMultiColumnProp contained columns
256syn keyword cssMultiColumnAttr contained balance medium
257syn keyword cssMultiColumnAttr contained always left right page column
258syn match cssMultiColumnAttr contained "\<avoid\(-\(page\|column\)\)\=\>"
259
260" http://www.w3.org/TR/css3-break/#page-break
261syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
262
263" http://www.w3.org/TR/SVG11/interact.html
264syn match cssInteractProp contained "\<pointer-events\>"
265syn match cssInteractAttr contained "\<\(visible\)\=\(Painted\|Fill\|Stroke\)\=\>"
266
267" TODO find following items in w3c docs.
268syn keyword cssGeneratedContentProp contained quotes crop
269syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
270syn match cssGeneratedContentProp contained "\<move-to\>"
271syn match cssGeneratedContentProp contained "\<page-policy\>"
272syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
273
274" https://www.w3.org/TR/css-grid-1/
275syn match cssGridProp contained "\<grid\>"
276syn match cssGridProp contained "\<grid\(-\(template\|auto\)\)\=\(-\(columns\|rows\|areas\)\)\>"
277syn match cssGridProp contained "\<grid-\(column\|row\)\(-\(start\|end\|gap\)\)\=\>"
278syn match cssGridProp contained "\<grid-\(area\|gap\)\>"
279syn match cssGridProp contained "\<grid-auto-flow\>"
280
281syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
282
283syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
284syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
285syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
286syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
287syn keyword cssListAttr contained disc circle square hebrew armenian georgian
288syn keyword cssListAttr contained inside outside
289
290syn keyword cssPositioningProp contained bottom clear clip display float left
291syn keyword cssPositioningProp contained position right top visibility
292syn match cssPositioningProp contained "\<z-index\>"
293syn keyword cssPositioningAttr contained block compact grid
294syn match cssPositioningAttr contained "\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
295syn keyword cssPositioningAttr contained left right both
296syn match cssPositioningAttr contained "\<list-item\>"
297syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\|grid\|flex\)\)\=\>"
298syn keyword cssPositioningAttr contained static relative absolute fixed subgrid
299
300syn keyword cssPrintAttr contained landscape portrait crop cross always
301
302syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>"
303syn keyword cssTableAttr contained fixed collapse separate show hide once always
304
305
306syn keyword cssTextProp contained color direction
307syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
308syn match cssTextProp contained "\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>"
309syn match cssTextProp contained "\<word-\(break\|\wrap\)\>"
310syn match cssTextProp contained "\<white-space\>"
311syn match cssTextProp contained "\<hanging-punctuation\>"
312syn match cssTextProp contained "\<punctuation-trim\>"
313syn match cssTextAttr contained "\<line-through\>"
314syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>"
315syn keyword cssTextAttr contained ltr rtl embed nowrap
316syn keyword cssTextAttr contained underline overline blink sub super middle
317syn keyword cssTextAttr contained capitalize uppercase lowercase
318syn keyword cssTextAttr contained justify baseline sub super
319syn keyword cssTextAttr contained optimizeLegibility optimizeSpeed
320syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>"
321syn match cssTextAttr contained "\<\(allow\|force\)-end\>"
322syn keyword cssTextAttr contained start end adjacent
323syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>"
324syn keyword cssTextAttr contained distribute kashida first last
325syn keyword cssTextAttr contained clip ellipsis unrestricted suppress
326syn match cssTextAttr contained "\<break-all\>"
327syn match cssTextAttr contained "\<break-word\>"
328syn keyword cssTextAttr contained hyphenate
329syn match cssTextAttr contained "\<bidi-override\>"
330
331syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>"
332syn match cssTransformProp contained "\<perspective\(-origin\)\=\>"
333syn match cssTransformProp contained "\<backface-visibility\>"
334
335" CSS Transitions
336" http://www.w3.org/TR/css3-transitions/
337syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>"
338
339" transition-time-function attributes
340syn match cssTransitionAttr contained "\<linear\(-gradient\)\@!\>"
341syn match cssTransitionAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>"
342syn match cssTransitionAttr contained "\<step\(-start\|-end\)\=\>"
343"------------------------------------------------
344" CSS Basic User Interface Module Level 3 (CSS3 UI)
345" http://www.w3.org/TR/css3-ui/
346syn match cssUIProp contained "\<box-sizing\>"
347syn match cssUIAttr contained "\<\(content\|padding\|border\)\(-box\)\=\>"
348
349syn keyword cssUIProp contained cursor
350syn match cssUIAttr contained "\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>"
351syn keyword cssUIAttr contained crosshair help move pointer alias copy
352syn keyword cssUIAttr contained progress wait text cell move
353syn match cssUIAttr contained "\<context-menu\>"
354syn match cssUIAttr contained "\<no-drop\>"
355syn match cssUIAttr contained "\<not-allowed\>"
356syn match cssUIAttr contained "\<all-scroll\>"
357syn match cssUIAttr contained "\<\(vertical-\)\=text\>"
358syn match cssUIAttr contained "\<zoom\(-in\|-out\)\=\>"
359
360syn match cssUIProp contained "\<ime-mode\>"
361syn keyword cssUIAttr contained active inactive disabled
362
363syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>"
364syn match cssUIProp contained "\<outline\(-\(width\|style\|color\|offset\)\)\=\>"
365syn keyword cssUIAttr contained invert
366
367syn keyword cssUIProp contained icon resize
368syn keyword cssUIAttr contained both horizontal vertical
369
370syn match cssUIProp contained "\<text-overflow\>"
371syn keyword cssUIAttr contained clip ellipsis
372
373syn match cssUIProp contained "\<image-rendering\>"
374syn keyword cssUIAttr contained pixellated
375syn match cssUIAttr contained "\<crisp-edges\>"
376
377"------------------------------------------------
378" Webkit/iOS specific attributes
379syn match cssUIAttr contained '\<preserve-3d\>'
380" IE specific attributes
381syn match cssIEUIAttr contained '\<bicubic\>'
382
383" Webkit/iOS specific properties
384syn match cssUIProp contained '\<tap-highlight-color\|user-select\|touch-callout\>'
385" IE specific properties
386syn match cssIEUIProp contained '\<interpolation-mode\|zoom\|filter\>'
387
388" Webkit/Firebox specific properties/attributes
389syn keyword cssUIProp contained appearance
390syn keyword cssUIAttr contained window button field icon document menu
391
392
393syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>"
394syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>"
395syn keyword cssAuralProp contained volume during azimuth elevation stress richness
396syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>"
397syn keyword cssAuralAttr contained silent
398syn match cssAuralAttr contained "\<spell-out\>"
399syn keyword cssAuralAttr contained non mix
400syn match cssAuralAttr contained "\<\(left\|right\)-side\>"
401syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>"
402syn keyword cssAuralAttr contained leftwards rightwards behind
403syn keyword cssAuralAttr contained below level above lower higher
404syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\|low\|high\)\>"
405syn keyword cssAuralAttr contained faster slower
406syn keyword cssAuralAttr contained male female child code digits continuous
407
408" mobile text
409syn match cssMobileTextProp contained "\<text-size-adjust\>"
410
411syn keyword cssMediaProp contained width height orientation scan grid
412syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
413syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
414syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
415syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
416syn keyword cssMediaAttr contained portrait landscape progressive interlace
417syn match cssKeyFrameProp /\d*%\|from\|to/  contained nextgroup=cssDefinition
418syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition
419syn keyword cssPageProp contained content size
420syn keyword cssPageProp contained orphans widows
421syn keyword cssFontDescriptorProp contained src
422syn match cssFontDescriptorProp contained "\<unicode-range\>"
423" unicode-range attributes
424syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
425syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
426
427syn match cssBraces contained "[{}]"
428syn match cssError contained "{@<>"
429syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssAttributeSelector,cssClassName,cssIdentifier,cssAtRule,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold
430syn match cssBraceError "}"
431syn match cssAttrComma ","
432
433" Pseudo class
434" http://www.w3.org/TR/css3-selectors/
435syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
436syn keyword cssPseudoClassId contained link visited active hover before after left right
437syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid
438syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
439syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>"
440syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")"
441" ------------------------------------
442" Vendor specific properties
443syn match cssPseudoClassId contained  "\<selection\>"
444syn match cssPseudoClassId contained  "\<focus\(-inner\)\=\>"
445syn match cssPseudoClassId contained  "\<\(input-\)\=placeholder\>"
446
447" Misc highlight groups
448syntax match cssUnitDecorators /\(#\|-\|+\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
449syntax match cssNoise contained /\(:\|;\|\/\)/
450
451" Comment
452syn region cssComment start="/\*" end="\*/" contains=@Spell fold
453
454syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
455syn match cssSpecialCharQQ +\\\\\|\\"+ contained
456syn match cssSpecialCharQ +\\\\\|\\'+ contained
457syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ
458syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
459
460" Vendor Prefix
461syn match cssVendor contained "-\(webkit\|moz\|o\|ms\)-"
462
463" Various CSS Hack characters
464" In earlier versions of IE (6 and 7), one can prefix property names
465" with a _ or * to isolate those definitions to particular versions of IE
466" This is purely decorative and therefore we assign to the same highlight
467" group to cssVendor, for more information:
468" http://www.paulirish.com/2009/browser-specific-css-hacks/
469syn match cssHacks contained /\(_\|*\)/
470
471" Attr Enhance
472" Some keywords are both Prop and Attr, so we have to handle them
473syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
474
475" Hack for transition
476" 'transition' has Props after ':'.
477syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
478
479syn match cssAtKeyword /@\(font-face\|media\|keyframes\|import\|charset\|namespace\|page\|supports\)/ contained
480
481syn keyword cssAtRuleLogical only not and contained
482
483" @media
484" Reference: http://www.w3.org/TR/css3-mediaqueries/
485syn region cssAtRule start=/@media\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssComment nextgroup=cssDefinition
486syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained
487
488" @page
489" http://www.w3.org/TR/css3-page/
490syn region cssAtRule start=/@page\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssPagePseudo,cssComment nextgroup=cssDefinition
491syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl
492" @keyframe
493" http://www.w3.org/TR/css3-animations/#keyframes
494syn region cssAtRule start=/@\(-[a-z]\+-\)\=keyframes\>/ end=/\ze{/ skipwhite skipnl matchgroup=cssAtKeyword contains=cssVendor,cssComment nextgroup=cssDefinition
495
496syn region cssAtRule start=/@import\>/    end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword,cssURL,cssMediaProp,cssValueLength,cssAtRuleLogical,cssValueInteger,cssMediaAttr,cssMediaType
497syn region cssAtRule start=/@charset\>/   end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword
498syn region cssAtRule start=/@namespace\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssAtKeyword
499
500" @font-face
501" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
502syn match cssAtRule "@font-face\>" nextgroup=cssFontDescriptorBlock
503" @supports
504" https://www.w3.org/TR/css3-conditional/#at-supports
505syn region cssAtRule start=/@supports\>/ end=/\ze{/ skipwhite skipnl contains=cssAtRuleLogical,cssAttrRegion,css.*Prop,cssValue.*,cssVendor,cssAtKeyword,cssComment nextgroup=cssDefinition
506
507
508if main_syntax == "css"
509  syn sync minlines=10
510endif
511
512" Define the default highlighting.
513" Only when an item doesn't have highlighting yet
514
515hi def link cssComment Comment
516hi def link cssVendor Comment
517hi def link cssHacks Comment
518hi def link cssTagName Statement
519hi def link cssDeprecated Error
520hi def link cssSelectorOp Special
521hi def link cssSelectorOp2 Special
522hi def link cssAttrComma Special
523
524hi def link cssAnimationProp cssProp
525hi def link cssBackgroundProp cssProp
526hi def link cssBorderProp cssProp
527hi def link cssBoxProp cssProp
528hi def link cssColorProp cssProp
529hi def link cssContentForPagedMediaProp cssProp
530hi def link cssDimensionProp cssProp
531hi def link cssFlexibleBoxProp cssProp
532hi def link cssFontProp cssProp
533hi def link cssGeneratedContentProp cssProp
534hi def link cssGridProp cssProp
535hi def link cssHyerlinkProp cssProp
536hi def link cssInteractProp cssProp
537hi def link cssLineboxProp cssProp
538hi def link cssListProp cssProp
539hi def link cssMarqueeProp cssProp
540hi def link cssMultiColumnProp cssProp
541hi def link cssPagedMediaProp cssProp
542hi def link cssPositioningProp cssProp
543hi def link cssPrintProp cssProp
544hi def link cssRubyProp cssProp
545hi def link cssSpeechProp cssProp
546hi def link cssTableProp cssProp
547hi def link cssTextProp cssProp
548hi def link cssTransformProp cssProp
549hi def link cssTransitionProp cssProp
550hi def link cssUIProp cssProp
551hi def link cssIEUIProp cssProp
552hi def link cssAuralProp cssProp
553hi def link cssRenderProp cssProp
554hi def link cssMobileTextProp cssProp
555
556hi def link cssAnimationAttr cssAttr
557hi def link cssBackgroundAttr cssAttr
558hi def link cssBorderAttr cssAttr
559hi def link cssBoxAttr cssAttr
560hi def link cssContentForPagedMediaAttr cssAttr
561hi def link cssDimensionAttr cssAttr
562hi def link cssFlexibleBoxAttr cssAttr
563hi def link cssFontAttr cssAttr
564hi def link cssGeneratedContentAttr cssAttr
565hi def link cssGridAttr cssAttr
566hi def link cssHyerlinkAttr cssAttr
567hi def link cssInteractAttr cssAttr
568hi def link cssLineboxAttr cssAttr
569hi def link cssListAttr cssAttr
570hi def link cssMarginAttr cssAttr
571hi def link cssMarqueeAttr cssAttr
572hi def link cssMultiColumnAttr cssAttr
573hi def link cssPaddingAttr cssAttr
574hi def link cssPagedMediaAttr cssAttr
575hi def link cssPositioningAttr cssAttr
576hi def link cssGradientAttr cssAttr
577hi def link cssPrintAttr cssAttr
578hi def link cssRubyAttr cssAttr
579hi def link cssSpeechAttr cssAttr
580hi def link cssTableAttr cssAttr
581hi def link cssTextAttr cssAttr
582hi def link cssTransformAttr cssAttr
583hi def link cssTransitionAttr cssAttr
584hi def link cssUIAttr cssAttr
585hi def link cssIEUIAttr cssAttr
586hi def link cssAuralAttr cssAttr
587hi def link cssRenderAttr cssAttr
588hi def link cssCommonAttr cssAttr
589
590hi def link cssPseudoClassId PreProc
591hi def link cssPseudoClassLang Constant
592hi def link cssValueLength Number
593hi def link cssValueInteger Number
594hi def link cssValueNumber Number
595hi def link cssValueAngle Number
596hi def link cssValueTime Number
597hi def link cssValueFrequency Number
598hi def link cssFunction Constant
599hi def link cssURL String
600hi def link cssFunctionName Function
601hi def link cssFunctionComma Function
602hi def link cssColor Constant
603hi def link cssIdentifier Function
604hi def link cssAtRule Include
605hi def link cssAtKeyword PreProc
606hi def link cssImportant Special
607hi def link cssBraces Function
608hi def link cssBraceError Error
609hi def link cssError Error
610hi def link cssUnicodeEscape Special
611hi def link cssStringQQ String
612hi def link cssStringQ String
613hi def link cssAttributeSelector String
614hi def link cssMediaType Special
615hi def link cssMediaComma Normal
616hi def link cssAtRuleLogical Statement
617hi def link cssMediaProp cssProp
618hi def link cssMediaAttr cssAttr
619hi def link cssPagePseudo PreProc
620hi def link cssPageMarginProp cssAtKeyword
621hi def link cssPageProp cssProp
622hi def link cssKeyFrameProp Constant
623hi def link cssFontDescriptor Special
624hi def link cssFontDescriptorProp cssProp
625hi def link cssFontDescriptorAttr cssAttr
626hi def link cssUnicodeRange Constant
627hi def link cssClassName Function
628hi def link cssClassNameDot Function
629hi def link cssProp StorageClass
630hi def link cssAttr Constant
631hi def link cssUnitDecorators Number
632hi def link cssNoise Noise
633
634let b:current_syntax = "css"
635
636if main_syntax == 'css'
637  unlet main_syntax
638endif
639
640let &cpo = s:cpo_save
641unlet s:cpo_save
642" vim: ts=8
643
644