tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Add `fallback` to plugins for when arbitrary values collide

Open RobinMalfait opened this issue 1 year ago • 0 comments

This will allow us to use the fallback plugin if there are 2 colliding plugins given a certain arbitrary value that's indistinguishable in either plugin.

Normally we would then require a type cast, but now we can use the fallback. This is useful so that in the future adding more colliding plugins doesn't result in working code being broken because it requires a typehint all of a sudden.

E.g.:

<!-- Before -->
<div class="bg-[200px_100px]"></div><!-- Warning -->

<!-- Fix: -->
<div class="bg-[length:200px_100px]"></div>
<div class="bg-[position:200px_100px]"></div>
<!-- After (no fix required) -->
<div class="bg-[200px_100px]"></div><!-- Generates styles for the background-size -->

RobinMalfait avatar Sep 20 '22 09:09 RobinMalfait