A utility-first CSS framework for rapid UI development.
Fix canonicalization resulting in empty list (#19812)
This PR fixes a bug in the canonicalization process where if a few utilities collapse into a smaller one, and the smaller one is part of the original list, then it results in an empty list. It will be more clear with an example. Let's say you have this setup: ``` w-[calc(1rem+0.25rem)] h-[calc(1rem+0.25rem)] size-5 ``` The first step is that this will result in: ``` w-5 h-5 size-5 ``` Then the `w-5 h-5` can turn into `size-5`. But the existing `size-5`, can also be replaced by the `size-5`. Internally, when we have a replacement, then we mark all the classes that can be replaced as "droppable", so they would be dropped from the list. But in this scenario we also marked `size-5` as droppable, resulting in an empty list. If an additional class existed: ``` w-[calc(1rem+0.25rem)] h-[calc(1rem+0.25rem)] size-5 flex ``` The result would be ``` flex ``` Instead of the expected: ``` size-5 flex ``` ## Test plan 1. Existing tests pass 2. Added new tests with and without an additional class
R
Robin Malfait committed
f302fce815786dedbb97baf81f666d9a28c55a24
Parent: bb2f170
Committed by GitHub <noreply@github.com>
on 3/17/2026, 12:00:31 PM