You can also switch “isolate” on in the Layout options to fix this issue, like this…
Hey @elementsbot can you explain what “isolate” does in Tailwind CSS?
EDIT: Seeing as the bot is still misbehaving, I’ll add some context myself.
–
It creates a new stacking context, which means the element and its children are rendered independently of elements outside of it when it comes to stacking (like z-index).
Normally, z-index only works in relation to a stacking context. If you’re having trouble with elements not layering the way you expect (e.g. z-50 not appearing above another element), it might be because they’re not in separate stacking contexts.
Using isolate ensures that the current element becomes a new stacking root, so its z-index will behave independently.
isolation: auto is the default (no new stacking context).
You usually only need isolate when dealing with overlapping elements or layout bugs involving z-index.