Skip to content

Commit

Permalink
bug/issue 1242 handle optimization ordering issue with functions in C…
Browse files Browse the repository at this point in the history
…SS declarations (#1243)

* handle optimization ordering issue with functions in CSS declarations

* remove extra comment
  • Loading branch information
thescientist13 committed Nov 2, 2024
1 parent 04fcfc0 commit 168d342
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/plugins/resource/plugin-standard-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function bundleCss(body, url, compilation) {
}
} else if (type === 'Function') {
/* ex: border-left: 3px solid var(--color-secondary); */
if (this.declaration && item.prev && item.prev.data.type === 'Identifier') {
if (this.declaration && item.prev && (item.prev.data.type !== 'Operator' && item.prev.data.type !== 'Url')) {
optimizedCss += ' ';
}
optimizedCss += `${name}(`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ a[href*='greenwood'],a[href$='.pdf']{color:orange}

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

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

.snippet{margin:var(--size-4) 0;padding:0 var(--size-4);}
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,9 @@ h1:has(+ h2) {

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

.snippet {
margin: var(--size-4) 0;
padding: 0 var(--size-4);
}

0 comments on commit 168d342

Please sign in to comment.