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