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