Skip to content

Commit

Permalink
add support for optimizing CSS :has pseudo-selector
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed May 6, 2023
1 parent 3003f49 commit c472587
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 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,7 @@ function bundleCss(body, url, projectDirectory) {

switch (name) {

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

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,6 @@ 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}
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,8 @@ a[href*="greenwood"], a[href$=".pdf"] {
@styleset {
nice-style: 12;
}
}

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

0 comments on commit c472587

Please sign in to comment.