Skip to content

fix(webkit): stop wrapped toast titles overlapping and pin the glyph to line one - #900

Open
gabriel-lisboa-azion wants to merge 1 commit into
fix/toast-item-alignmentfrom
fix/toast-multiline-title
Open

fix(webkit): stop wrapped toast titles overlapping and pin the glyph to line one#900
gabriel-lisboa-azion wants to merge 1 commit into
fix/toast-item-alignmentfrom
fix/toast-multiline-title

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

Summary

  • Stacked on fix(webkit): align a toast's leading icon to its title, not to the whole row #892 (base is fix/toast-item-alignment, not main) — it continues that work rather than competing with it. GitHub will retarget this to main once fix(webkit): align a toast's leading icon to its title, not to the whole row #892 merges.
  • ToastTitle carried leading-none, pinning the line box to the font size (14px) while the glyphs need 18px, so every wrapped title overlapped its own next line by 4px. text-label-md already carries the token leading (1.5). The single-line case is unchanged.
  • The leading glyph now gets the title's line boxh-[1lh] on a box carrying text-label-md resolves to exactly the leading ToastTitle uses — so it sits on the first line at any card height. The loading Spinner shares that wrapper instead of keeping self-center, which centred it on the whole card.

How to test

  1. cd packages/webkit && npx vitest run src/components/feedback/toast → 23 passed.
  2. pnpm storybook:dev → Components/Feedback/Toast. Give a toast a long message so the title wraps: before, consecutive title lines overlap by ~4px; now they are cleanly spaced. The severity icon (and the loading spinner) sits on the title's first line, not the middle of the block.
  3. One-line toasts are unchanged from fix(webkit): align a toast's leading icon to its title, not to the whole row #892.

Notes

…to line one

Two defects that only appear once a toast wraps, which it does routinely — an
icon and a trailing action together leave the title barely half of the 356px
region.

`ToastTitle` carried `leading-none`, pinning the line box to the font size
(14px) while the glyphs need 18px, so every wrapped title overlapped its own
next line by 4px. `text-label-md` already carries the token leading (1.5), which
is what a multi-line title needs; the single-line case is unchanged.

The leading glyph was centred on the whole card (`items-center` plus
`self-center`), which put it beside the middle of a wrapped message, pointing at
nothing. It now gets the title's line box — `h-[1lh]` on a box carrying
`text-label-md` resolves to exactly the leading `ToastTitle` uses — so it sits on
the first line whether the card is one line or four. The trailing action moves to
the same row for the same reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant