Skip to content

fix: Vertically center Banner text content when action or close button is present#1029

Open
engfragui wants to merge 6 commits intomainfrom
francesca/banner-center-text
Open

fix: Vertically center Banner text content when action or close button is present#1029
engfragui wants to merge 6 commits intomainfrom
francesca/banner-center-text

Conversation

@engfragui
Copy link
Copy Markdown
Contributor

@engfragui engfragui commented Apr 6, 2026

Description

Vertically centers <Banner>'s text content when action or close button is present.
Note that before this fix the text content was slightly closer to the top of the <Banner> and not actually centered.

Reference

Demo

BeforeAfter
Screenshot 2026-04-06 at 10 05 31

(Storybook)

Screenshot 2026-04-06 at 10 48 08

(Storybook)

…n is present

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@engfragui engfragui self-assigned this Apr 6, 2026
@engfragui engfragui requested a review from alexmuench April 6, 2026 08:08
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR updates the Banner component to vertically center its text content when an action or close button is present, helping to create a more balanced layout. However, an issue was noted where applying align-items: center to the .content class inadvertently centers the text horizontally in the mobile view, alongside a minor redundancy in the desktop layout.

Share FeedbackReview Logs

…ing bug

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@engfragui engfragui marked this pull request as draft April 6, 2026 08:33
… of text

Move the type icon from the .icon container into .topContent, wrapped
with .copy in a new .iconCopy group. This ensures the icon stays aligned
with the first line of text while the icon+text group centers as a unit
relative to action buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@engfragui engfragui requested review from a team and gnapse and removed request for a team April 6, 2026 08:49
@engfragui engfragui marked this pull request as ready for review April 6, 2026 08:49
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR improves the visual balance of the Banner component by vertically centering its text content when an action or close button is present. While this nicely aligns the component with the design specifications, there is a layout regression in narrow containers (under 235px) where the updated structure causes the type icon and close button to inadvertently render on separate rows.

Share FeedbackReview Logs

engfragui and others added 2 commits April 6, 2026 11:19
Move the close button into .iconCopy so that at <235px the type icon
and close button render together in the same header row, matching the
original responsive layout. The .icon container is removed entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants