Repository navigation
Toast: make the group region z-index configurable (inline MAX_Z_INDEX today) #3375
Closed
aaron-easygo
started this conversation in
Ideas
Replies: 1 comment
|
Thanks for raising this, @aaron-easygo, and for the clear write-up. We're going with your second option. In v2, the toast group no longer sets an inline [data-toast-group] {
z-index: var(--edge-zIndex-notification);
}Until then, [data-toast-group] {
z-index: var(--edge-zIndex-notification) !important;
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
getGroupPlacementStylewrites the toast region's stacking level inline:Because it is an inline declaration, no stylesheet rule on the region can win, and there is no store/group option to supply a different value —
MAX_Z_INDEXis unconditional.Why it matters
A design system that stacks through a token scale (ours is
--edge-zIndex-notification) cannot put toasts on that scale: toasts always land at2147483647. "Above everything" is usually the right default, but it stops being a policy the consumer can express — e.g. a full-screen takeover or critical dialog that should paint over passive notifications cannot, short of out-biddingMAX_Z_INDEX, which nothing can.Ask
Either of these shapes would solve it:
zIndexoption on the store/group (createStore({ zIndex })or agetGroupPropsoption), defaulting toMAX_Z_INDEXso nothing changes for existing consumers; or[data-part="group"]applies, keeping the inline write only when a consumer supplies one — the same shape as fix(popper): only hoist a real z-index onto the positioner #3344 took for the popper positioner.Happy to send a PR for whichever direction you prefer.
All reactions