Open lukapopijac opened 4 years ago
I'm not sure if template literal replacements in the HTML style
attribute is something the minifier will support properly. I'll move this to minify-html-literals as a feature request to investigate.
This may also be an issue with general CSS value unit replacements.
My first recommendation as a workaround would be to avoid using the style attribute, since the minifier supports minifying <style>
tags and css
template literals. If the style attribute must be used, my second recommendation in the meantime would be to replace the entire style attribute instead of part of it (<div style="#{divStyle}">
).
Good.
Thanks for the recommendations!
I will avoid using js placeholders inside <style>
as that is an antipattern, as mentioned in lit-html
documentation (https://lit-html.polymer-project.org/guide/styling-templates, section "Bindings in style sheets").
I will consider the other recommendation you mentioned.
Thanks!
where did the
px
go?in.js:
out.js:
Breaks with this message:
input.js: