refactor(toolbar): improve slot layout and visibility handling#30371
Merged
refactor(toolbar): improve slot layout and visibility handling#30371
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
3e47d64 to
5280f4f
Compare
8b66770 to
d593cb5
Compare
d593cb5 to
d9bcab6
Compare
4b8d8fa to
f08f797
Compare
e94650e to
9f9efb5
Compare
d277d5d to
d3ac45d
Compare
d534843 to
132ae80
Compare
brandyscarney
requested changes
Apr 29, 2025
.../modal.e2e.ts-snapshots/modal-shape-sheet-default-ionic-md-ltr-light-Mobile-Chrome-linux.png
Show resolved
Hide resolved
…e up unnecessary space
…mework into next-branch/FW-6439
…mework into next-branch/FW-6439
…ent can be added dynamically
brandyscarney
approved these changes
Apr 30, 2025
Member
brandyscarney
left a comment
There was a problem hiding this comment.
This looks and works great! 🎉 Smart solution to a complex problem! In the future, we might want to explore relying more on Stencil for slot updates and width detection, but I don't think we need to hold this up. 👍
thetaPC
approved these changes
Apr 30, 2025
Contributor
thetaPC
left a comment
There was a problem hiding this comment.
LGTM, great job!!!!
We really should consider not using ion-header in our test pages to avoid so many screenshot changes.
Member
Author
|
@thetaPC we have a card to crop it out of the screenshots, it's entirely possible to make the screenshots the relevant components that are actually being tested so this doesn't happen again. Check out FW-6505 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves internal
What is the current behavior?
Currently, the Ionic theme toolbar uses
position: absolutein modals to center its text or justtext-align: centerin other scenarios. This can lead to issues with alignment that can cause overlapping elements.What is the new behavior?
This new behavior reworks how slots get rendered and the content gets placed in the toolbar. It no longer relies on
host-contextat all (which doesn't work in Firefox) and instead usesflexto lay out the toolbar and responsively react to the content around it.This does, however, have the drawback of preventing us from properly centering the content of the toolbar with just CSS, so there's new JavaScript that checks for content in certain slots and shows/hides slots based on whether or not there's anything in them, to allow the toolbar content to properly center itself.
toolbar-new.mp4
All of this combined leads to a much nicer toolbar experience that's actually responsive and works for any type of content - not just ion-titles.
Screenshots
Many of the screenshots had to be updated because the previous version of the toolbar was absolutely positioned in most cases and had a 3px top and bottom padding. This change removes that padding and makes it more closely align with the Figma mocks.
Does this introduce a breaking change?
Other information
Preview:
Toolbar