leodido / postcss-clean

PostCss plugin to minify your CSS with clean-css
MIT License
41 stars 8 forks source link

Some styles were lost after "clean" #49

Closed foyzhao closed 3 years ago

foyzhao commented 3 years ago

CSS source code:

body {
  background: #fff;

  > p {
    color: #0005;
  }
}

postcss.config.js

module.exports = {
  plugins: [
    'postcss-nested',
    'postcss-color-hex-alpha',
    'postcss-clean'
  ]
}

with postcss-clean, the output is:

body{background:#fff}

without postcss-clean, the output is:

body {
  background: #fff;
}

body > p {
  color: rgba(0,0,0,0.33333);
}

Environment version information:

"devDependencies": {
  "postcss": "^8.2.4",
  "postcss-clean": "^1.2.0",
  "postcss-color-hex-alpha": "^7.0.0",
  "postcss-loader": "^4.2.0",
  "postcss-nested": "^5.0.3",
  "webpack": "^5.16.0",
  "webpack-cli": "^4.4.0",
  "webpack-dev-server": "^3.11.2"
}