Skip to content

Commit

Permalink
nesting selector CSS optimization support
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Sep 20, 2024
1 parent aa55127 commit 5fa57bd
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -83,6 +83,8 @@ function bundleCss(body, url, compilation) {
optimizedCss += `#${name}`;
} else if (type === 'ClassSelector') {
optimizedCss += `.${name}`;
} else if (type === 'NestingSelector') {
optimizedCss += '&';
} else if (type === 'PseudoClassSelector') {
optimizedCss += `:${name}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ h2 ::slotted(span){background:silver}

tabbed-custom-element::part(tab){color:#0c0dcc;border-bottom:transparent solid 2px;}

::highlight(rainbow-color-1){color:#ad26ad;text-decoration:underline;}
::highlight(rainbow-color-1){color:#ad26ad;text-decoration:underline;}

h2{& span{color:red}}
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,10 @@ tabbed-custom-element::part(tab) {
::highlight(rainbow-color-1) {
color: #ad26ad;
text-decoration: underline;
}

h2 {
& span {
color: red;
}
}

0 comments on commit 5fa57bd

Please sign in to comment.