Skip to content

Conversation

langermank
Copy link
Contributor

@langermank langermank commented Oct 16, 2025

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

Fixes close button icon sizing

before after
image image
image image
image image
image image

Copy link

changeset-bot bot commented Oct 16, 2025

🦋 Changeset detected

Latest commit: d54010f

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Patch
@primer/styled-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

Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@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 Oct 16, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-7017 October 16, 2025 01:01 Abandoned
@langermank langermank changed the title update sizing Update Token close button sizing Oct 16, 2025
Copy link
Contributor

github-actions bot commented Oct 16, 2025

Uh oh! @langermank, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 7
  • Images should have meaningful alternative text (alt text) at line 7
  • Images should have meaningful alternative text (alt text) at line 7
  • Images should have meaningful alternative text (alt text) at line 7
  • Images should have meaningful alternative text (alt text) at line 8
  • Images should have meaningful alternative text (alt text) at line 8
  • Images should have meaningful alternative text (alt text) at line 8
  • Images should have meaningful alternative text (alt text) at line 8
  • Images should have meaningful alternative text (alt text) at line 9
  • Images should have meaningful alternative text (alt text) at line 9
  • Images should have meaningful alternative text (alt text) at line 9
  • Images should have meaningful alternative text (alt text) at line 9
  • Images should have meaningful alternative text (alt text) at line 10
  • Images should have meaningful alternative text (alt text) at line 10
  • Images should have meaningful alternative text (alt text) at line 10
  • Images should have meaningful alternative text (alt text) at line 10

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@github-actions github-actions bot requested a deployment to storybook-preview-7017 October 16, 2025 01:06 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7017 October 16, 2025 01:15 Inactive
@langermank langermank added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 16, 2025
Copy link
Contributor

@lukasoppermann lukasoppermann left a comment

Choose a reason for hiding this comment

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

🚀

@langermank langermank marked this pull request as ready for review October 16, 2025 16:34
@Copilot Copilot AI review requested due to automatic review settings October 16, 2025 16:34
@langermank langermank requested review from a team as code owners October 16, 2025 16:34
@langermank langermank requested a review from mperrotti October 16, 2025 16:34
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 PR fixes the close button icon sizing in the Token component to address visual inconsistencies. The changes simplify the icon sizing logic and improve CSS consistency by using design tokens and removing redundant line-height declarations.

  • Simplified icon sizing from a calculated approach to fixed sizes (12px for small/medium/large, 16px for xlarge)
  • Standardized CSS by replacing hardcoded values with design tokens and consolidating line-height rules
  • Updated color variables to use proper semantic tokens for interactive states

Reviewed Changes

Copilot reviewed 4 out of 86 changed files in this pull request and generated 2 comments.

File Description
packages/react/src/Token/_RemoveTokenButton.tsx Simplified icon sizing logic and removed unused function
packages/react/src/Token/_RemoveTokenButton.module.css Updated to use design tokens and proper semantic color variables
packages/react/src/Token/TokenBase.module.css Consolidated line-height and replaced hardcoded values with design tokens
.changeset/fresh-turtles-carry.md Added changeset documentation for the patch

}}
>
<XIcon size={getTokenButtonIconSize(size)} />
<XIcon size={size === 'small' || size === 'medium' || size === 'large' ? 12 : 16} />
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

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

[nitpick] The repeated conditional logic for icon sizing could be extracted into a helper function or constant mapping for better maintainability and consistency.

Copilot uses AI. Check for mistakes.

type="button"
>
<XIcon size={getTokenButtonIconSize(size)} />
<XIcon size={size === 'small' || size === 'medium' || size === 'large' ? 12 : 16} />
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

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

[nitpick] This duplicates the same conditional logic from line 40. Consider extracting this into a shared function or constant to avoid code duplication.

Copilot uses AI. Check for mistakes.

@langermank langermank added this pull request to the merge queue Oct 16, 2025
Merged via the queue into main with commit 2fd6c82 Oct 16, 2025
42 checks passed
@langermank langermank deleted the token-close-button-sizing branch October 16, 2025 17:36
@primer primer bot mentioned this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants