Frontend
size-4 Is Not 16 Pixels
The compiled CSS was byte-identical at every spacing value. The icon still rendered 20px instead of 16px.
I was migrating a breadcrumb component in an open-source project, from an old styling library onto the project's new design-system layer. The rule was that nothing could change visually. I rebuilt it, put the old and new versions side by side, and the new row sat about ten pixels to the left of where it had been, with wider gaps around the chevrons.
The text was right. The colours were right. The padding was right, which turned out to be the most misleading part of the whole thing.
Every number and every line of CSS in this post comes from that project's own Tailwind 4.3.3, compiled and measured on a development machine.
In this post
- 01The part I checked first, and why it told me nothing
- 02The padding matched because someone made it match
- 03The diff that showed nothing
- 04Sweeping the variable
- 05What this means for your own project
- 06What I would carry to the next migration
- Tailwind CSS
- CSS
- Frontend Development
- Design Systems
- Open Source