Minify directive failed to correctly minify css block

minify directive failed to correctly minify css block like

<style>
        .lr-border {
            border-left: 1px solid rgba(86,61,124,.2);
            border-right: 1px solid rgba(86,61,124,.2);
        }
</style>

will be minified to

<style>.lr-border{border-left:1px solid transparent;border-right:1px solid transparent}</style>

rgba(86,61,124,.2) in correctly transformed to transparent so that page will not display correctly.

In fact, minify a single css file can produce the same situation.

1 Like

Hi @nq-8oeyenx9,

http.minify is a wrapper that implements the tdewolff/minify library as-is - so any problems with the output will need to be fixed in the issue section there.

1 Like

I’m on it! :slight_smile:

1 Like

The Caddy minifier plugin isn’t fit for production use. There’s a whole thread about it here, where people talk about various problems, including how it deletes important tags.

For CSS, it would be much safer to use csso, cssnano, or clean-css, which are all Node packages. Those projects have a lot more focus, energy, and quality (e.g. csso is from Yandex). The Caddy minify plugin is coming from a guy who is trying to build a minifier for HTML, CSS, JS, and SVG mostly by himself, and that’s just not feasible for a production-quality, safe minifier. Plus, he’ll deliberately delete a lot of necessary syntax, which just makes it unusable.

@OdinWeb I don’t think your comments are very fair.

The Caddy minify plugin is coming from a guy who is trying to build a minifier for HTML, CSS, JS, and SVG mostly by himself

The minify plugin is NOT written by the same person as the author of the library that does the actual minifying.

Again, that pronoun is referring to the wrong person.

Before littering multiple threads with accusations, at least make sure you’re accusing the right person. The person your accusations are intended toward in this case (Taco) is an outstanding member of the Caddy community and a code contributor to Caddy itself.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.