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