" Vim syntax file " Language: Stylus " Maintainer: Marc Harter " Filenames: *.styl, *.stylus " Based On: Tim Pope (sass.vim) if exists("b:current_syntax") finish endif runtime! syntax/css.vim " Author: Hsiaoming Young (sopheryoung@gmail.com) " CSS3 Syntax Adapted From: CSS3.vim - http://www.vim.org/scripts/script.php?script_id=3042 syn keyword cssTagName article aside audio bb canvas command datagrid syn keyword cssTagName datalist details dialog embed figure footer syn keyword cssTagName header hgroup keygen mark meter nav output syn keyword cssTagName progress time ruby rt rp section time video syn keyword cssCommonAttr contained contenteditable contextmenu draggable hidden item syn keyword cssCommonAttr contained itemprop list subject spellcheck syn match cssUIProp contained "\" syn match cssUIProp contained "\" syn match cssUIProp contained "\" syn keyword cssUIProp contained resize outline syn keyword cssCommonAttr contained columns syn match cssCommonAttr contained "\" syn match cssCommonAttr contained "\" syn match cssCommonAttr contained "\" syn match cssBoxProp "\" contained syn match cssBoxProp "\<\(box-shadow\)\>" contained syn match cssUIProp contained "\<\(transform\)\>" syn match cssUIProp contained "\<\(transition\)\>" syn keyword cssColorProp contained opacity syn match cssTextAttr contained "\" syn match cssColorProp contained "\" syn match cssTextProp contained "\" syn match cssTextProp contained "\" syn match cssTextProp contained "\" syn match cssBoxProp contained "\" syn match cssBoxProp contained "\" syn match cssBoxProp contained "\" " end CSS3 support syn case ignore syn region cssInclude start="@import" end="\n" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType syn cluster stylusCssSelectors contains=cssTagName,cssSelector.*,cssIdentifier,cssAttributeSelector,cssPseudo.*,cssClassName syn cluster stylusCssAttributes contains=css.*Attr,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp syn region stylusDefinition matchgroup=cssBraces start="{" end="}" contains=TOP " syn match stylusProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=stylusCssAttribute contained containedin=stylusDefinition syn match stylusProperty "^\s*\%([[:alnum:]-]\+\)" contains=css.*Prop skipwhite nextgroup=stylusCssAttribute syn match stylusVariableAssignment "\%([[:alnum:]_-]\+\s*\)\@<==" nextgroup=stylusCssAttribute,stylusVariable skipwhite syn match stylusCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@stylusCssAttributes,stylusFunction,stylusVariable,stylusControl,stylusUserFunction syn match stylusUserFunction "^\s*\%([[:alnum:]_-]\+\)(\@=" syn match stylusUserFunction "\<\%([^)]*\)\>(\@=" contained syn match stylusFunction "\<\%(red\|green\|blue\|alpha\|dark\|light\)\>(\@=" contained syn match stylusFunction "\<\%(hue\|saturation\|lightness\|push\|unshift\|typeof\|unit\|match\)\>(\@=" contained syn match stylusFunction "\<\%(hsla\|hsl\|rgba\|rgb\|lighten\|darken\)\>(\@=" contained syn match stylusFunction "\<\%(abs\|ceil\|floor\|round\|min\|max\|even\|odd\|sum\|avg\|sin\|cos\|join\)\>(\@=" contained syn match stylusFunction "\<\%(desaturate\|saturate\|unquote\|quote\|s\)\>(\@=" contained syn match stylusFunction "\<\%(operate\|length\|warn\|error\|last\|p\|\)\>(\@=" contained syn match stylusFunction "\<\%(opposite-position\|image-size\|add-property\)\>(\@=" contained syn keyword stylusVariable null true false arguments syn keyword stylusControl if else unless for in return syn keyword stylusTodo FIXME NOTE TODO OPTIMIZE XXX contained syn region stylusComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=stylusTodo,@Spell fold syn region stylusCssComment start="/\*" end="\*/" contains=stylusTodo,@Spell fold hi def link stylusCssComment Comment hi def link stylusComment Comment hi def link stylusTodo Todo hi def link stylusVariable Identifier hi def link stylusControl PreProc hi def link stylusUserFunction PreProc hi def link stylusFunction Function let b:current_syntax = "stylus" " vim:set sw=2: