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