Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Sep 20, 2024
1 parent 5fa57bd commit 5a87944
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
15 changes: 11 additions & 4 deletions packages/cli/src/plugins/resource/plugin-standard-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,18 @@ function bundleCss(body, url, compilation) {
} else if (type === 'PseudoElementSelector') {
optimizedCss += `::${name}`;
} else if (type === 'MediaQuery') {
// TODO modifier seems to be null
// https://github.com/csstree/csstree/issues/285
// https://github.com/csstree/csstree/issues/285#issuecomment-2350230333
const { mediaType, modifier } = node;

optimizedCss += `${mediaType} ${modifier ?? 'and'}`;
const type = mediaType !== null
? mediaType
: '';
const operator = mediaType && node.condition
? ' and'
: modifier !== null
? ` ${modifier}`
: '';

optimizedCss += `${type}${operator}`;
} else if (type === 'Block') {
optimizedCss += '{';
} else if (type === 'AttributeSelector') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@ tabbed-custom-element::part(tab){color:#0c0dcc;border-bottom:transparent solid 2

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

h2{& span{color:red}}
h2{& span{color:red}}

@media (max-width:768px){span{flex-direction:column;text-align:center;}}
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,11 @@ h2 {
& span {
color: red;
}
}

@media (max-width: 768px) {
span {
flex-direction: column;
text-align: center;
}
}

0 comments on commit 5a87944

Please sign in to comment.