Philip H | 2d919d2 | 2024-05-01 18:42:11 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Stylus |
| 3 | " Maintainer: Hsiaoming Yang <lepture@me.com>, Marc Harter |
| 4 | " Filenames: *.styl, *.stylus |
| 5 | " Based On: Tim Pope (sass.vim) |
| 6 | " Created: Dec 14, 2011 |
zeertzjq | 0b74eec | 2024-05-28 14:23:41 +0800 | [diff] [blame] | 7 | " Modified: May 28, 2024 |
Philip H | 2d919d2 | 2024-05-01 18:42:11 +0200 | [diff] [blame] | 8 | |
| 9 | syn case ignore |
| 10 | |
| 11 | syn cluster stylusCssSelectors contains=cssTagName,cssSelector,cssPseudo |
| 12 | syn cluster stylusCssValues contains=cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency,cssColorVal,cssCommonVal,cssFontVal,cssListVal,cssTextVal,cssVisualVal,cssBorderVal,cssBackgroundVal,cssFuncVal,cssAdvancedVal |
| 13 | syn cluster stylusCssProperties contains=cssProp,cssBackgroundProp,cssTableProp,cssBorderProp,cssFontProp,cssColorProp,cssBoxProp,cssTextProp,cssListProp,cssVisualProp,cssAdvancedProp,cssCommonProp,cssSpecialProp |
| 14 | |
| 15 | syn match stylusVariable "$\?[[:alnum:]_-]\+" |
| 16 | syn match stylusVariableAssignment "\%([[:alnum:]_-]\+\s*\)\@<==" nextgroup=stylusCssAttribute,stylusVariable skipwhite |
| 17 | |
| 18 | syn match stylusProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute contained containedin=cssDefineBlock |
| 19 | syn match stylusProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+[ :]\|:[[:alnum:]-]\+\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute |
| 20 | syn match stylusProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute |
| 21 | |
| 22 | syn match stylusCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@stylusCssValues,cssImportant,stylusFunction,stylusVariable,stylusControl,stylusUserFunction,stylusInterpolation,cssString,stylusComment,cssComment |
| 23 | |
| 24 | syn match stylusInterpolation %{[[:alnum:]_-]\+}% |
| 25 | |
| 26 | syn match stylusFunction "\<\%(red\|green\|blue\|alpha\|dark\|light\)\>(\@=" contained |
| 27 | syn match stylusFunction "\<\%(hue\|saturation\|lightness\|push\|unshift\|typeof\|unit\|match\)\>(\@=" contained |
| 28 | syn match stylusFunction "\<\%(hsla\|hsl\|rgba\|rgb\|lighten\|darken\)\>(\@=" contained |
| 29 | syn match stylusFunction "\<\%(abs\|ceil\|floor\|round\|min\|max\|even\|odd\|sum\|avg\|sin\|cos\|join\)\>(\@=" contained |
| 30 | syn match stylusFunction "\<\%(desaturate\|saturate\|invert\|unquote\|quote\|s\)\>(\@=" contained |
| 31 | syn match stylusFunction "\<\%(operate\|length\|warn\|error\|last\|p\|\)\>(\@=" contained |
| 32 | syn match stylusFunction "\<\%(opposite-position\|image-size\|add-property\)\>(\@=" contained |
| 33 | |
| 34 | syn keyword stylusVariable null true false arguments |
| 35 | syn keyword stylusControl if else unless for in return |
| 36 | |
| 37 | syn match stylusImport "@\%(import\|require\)" nextgroup=stylusImportList |
| 38 | syn match stylusImportList "[^;]\+" contained contains=cssString.*,cssMediaType,cssURL |
| 39 | |
| 40 | syn match stylusAmpersand "&" |
| 41 | syn match stylusClass "[[:alnum:]_-]\+" contained |
| 42 | syn match stylusClassChar "\.[[:alnum:]_-]\@=" nextgroup=stylusClass |
| 43 | syn match stylusEscape "^\s*\zs\\" |
| 44 | syn match stylusId "[[:alnum:]_-]\+" contained |
| 45 | syn match stylusIdChar "#[[:alnum:]_-]\@=" nextgroup=stylusId |
| 46 | |
| 47 | syn region stylusComment start="//" end="$" contains=cssTodo,@Spell fold |
| 48 | |
| 49 | let b:current_syntax = "stylus" |
| 50 | |
| 51 | " vim:set sw=2: |