Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion syntax/css.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
" Nikolai Weibull (Add CSS2 support)
" URL: https://github.com/vim-language-dept/css-syntax.vim
" Maintainer: Jay Sitter <jay@jaysitter.com>
" Last Change: 2024 Nov 12
" Last Change: 2025 Nov 07

" quit when a syntax file was already loaded
if !exists("main_syntax")
Expand Down Expand Up @@ -193,7 +193,14 @@ syn keyword cssBorderAttr contained thin thick medium

" box-decoration-break attributes
syn keyword cssBorderAttr contained clone slice

"------------------------------------------------
" CSS Masking Module Level 1
" https://www.w3.org/TR/css-masking-1/
syn match cssMaskProp contained "\<mask\(-\(image\|mode\|repeat\|position\|clip\|origin\|size\|composite\|type\)\)\=\>"
syn keyword cssMaskAttr contained none luminance alpha match-source
syn keyword cssMaskAttr contained add subtract intersect exclude
syn keyword cssMaskAttr contained fill-box stroke-box view-box no-clip

syn match cssBoxProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>"
syn match cssBoxProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>"
Expand Down Expand Up @@ -657,6 +664,8 @@ hi def link cssProp StorageClass
hi def link cssAttr Constant
hi def link cssUnitDecorators Number
hi def link cssNoise Noise
hi def link cssMaskProp cssProp
hi def link cssMaskAttr cssAttr

let b:current_syntax = "css"

Expand Down
27 changes: 27 additions & 0 deletions test.css
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,30 @@ and (max-device-width:1024px)
background-position-x: 20px;
background-position-y: 20px;
}

/* mask properties tests */
#mask-test {
mask: url('{!URLFOR($Resource.images)}/mask.png') no-repeat 50% 50% / contain, linear-gradient(black,transparent);
mask: none;
mask-image: url('{!URLFOR($Resource.images)}/mask.png'), linear-gradient(black, transparent);
mask-image: linear-gradient(black, transparent);
mask-mode: none;
mask-mode: alpha;
mask-mode: match-source;
mask-position: top;
mask-position: bottom;
mask-position: center;
mask-size: cover;
mask-repeat: repeat-x;
mask-origin: content-box;
mask-composite: add;
mask-composite: subtract;
mask-composite: intersect;
mask-composite: exclude;
mask-type: luminance;
mask-clip: padding-box;
mask-clip: fill-box;
mask-clip: stroke-box;
mask-clip: view-box;
mask-clip: no-clip;
}