maximkoretskiy / postcss-autoreset

PostCSS plugin for automatic rules isolation
MIT License
244 stars 11 forks source link

Prevent duplicate selectors being added to reset ruleset #18

Closed simonsmith closed 7 years ago

simonsmith commented 7 years ago

If a selector appeared more than once (media query, nesting) it was being duplicated in the reset ruleset. This change adds a check for the selector first.

cc @giuseppeg

giuseppeg commented 7 years ago

Since we are in ES6 I would use a Set instead of an Array – access with has is O(1) and you won't need the extra contains helper

simonsmith commented 7 years ago

That's a good shout but I'd need to add the babel polyfill and I wonder if it's worth the extra code.

giuseppeg commented 7 years ago

@simonsmith ok, your call! the changes looks good to me

maximkoretskiy commented 7 years ago

@simonsmith Could you add changes description into unrealesed section of changelog

simonsmith commented 7 years ago

@maximkoretskiy Done

simonsmith commented 7 years ago

I'll just rebase this with your latest changes

maximkoretskiy commented 7 years ago

@simonsmith sorry. Just pushed fix. could you resolve the conflict?

maximkoretskiy commented 7 years ago

Just published your changes to npm. Thank U guys!