Skip to content

feat: add option to only remove exact duplicate property/values #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 10, 2020

Conversation

MoltenCoffee
Copy link
Contributor

@MoltenCoffee MoltenCoffee commented Sep 10, 2020

Back in 2017, aldebaran798 added the removeDuplicatedProperties feature. I propose to add a "soft" version of this, which I named (at least for now) removeDuplicatedValues.

The difference in function is, that it will only remove duplicate properties when the values are equal as well. This way, it cleans up equal properties that came from duplicates of the same selector but allows for conscious duplicates like fallbacks for custom properties, as these have different values and thus won't be removed.

Removed a useless adition of const twice in the script which I added in my previous commit
Copy link
Owner

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MoltenCoffee! 🙇
Looks good, it could be nice to have another test case for a custom property/css variable.
Other than that this looks good to me 👍

Add test for CSS custom properties and fix spelling mistakes
@ChristianMurphy ChristianMurphy merged commit 589b432 into ChristianMurphy:main Sep 10, 2020
@ChristianMurphy
Copy link
Owner

released in 9.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants