Repository navigation
[labs/rollup-plugin-minify-html-literals] Fix @container queries drop… - #5237
Nitin75408 wants to merge 1 commit into
Conversation
…ped during CSS minification
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary
Fixes #5207: CSS
@containerqueries insidecss\`tagged template literals are silently dropped by@lit-labs/rollup-plugin-minify-html-literals` during build.clean-cssfrom^4.2.1→^5.3.3, which natively recognises@container,@layer, and@scopeat-rulestransformcallback fromadjustMinifyCSSOptions()(CleanCSS v5 removed this from its level-1 optimizer); updatetypes/clean-css.tsaccordingly;;→;when a template part begins with;(the declaration separator between two interpolated CSS properties). The single remaining;is consumed bysplitHTMLByPlaceholder, stripping it from the output.minify-html-literals.tsnow restores the leading;for such parts, except when the part starts with}(a trailing semicolon before a closing brace that CleanCSS correctly removed)@containerthat fails on CleanCSS v4 and passes on v5Files changed
package.jsonclean-cssv4 → v5,@types/clean-css→^4.2.11src/lib/strategy.tstransformcallback; add?.ontidySelectorssrc/lib/types/clean-css.ts'transform'fromOptimizationLevel.Onetypesrc/lib/minify-html-literals.ts;separator after CSS splitsrc/test/minify-html-literals.spec.ts@containerregression test