Skip to content

Commit

Permalink
add support for optimizing CSS :has / :is pseudo-selectors (#1107)
Browse files Browse the repository at this point in the history
* add support for optimizing CSS :has pseudo-selector

* add support for :is
  • Loading branch information
thescientist13 committed Nov 9, 2023
1 parent 9421882 commit 29cd2e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/cli/src/plugins/resource/plugin-standard-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function bundleCss(body, url, projectDirectory) {

switch (name) {

case 'is':
case 'has':
case 'lang':
case 'not':
case 'nth-child':
Expand Down Expand Up @@ -153,6 +155,8 @@ function bundleCss(body, url, projectDirectory) {
case 'PseudoClassSelector':
switch (node.name) {

case 'is':
case 'has':
case 'lang':
case 'not':
case 'nth-child':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,8 @@ a[href*='greenwood'],a[href$='.pdf']{color:orange}

@page {size:8.5in 9in;margin-top:4in;}

@font-feature-values Font One{@styleset {nice-style:12}}
@font-feature-values Font One{@styleset {nice-style:12}}

h1:has(+h2){margin:0 0 0.25rem 0}

:is(ol,ul,menu:unsupported) :is(ol,ul){color:green}
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,12 @@ a[href*="greenwood"], a[href$=".pdf"] {
@styleset {
nice-style: 12;
}
}

h1:has(+ h2) {
margin: 0 0 0.25rem 0;
}

:is(ol, ul, menu:unsupported) :is(ol, ul) {
color: green;
}

0 comments on commit 29cd2e4

Please sign in to comment.