Highlight css unit correctly

This commit is contained in:
leafOfTree
2019-09-10 15:49:00 +08:00
parent 1b8cd0795e
commit 137dad488c

View File

@@ -181,7 +181,8 @@ else
endif endif
" Style " Style
" Redefine syn-region to color <style> correctly. " Redefine (less|sass)Definition to highlight <style> correctly and
" enable emmet-vim css type.
if s:use_less if s:use_less
syntax clear lessDefinition syntax clear lessDefinition
syntax region cssLessDefinition matchgroup=cssBraces contains=@LessSyntax syntax region cssLessDefinition matchgroup=cssBraces contains=@LessSyntax
@@ -195,6 +196,12 @@ if s:use_sass
\ start="{" end="}" \ start="{" end="}"
endif endif
" Highlight css unit correctly
syntax clear cssUnitDecorators
syntax match cssUnitDecorator
\ /\(#\|-\|+\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)\ze\(;\|$\)/
\ containedin=cssAttrRegion,sassCssAttribute,lessCssAttribute
" Coffee " Coffee
if s:use_coffee if s:use_coffee
silent! syntax clear coffeeConstant silent! syntax clear coffeeConstant