Highlight new style Sass variables

This commit is contained in:
Tim Pope
2010-07-22 16:07:00 -04:00
parent 30405bd751
commit c583d3a236

View File

@@ -16,11 +16,12 @@ syn cluster sassCssAttributes contains=css.*Attr,cssComment,cssValue.*,cssColor,
syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant,sassFunction syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassVariable,sassFunction
syn match sassDefault "!default\>" contained syn match sassDefault "!default\>" contained
syn match sassConstant "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+" syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+"
syn match sassConstant "$[[:alnum:]_-]\+" syn match sassVariable "$[[:alnum:]_-]\+"
syn match sassConstantAssignment "\%([!$][[:alnum:]_]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite
syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite
syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained
syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained
@@ -47,8 +48,8 @@ syn match sassAmpersand "&"
" TODO: Arithmetic (including strings and concatenation) " TODO: Arithmetic (including strings and concatenation)
syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
syn region sassDebugLine matchgroup=sassDebug start="@debug\>" end="$" contains=@sassCssAttributes,sassConstant,sassFunction syn region sassDebugLine matchgroup=sassDebug start="@debug\>" end="$" contains=@sassCssAttributes,sassVariable,sassFunction
syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="$" contains=sassFor,@sassCssAttributes,sassConstant,sassFunction syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction
syn keyword sassFor from to through contained syn keyword sassFor from to through contained
syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained
@@ -58,7 +59,7 @@ syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sa
hi def link sassCssComment sassComment hi def link sassCssComment sassComment
hi def link sassComment Comment hi def link sassComment Comment
hi def link sassDefault cssImportant hi def link sassDefault cssImportant
hi def link sassConstant Identifier hi def link sassVariable Identifier
hi def link sassFunction Function hi def link sassFunction Function
hi def link sassMixing PreProc hi def link sassMixing PreProc
hi def link sassMixin PreProc hi def link sassMixin PreProc