Skip to content

fix(TokenTextContainer): Update the line-height to use a primer primitives CSS variable#7746

Merged
jonrohan merged 2 commits intomainfrom
token_base_line_height
Apr 10, 2026
Merged

fix(TokenTextContainer): Update the line-height to use a primer primitives CSS variable#7746
jonrohan merged 2 commits intomainfrom
token_base_line_height

Conversation

@jonrohan
Copy link
Copy Markdown
Member

While looking at https://github.com/github/github-ui/pull/18258 I found that the TokenTextContainer was using line-height: normal; I think this might have been a bug when we converted the component from styled components. As the previous styled system lineHeight: normal would have converted to the "normal" value of the css variable.

I'm fixing by using the CSS variable var(--base-text-lineHeight-normal);

Changelog

New

Changed

Fixing TokenTextContainer line-height to use primer primitives

Removed

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'm not expecting this to make too much of a difference in prod, the bug I noticed was very subtle line height shift. Here's a gif toggling between the change:

CleanShot 2026-04-10 at 09 34 53

Merge checklist

@jonrohan jonrohan requested a review from a team as a code owner April 10, 2026 16:36
@jonrohan jonrohan requested review from TylerJDev and Copilot April 10, 2026 16:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 10, 2026

🦋 Changeset detected

Latest commit: 2fea2c4

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Uh oh! @jonrohan, 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 34

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 added the staff Author is a staff member label Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@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 Apr 10, 2026
Update TokenTextContainer `line-height` to use primer primitives CSS variable `var(--base-text-lineHeight-normal)`
@jonrohan jonrohan added the integration-tests: skipped manually Changes in this PR do not require an integration test label Apr 10, 2026
@jonrohan
Copy link
Copy Markdown
Member Author

I'm skipping integration tests because this is just a CSS change

Copy link
Copy Markdown
Contributor

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

Updates TokenTextContainer’s line-height to use a Primer primitives CSS custom property instead of the literal normal value, aligning behavior with the prior styled-system mapping.

Changes:

  • Replace line-height: normal; with line-height: var(--base-text-lineHeight-normal); in the Token text container CSS.
  • Remove the stylelint-disable-next-line primer/typography suppression that was only needed for the raw normal value.
Show a summary per file
File Description
packages/react/src/Token/_TokenTextContainer.module.css Switches line-height to a primitives-backed CSS variable for consistent typography behavior.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@jonrohan jonrohan added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 30206c4 Apr 10, 2026
60 checks passed
@jonrohan jonrohan deleted the token_base_line_height branch April 10, 2026 17:07
@primer primer bot mentioned this pull request Apr 10, 2026
@jonrohan jonrohan changed the title Update line-height to use CSS variable fix(TokenTextContainer): Update the line-height to use a primer primitives CSS variable Apr 10, 2026
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 integration-tests: skipped manually Changes in this PR do not require an integration test staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants