lahmatiy / postcss-csso

PostCSS plugin to minify CSS using CSSO
MIT License
119 stars 6 forks source link

css modules @value #{$sass-variable} is being broken by postcss-csso #10

Closed v-trof closed 3 years ago

v-trof commented 7 years ago

See https://github.com/VsevolodTrofimov/csso-modules-bug For reproduction

lahmatiy commented 7 years ago

CSSO process a CSS, not a Saas or whatever. So issue isn't related to CSSO or Saas. As I know css-modules exposes class names and id only (keyframes or smth like that also maybe, but not sure). Saas variables shouldn't to be exposed, but may be because of saas-loader. I don't know how your pipeline works in details and where is the problem. Believe it isn't because of CSSO. Plugin may be, but there is to low chance for it. Are you sure it's because of postcss-csso and Saas var should be exposed?

v-trof commented 7 years ago

This is why I create this issue in postcss-csso and not csso itself. For some reason presence of exactly postcss-csso causes the issue

v-trof commented 7 years ago

Btw, postcss gets css files Before they are being passed to css loader => postcss-csso cuts this from a .css without any webpack specific changes

v-trof commented 7 years ago

Yep, replicated without sass @value #{} is being wiped. It is questionable, whether this can be taken for correct css syntax, but as for now everything works without postcss-csso.

lahmatiy commented 3 years ago

Looks like the issue is related to #19 and fixed in 5.0.1