robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

robinmerge: 1dc9728daa1d8a2702

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