cssnano icon indicating copy to clipboard operation
cssnano copied to clipboard

Can't discard duplicate rules

Open Lin07ux opened this issue 10 years ago • 4 comments

code: body { padding: 50px; }

body { padding: 0; }

results: body{padding:50px;padding:0}

What can I do to get the results as: body {padding:0}

Lin07ux avatar Nov 02 '15 08:11 Lin07ux

Currently it's not supported; I need more data before I can do this feature well. Not sure when I'll have time for this as my open source time is very limited these days.

ben-eb avatar Nov 05 '15 20:11 ben-eb

:+1: on this issue... gulp-minify-css didn't have this problem. Having duplicate styles like this is basically broken/poorly written css, but if you could protect us from ourselves or the junior members of our teams, that would be great.

jakefreeberg avatar Jan 19 '16 18:01 jakefreeberg

Yep, have had a few enquires about this, and a pull request which didn't quite have the robustness that I am looking for this feature. It's coming, but any help would be greatly appreciated.

https://github.com/ben-eb/postcss-discard-duplicates/pull/4

ben-eb avatar Jan 19 '16 18:01 ben-eb

If you're interested in helping this issue move forward, you can help out by contributing to https://github.com/ben-eb/css-values, which we will be using to validate properties before merging.

ben-eb avatar Aug 03 '16 07:08 ben-eb