Using the -c flag within the CLI does not actually compress a given input file under v1.8.3.
E.g. let's consider the compression example on the cssnano homepage:
input.css
h1::before, h1:before {
margin: 10px 20px 10px 20px;
color: #ff0000;
-webkit-border-radius: 16px;
border-radius: 16px;
font-weight: normal;
font-weight: normal;
}
/* invalid placement */
@charset "utf-8";
We'd expect cssnext -c input.css to give us this:
@charset "utf-8";h1:before{margin:10px 20px;color:red;border-radius:1pc;font-weight:400}
However we just get back the original input.css (non-compressed).
After some digging I found that adding the following flags in addition to -c seems to help, so I imagine there's a conflict with how cssnano is being called:
Hacky workaround - disable everything but compression:
> cssnext -c input.css --no-custom-properties --no-calc --no-custom-media --no-media-queries-range --no-custom-selectors --no-color-rebeccapurple --no-color-hwb --no-color-gray --no-color-hex-alpha --no-color-function --no-font-variant --no-filter --no-rem --no-pseudo-elements --no-pseudo-class-matches --no-pseudo-class-not --no-pseudo-class-any-link --no-color-rgba --no-autoprefixer
The above delivers compressed output, but it obviously isn't ideal given we're effectively disabling all the other features within cssnext.
Has anyone run into the same issue?