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