comparison vendor/vim-syntax/css.vim @ 673:6cdd7d26260d

[vim] Update syntaxes and colors
author nanaya <me@nanaya.pro>
date Tue, 05 Apr 2022 13:55:06 +0900
parents c74dffea6a0a
children 78469331407e
comparison
equal deleted inserted replaced
672:2febdacae5b4 673:6cdd7d26260d
5 " Claudio Fleiner <claudio@fleiner.com> 5 " Claudio Fleiner <claudio@fleiner.com>
6 " Yeti (Add full CSS2, HTML4 support) 6 " Yeti (Add full CSS2, HTML4 support)
7 " Nikolai Weibull (Add CSS2 support) 7 " Nikolai Weibull (Add CSS2 support)
8 " URL: https://github.com/vim-language-dept/css-syntax.vim 8 " URL: https://github.com/vim-language-dept/css-syntax.vim
9 " Maintainer: Jay Sitter <jay@jaysitter.com> 9 " Maintainer: Jay Sitter <jay@jaysitter.com>
10 " Last Change: 2021 Oct 15 10 " Last Change: 2021 Oct 20
11 11
12 " quit when a syntax file was already loaded 12 " quit when a syntax file was already loaded
13 if !exists("main_syntax") 13 if !exists("main_syntax")
14 if exists("b:current_syntax") 14 if exists("b:current_syntax")
15 finish 15 finish
114 syn case match 114 syn case match
115 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 115 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
116 syn case ignore 116 syn case ignore
117 117
118 syn match cssImportant contained "!\s*important\>" 118 syn match cssImportant contained "!\s*important\>"
119 syn match cssCustomProp contained "--[a-zA-Z0-9-_]*" 119 syn match cssCustomProp contained "\<--[a-zA-Z0-9-_]*\>"
120 120
121 syn match cssColor contained "\<transparent\>" 121 syn match cssColor contained "\<transparent\>"
122 syn match cssColor contained "\<currentColor\>" 122 syn match cssColor contained "\<currentColor\>"
123 syn match cssColor contained "\<white\>" 123 syn match cssColor contained "\<white\>"
124 syn match cssColor contained "#\x\{3,4\}\>" contains=cssUnitDecorators 124 syn match cssColor contained "#\x\{3,4\}\>" contains=cssUnitDecorators
125 syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators 125 syn match cssColor contained "#\x\{6\}\>" contains=cssUnitDecorators
126 syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators 126 syn match cssColor contained "#\x\{8\}\>" contains=cssUnitDecorators
127 127
128 syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline 128 syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
129 syn region cssMathGroup contained matchgroup=cssMathParens start="(" end=")" containedin=cssFunction,cssMathGroup contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline
129 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline 130 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline
130 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma 131 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
131 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction 132 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
132 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\|conic-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma 133 syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\|conic-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
133 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 134 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
393 syn match cssUIAttr contained '\<preserve-3d\>' 394 syn match cssUIAttr contained '\<preserve-3d\>'
394 " IE specific attributes 395 " IE specific attributes
395 syn match cssIEUIAttr contained '\<bicubic\>' 396 syn match cssIEUIAttr contained '\<bicubic\>'
396 397
397 " Webkit/iOS specific properties 398 " Webkit/iOS specific properties
398 syn match cssUIProp contained '\<tap-highlight-color\|user-select\|touch-callout\>' 399 syn match cssUIProp contained '\<\(tap-highlight-color\|user-select\|touch-callout\)\>'
399 " IE specific properties 400 " IE specific properties
400 syn match cssIEUIProp contained '\<interpolation-mode\|zoom\|filter\>' 401 syn match cssIEUIProp contained '\<\(interpolation-mode\|zoom\|filter\)\>'
401 402
402 " Webkit/Firebox specific properties/attributes 403 " Webkit/Firebox specific properties/attributes
403 syn keyword cssUIProp contained appearance 404 syn keyword cssUIProp contained appearance
404 syn keyword cssUIAttr contained window button field icon document menu 405 syn keyword cssUIAttr contained window button field icon document menu
405 406
421 422
422 " mobile text 423 " mobile text
423 syn match cssMobileTextProp contained "\<text-size-adjust\>" 424 syn match cssMobileTextProp contained "\<text-size-adjust\>"
424 425
425 syn keyword cssMediaProp contained width height orientation scan 426 syn keyword cssMediaProp contained width height orientation scan
426 syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/ 427 syn keyword cssMediaProp contained any-hover any-pointer color-gamut grid hover
427 syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/ 428 syn keyword cssMediaProp contained overflow-block overflow-inline pointer update
428 syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/ 429 syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio\>/
429 syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ 430 syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-pixel-ratio\>/
431 syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=device-\(height\|width\)\>/
432 syn match cssMediaProp contained /\<\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)\>/
430 syn keyword cssMediaAttr contained portrait landscape progressive interlace 433 syn keyword cssMediaAttr contained portrait landscape progressive interlace
434 syn keyword cssMediaAttr contained coarse fast fine hover infinite p3 paged
435 syn keyword cssMediaAttr contained rec2020 scroll slow srgb
431 syn match cssKeyFrameProp contained /\(\d\+\(\.\d\+\)\?%\|\(\<from\|to\>\)\)/ nextgroup=cssDefinition 436 syn match cssKeyFrameProp contained /\(\d\+\(\.\d\+\)\?%\|\(\<from\|to\>\)\)/ nextgroup=cssDefinition
432 syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition 437 syn match cssPageMarginProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition
433 syn keyword cssPageProp contained content size 438 syn keyword cssPageProp contained content size
434 syn keyword cssPageProp contained orphans widows 439 syn keyword cssPageProp contained orphans widows
435 syn keyword cssFontDescriptorProp contained src 440 syn keyword cssFontDescriptorProp contained src
443 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 448 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
444 syn match cssBraceError "}" 449 syn match cssBraceError "}"
445 syn match cssAttrComma "," 450 syn match cssAttrComma ","
446 451
447 " Pseudo class 452 " Pseudo class
448 " http://www.w3.org/TR/css3-selectors/ 453 " https://www.w3.org/TR/selectors-4/
449 syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn 454 syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
450 syn keyword cssPseudoClassId contained link visited active hover before after left right 455 syn keyword cssPseudoClassId contained link visited active hover before after left right
451 syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid 456 syn keyword cssPseudoClassId contained root empty target enabled disabled checked invalid
452 syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>" 457 syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
453 syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>" 458 syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>"
454 syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ 459 syn match cssPseudoClassId contained "\<focus\(-within\|-visible\)\=\>"
460 syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|is\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")" contains=cssStringQ,cssStringQQ,cssTagName,cssAttributeSelector,cssClassName,cssIdentifier
455 " ------------------------------------ 461 " ------------------------------------
456 " Vendor specific properties 462 " Vendor specific properties
457 syn match cssPseudoClassId contained "\<selection\>" 463 syn match cssPseudoClassId contained "\<selection\>"
458 syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
459 syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>" 464 syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
460 465
461 " Misc highlight groups 466 " Misc highlight groups
462 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 467 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
463 syntax match cssNoise contained /\(:\|;\|\/\)/ 468 syntax match cssNoise contained /\(:\|;\|\/\)/