Skip to content

fix Banner spacing #6190

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

Merged
merged 12 commits into from
Jun 13, 2025
Merged

fix Banner spacing #6190

merged 12 commits into from
Jun 13, 2025

Conversation

llastflowers
Copy link
Contributor

@llastflowers llastflowers commented Jun 10, 2025

Closes https://github.com/github/primer/issues/3720

Changelog

Changed

Styling update addressing banner spacing issues--see vertical alignment on single line banner below (before / after):

Banner before changes
Banner after changes

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

I used the following Playground settings to see this view where the issue was occurring (viewable here):

Banner Playground settings for testing

Merge checklist

Copy link

changeset-bot bot commented Jun 10, 2025

🦋 Changeset detected

Latest commit: 5f281fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This comment was marked as resolved.

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 10, 2025
Copy link
Contributor

github-actions bot commented Jun 10, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.18 KB (0%)
packages/react/dist/browser.umd.js 92.25 KB (0%)

@github-actions github-actions bot requested a deployment to storybook-preview-6190 June 10, 2025 18:06 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6190 June 10, 2025 18:20 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed update snapshots integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 10, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6190 June 10, 2025 18:36 Inactive
@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Jun 10, 2025
@llastflowers llastflowers marked this pull request as ready for review June 10, 2025 19:07
@Copilot Copilot AI review requested due to automatic review settings June 10, 2025 19:07
@llastflowers llastflowers requested review from a team as code owners June 10, 2025 19:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This patch fixes the vertical alignment of the Banner component and corrects a typo in the story description.

  • Aligns banner content centrally instead of at the start
  • Fixes typo in the Playground description text
  • Adds a changeset to trigger a patch release

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

File Description
Banner.stories.tsx Corrected typo in the description arg (en ableenable)
Banner.module.css Changed align-items from start to center in container
.changeset/big-hairs-agree.md Added changeset entry for a patch release

@llastflowers llastflowers marked this pull request as draft June 10, 2025 21:08
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 11, 2025
…tions are present, so that the button and x will be aligned when seen together, but there will will be no x position change if there is an x with no BannerActions
@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 11, 2025

This comment was marked as duplicate.

@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 11, 2025

This comment was marked as outdated.

@github-actions github-actions bot requested a deployment to storybook-preview-6190 June 11, 2025 21:17 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6190 June 11, 2025 21:31 Inactive
@llastflowers
Copy link
Contributor Author

Documenting some context for the newer code changes based on slack DMs with @lukasoppermann:

The change that addressed this original issue (before/after):

banner with buttons without dismiss zoomed in before

banner with buttons without dismiss zoomed in after

was causing this view to look wonky because the x was not vertically aligned, and the buttons now are:

banner with button with dismiss zoomed in before

So I have conditionally applied a matching style to the dismiss x to align it with buttons when present:

banner with button with dismiss zoomed in after

but the x will not move if there are no buttons, to prevent it from moving from its current top-right default position:

banner with position of dismiss x

Margins adjusted with buttons vs. default:

moved x showing margins
unmoved x showing margins

@github-actions github-actions bot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jun 11, 2025
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed update snapshots labels Jun 11, 2025

This comment was marked as outdated.

@lukasoppermann lukasoppermann removed the request for review from maximedegreve June 13, 2025 17:35
@llastflowers llastflowers added this pull request to the merge queue Jun 13, 2025
Merged via the queue into main with commit 613a362 Jun 13, 2025
35 checks passed
@llastflowers llastflowers deleted the llastflowers/3720/banner-spacing-issues branch June 13, 2025 18:34
@primer primer bot mentioned this pull request Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Banner integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants