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