From 519acb02ecc2675c56864256419f1984890bd4ea Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Wed, 6 Jul 2016 09:23:39 +0900 Subject: [PATCH] Add css-color-4.vim See also: https://www.w3.org/TR/2016/WD-css-color-4-20160705/ --- after/syntax/css/css-color-4.vim | 4 ++++ after/syntax/css/css3-color.vim | 2 +- after/syntax/html.vim | 1 + test/test.css | 17 ++++++++++++++++- test/test.html | 18 +++++++++++++++++- 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 after/syntax/css/css-color-4.vim diff --git a/after/syntax/css/css-color-4.vim b/after/syntax/css/css-color-4.vim new file mode 100644 index 0000000..3d1472e --- /dev/null +++ b/after/syntax/css/css-color-4.vim @@ -0,0 +1,4 @@ +syn match cssColorProp contained "\" +syn keyword cssColor contained rebeccapurple +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(hwb\|lab\|lch\|gray\|color\|device-cmyk\|color-mod\=\)\s*(" end=")" oneline keepend +syn match cssFontDescriptor "@color-profile\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl diff --git a/after/syntax/css/css3-color.vim b/after/syntax/css/css3-color.vim index fcb55de..c4b0149 100644 --- a/after/syntax/css/css3-color.vim +++ b/after/syntax/css/css3-color.vim @@ -1,3 +1,3 @@ syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsla\=\)\s*(" end=")" oneline keepend syn keyword cssColorProp contained opacity -syn match cssColor contained "\" +syn match cssColor contained "\" diff --git a/after/syntax/html.vim b/after/syntax/html.vim index d889027..b68ee4f 100644 --- a/after/syntax/html.vim +++ b/after/syntax/html.vim @@ -5,6 +5,7 @@ syn include @htmlCss syntax/css/css-break-3.vim syn include @htmlCss syntax/css/css-cascade-3.vim syn include @htmlCss syntax/css/css-cascade-4.vim syn include @htmlCss syntax/css/css-content-3.vim +syn include @htmlCss syntax/css/css-color-4.vim syn include @htmlCss syntax/css/css-counter-styles-3.vim syn include @htmlCss syntax/css/css-device-adapt-1.vim syn include @htmlCss syntax/css/css-display-3.vim diff --git a/test/test.css b/test/test.css index 9a98c4f..5e6b870 100644 --- a/test/test.css +++ b/test/test.css @@ -90,7 +90,22 @@ .color { opacity: rgba(0, 0, 0, 1); display: hsla(0, 0, 0, 1); - display: currentColor; + display: currentcolor; +} + +@color-profile swopc { + src: url('http://example.org/swop-coated.icc'); +} + +.color-4 { + color-adjust: rebeccapurple; + display: hwb(120deg, 44%, 50%); + display: lab(1 2 3); + display: lch(4 5 6); + display: gray(50%); + display: color(swopc, 0 206 190 77); + display: device-cmyk(0, 81%, 81%, 30%); + display: color-mod(#112233 tint(50%)); } @supports (display: auto) or diff --git a/test/test.html b/test/test.html index 22e5592..b7127bf 100644 --- a/test/test.html +++ b/test/test.html @@ -108,7 +108,23 @@ .color { opacity: rgba(0, 0, 0, 1); display: hsla(0, 0, 0, 1); - display: currentColor; + display: currentcolor; +} + +