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