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