diff --git a/README.md b/README.md index 568ad9d..b9cfa97 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ HISTORY * Add Compositing and Blending Level 1 features * Add CSS Fonts Module Level 3 features * Add CSS Speech Module features + * Add Selectors Level 4 features * Split CSS Counter Styles Level 3 features from `css3-lists.vim` * Follow spec updates * Add missing values diff --git a/after/syntax/css/selectors4.vim b/after/syntax/css/selectors4.vim new file mode 100644 index 0000000..a5ae1f3 --- /dev/null +++ b/after/syntax/css/selectors4.vim @@ -0,0 +1,5 @@ +syn match cssSelectorOp "[|]" +syn match cssPseudoClassId contained "\<\(active\|valid\|invalid\)-drop-target\>" +syn match cssPseudoClassId contained "\" +syn match cssPseudoClassId contained "\" +syn region cssPseudoClassLang matchgroup=cssPseudoClassId start=":dir(" end=")" oneline diff --git a/after/syntax/html.vim b/after/syntax/html.vim index cd7df2f..bf4e67a 100644 --- a/after/syntax/html.vim +++ b/after/syntax/html.vim @@ -41,3 +41,4 @@ syn include @htmlCss syntax/css/css-text-3.vim syn include @htmlCss syntax/css/css-text-decor-3.vim syn include @htmlCss syntax/css/css-variables.vim syn include @htmlCss syntax/css/css-writing-modes-3.vim +syn include @htmlCss syntax/css/selectors4.vim diff --git a/test/test.css b/test/test.css index 29a72ce..439fba6 100644 --- a/test/test.css +++ b/test/test.css @@ -321,44 +321,54 @@ ruby-position: ruby-base-container; } -.selectors:not([DISABLED]), -.selectors:matches(:hover, :focus), -.selectors:any-link, -.selectors:local-link, -.selectors:local-link(0), -.selectors:target, -.selectors:scope, -.selectors:current, -.selectors:current(p, li, dt, dd), -.selectors:past, -.selectors:future, -.selectors:enabled, -.selectors:disabled, -.selectors:checked, -.selectors:indeterminate, -.selectors:default, -.selecors:in-range, -.selectors:out-of-range, -.selectors:required, -.selectors:optional, -.selectors:read-only, -.selectors:read-write, -.selectors:root, -.selectors:empty, -.selectors:nth-child(2n+1), -.selectors:last-child, -.selectors:nth-last-child(-n+2), -.selectors:only-child, -.selectors:first-of-type, -.selectors:nth-of-type(2n+1), -.selectors:last-of-type, -.selectors:nth-last-of-type(n+2), -.selectors:only-of-type, -.selectors:nth-match(2n+1), -.selectors:nth-last-match(-n+2), -.selectors:column(p, li, dt, dd), -.selectors:nth-column(2n+1), -.selectors:nth-last-column(-n+2) { +.selectors3:not([DISABLED]), +.selectors3:matches(:hover, :focus), +.selectors3:any-link, +.selectors3:local-link, +.selectors3:local-link(0), +.selectors3:target, +.selectors3:scope, +.selectors3:current, +.selectors3:current(p, li, dt, dd), +.selectors3:past, +.selectors3:future, +.selectors3:enabled, +.selectors3:disabled, +.selectors3:checked, +.selectors3:indeterminate, +.selectors3:default, +.selectors3:in-range, +.selectors3:out-of-range, +.selectors3:required, +.selectors3:optional, +.selectors3:read-only, +.selectors3:read-write, +.selectors3:root, +.selectors3:empty, +.selectors3:nth-child(2n+1), +.selectors3:last-child, +.selectors3:nth-last-child(-n+2), +.selectors3:only-child, +.selectors3:first-of-type, +.selectors3:nth-of-type(2n+1), +.selectors3:last-of-type, +.selectors3:nth-last-of-type(n+2), +.selectors3:only-of-type, +.selectors3:nth-match(2n+1), +.selectors3:nth-last-match(-n+2), +.selectors3:column(p, li, dt, dd), +.selectors3:nth-column(2n+1), +.selectors3:nth-last-column(-n+2) { + display: auto; +} + +foo | h1, +.selectors4:dir(ltr), +.selectors4:active-drop-target, +.selectors4:valid-drop-target, +.selectors4:invalid-drop-target, +.selectors4:placeholder-shown, +.selectors4:user-error { display: auto; } diff --git a/test/test.html b/test/test.html index 7d7515d..6d613c7 100644 --- a/test/test.html +++ b/test/test.html @@ -331,44 +331,54 @@ ruby-position: ruby-base-container; } - .selectors:not([DISABLED]), - .selectors:matches(:hover, :focus), - .selectors:any-link, - .selectors:local-link, - .selectors:local-link(0), - .selectors:target, - .selectors:scope, - .selectors:current, - .selectors:current(p, li, dt, dd), - .selectors:past, - .selectors:future, - .selectors:enabled, - .selectors:disabled, - .selectors:checked, - .selectors:indeterminate, - .selectors:default, - .selecors:in-range, - .selectors:out-of-range, - .selectors:required, - .selectors:optional, - .selectors:read-only, - .selectors:read-write, - .selectors:root, - .selectors:empty, - .selectors:nth-child(2n+1), - .selectors:last-child, - .selectors:nth-last-child(-n+2), - .selectors:only-child, - .selectors:first-of-type, - .selectors:nth-of-type(2n+1), - .selectors:last-of-type, - .selectors:nth-last-of-type(n+2), - .selectors:only-of-type, - .selectors:nth-match(2n+1), - .selectors:nth-last-match(-n+2), - .selectors:column(p, li, dt, dd), - .selectors:nth-column(2n+1), - .selectors:nth-last-column(-n+2) { + .selectors3:not([DISABLED]), + .selectors3:matches(:hover, :focus), + .selectors3:any-link, + .selectors3:local-link, + .selectors3:local-link(0), + .selectors3:target, + .selectors3:scope, + .selectors3:current, + .selectors3:current(p, li, dt, dd), + .selectors3:past, + .selectors3:future, + .selectors3:enabled, + .selectors3:disabled, + .selectors3:checked, + .selectors3:indeterminate, + .selectors3:default, + .selectors3:in-range, + .selectors3:out-of-range, + .selectors3:required, + .selectors3:optional, + .selectors3:read-only, + .selectors3:read-write, + .selectors3:root, + .selectors3:empty, + .selectors3:nth-child(2n+1), + .selectors3:last-child, + .selectors3:nth-last-child(-n+2), + .selectors3:only-child, + .selectors3:first-of-type, + .selectors3:nth-of-type(2n+1), + .selectors3:last-of-type, + .selectors3:nth-last-of-type(n+2), + .selectors3:only-of-type, + .selectors3:nth-match(2n+1), + .selectors3:nth-last-match(-n+2), + .selectors3:column(p, li, dt, dd), + .selectors3:nth-column(2n+1), + .selectors3:nth-last-column(-n+2) { + display: auto; + } + + foo | h1, + .selectors4:dir(ltr), + .selectors4:active-drop-target, + .selectors4:valid-drop-target, + .selectors4:invalid-drop-target, + .selectors4:placeholder-shown, + .selectors4:user-error { display: auto; }