html-minifier-terser
html-minifier-terser copied to clipboard
[Bug]: Nested CSS, parent is lost
What happened?
CSS Nesting is now widely supported
<style>
html {
&[data-is-loaded='false'] {
opacity: 0;
}
&[data-is-loaded='true'] {
transition: opacity calc(1s / 3);
opacity: 1;
}
}
</style>
Yields (unminified):
<style>
&[data-is-loaded='true'] {
transition: opacity calc(1s / 3);
opacity: 1;
}
</style>
Enclosing parent is lost.
Version
7.2.0
What browsers are you seeing the problem on?
No response
Link to reproduce
No response
Relevant log output
No response
Willing to submit a PR?
None
Can you test, if a newer version of clesn-css supports that?
https://github.com/terser/html-minifier-terser/blob/master/package.json#L78
Tried it with just clean-css on version 5.6.3 and it doesn't work, it looks like they're not gonna add the feature in the meanwhile: https://github.com/clean-css/clean-css/issues/1254