tailwindcss
tailwindcss copied to clipboard
Add `fallback` to plugins for when arbitrary values collide
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 -->