Tokens for z-index and layering: does your system define them?
We just had a bug where a dropdown appeared under a sticky header because two teams picked their own z-index values. It made me realize we have tokens for colour and spacing but nothing for layering.
I'm thinking of a small named scale: base, dropdown, sticky, overlay, modal, toast. Does your design system include something like this? And did you find it actually prevented conflicts?
Comments · 2
Yes, name them by purpose: dropdown, sticky, modal, toast. Then each has a value in a defined order, and nobody guesses numbers like 9999.
Also document stacking contexts. A lot of z-index bugs come from a parent creating a new context so the value doesn't matter at all.