lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Removing duplicate properties does not work on some (clear, clip)

Open sashok1337 opened this issue 11 months ago • 2 comments

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!

sashok1337 avatar Mar 02 '24 16:03 sashok1337

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 avatar Mar 27 '24 22:03 BStephenBB

@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.

sashok1337 avatar Apr 01 '24 18:04 sashok1337