-
-
Notifications
You must be signed in to change notification settings - Fork 263
[toast] Support variable height stacking #2742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[toast] Support variable height stacking #2742
Conversation
commit: |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size report
|
fc9094a to
952d36f
Compare
| * Indicates the height of the frontmost toast at index 0 in the list. | ||
| * @type {number} | ||
| */ | ||
| index0Height = '--toast-index-0-height', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would frontmostHeight or foremostHeight be a better name? My brain instinctively thought there were also index-1, index-2, ... vars.
| index0Height = '--toast-index-0-height', | |
| frontmostHeight = '--toast-frontmost-height', |
| "cssVariables": {} | ||
| "cssVariables": { | ||
| "--toast-frontmost-height": { | ||
| "description": "Indicates the height of the frontmost toast at index 0 in the list.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "index 0" sounds redundant with frontmost
| "description": "Indicates the height of the frontmost toast at index 0 in the list.", | |
| "description": "Indicates the height of the frontmost toast in the list.", |
or
| "description": "Indicates the height of the frontmost toast at index 0 in the list.", | |
| "description": "Indicates the height of the frontmost toast.", |
298b160 to
b1bd10b
Compare
michaldudak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor remarks only - approving.
dd8e775 to
bf12feb
Compare
Closes #1955
Screen.Recording.2025-09-16.at.10.25.33.am.mov
New part
Adds a new
<Toast.Content>part to apply fade-out andoverflow: hiddeneffects to, and to allowResizeObserverto only measure content changes now that theheightof the toast changes and transitions.Styles fixes
There's a new
--peekvariable (user-defined in the demos) and changedtransformlogic that ensures the "peek" part of stacked toasts behind the front one is constant and doesn't change based on the height of the toasts. I also noticed this fixed the animation bug that was present when holding downEnteron the toast creator button.