lightningcss
lightningcss copied to clipboard
Removing duplicate properties does not work on some (clear, clip)
Good day!
First I would like to thank the team for the great product! Thanks to it the web can become a little bit better :)
I have encountered the following problem - while some properties have been successfully reduced to a single instance, others still have duplicates:
.aligncenter { clear: both; clear: both; clip: auto; clip: auto; margin-left: auto; margin-left: auto; margin-right: auto; margin-right: auto; display: block; display: block; }
will result in
.aligncenter{clear:both;clear:both;clip:auto;clip:auto;margin-left:auto;margin-right:auto;display:block}
Here is a link to playground
Thank you!
I've noticed this too; I believe it's because properties related to floats (clear
, float
, etc.) aren't parsed yet: #9. I'd love to help with adding support for the float properties if the maintainers are up for it!
For clip
you could try using clip-path
instead, which does get parsed and deduped. Since clip
is deprecated I suspect it's less likely to get prioritized.
@BStephenBB thanks for the answer! This makes sense.
For clip you could try using clip-path instead
Unfortunately I can't change anything in CSS, it's 3rd party.