Skip to content
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

[feature request] Add "unit test" modifier to the removeDuplicatedValues option #670

Open
Bub-la-bub opened this issue Mar 31, 2021 · 1 comment

Comments

@Bub-la-bub
Copy link

This plugin works very well and the 'removeDuplicatedValues' feature is very useful for allowing "conscious duplicates" as you mention in the documentation and I think it could also be useful to add a modifier to the removeDuplicatedValues option which modifies the current behavior so that it tests the units of the value when deciding if the "duplicate" value should be removed. It could also be useful to allow "0" to be considered to have the same unit.

Examples:

// these have the same 'px' unit, so the last one would be kept:
margin-right: 10px;
margin-right: 5px;

// these have different units, so they both would be kept (same as current behavior):
margin-right: 1rem;
margin-right: 5px;

// these have no units, so they both would be kept (same as current behavior):
display: inline;
display: initial;

With the "0" rule mentioned above:

// the last one would be kept:
margin-right: 10px;
margin-right: 0;

// the last one would be kept:
margin-right: 0;
margin-right: 10px;

Anyway, thank you for making such a useful plugin.

@ChristianMurphy
Copy link
Owner

Also would you be interested in opening a pull request?

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

No branches or pull requests

2 participants