Skip to content

chore(_VisuallyHidden): Convert internal component _VisuallyHidden to CSS module styling - #6083

Merged
jonrohan merged 13 commits into
mainfrom
css_module_convert/_visuallyhidden
Jul 10, 2025
Merged

chore(_VisuallyHidden): Convert internal component _VisuallyHidden to CSS module styling#6083
jonrohan merged 13 commits into
mainfrom
css_module_convert/_visuallyhidden

Conversation

@jonrohan

@jonrohanjonrohan commented May 20, 2025

Copy link
Copy Markdown
Member

Changelog

New

Changed

Convert internal component _VisuallyHidden to CSS module styling

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

Merge checklist

@changeset-bot

changeset-botBot commented May 20, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d83f48e

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

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

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-actionsgithub-actionsBot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 20, 2025
@github-actions

Copy link
Copy Markdown
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-actionsBottemporarily deployed to storybook-preview-6083 May 20, 2025 18:29 Inactive
@github-actions

github-actionsBot commented May 20, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js91.98 KB (-0.04% 🔽)
packages/react/dist/browser.umd.js92.23 KB (+0.01% 🔺)

@github-actions
github-actionsBot requested a deployment to storybook-preview-6083 May 20, 2025 18:38 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6083 May 20, 2025 18:51 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6083 May 20, 2025 19:09 Inactive
@jonrohan
jonrohan marked this pull request as ready for review May 20, 2025 21:24
CopilotAI review requested due to automatic review settings May 20, 2025 21:24
@jonrohan
jonrohan requested a review from a team as a code ownerMay 20, 2025 21:24
@jonrohan
jonrohan requested a review from joshblackMay 20, 2025 21:24

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 replaces the styled‐component implementation of the internal _VisuallyHidden component with a CSS module and updates snapshots to use the new InternalVisuallyHidden class.

  • Migrates _VisuallyHidden from styled.span to a BoxWithFallback + CSS module.
  • Introduces _VisuallyHidden.module.css with the visually‐hidden styles.
  • Regenerates snapshots across several components to reference the new CSS class.

Reviewed Changes

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

Show a summary per file
FileDescription
packages/react/src/_VisuallyHidden.tsxReplaced styled‐component implementation with CSS module and BoxWithFallback.
packages/react/src/_VisuallyHidden.module.cssNew CSS module defining the .InternalVisuallyHidden styles.
packages/react/src/Token/tests/snapshots/Token.test.tsx.snapUpdated snapshot spans to use InternalVisuallyHidden class.
packages/react/src/TextInput/snapshots/TextInput.test.tsx.snapUpdated snapshot spans to use InternalVisuallyHidden class.
packages/react/src/CircleBadge/snapshots/CircleBadge.test.tsx.snapSnapshot class names updated (unrelated styled-component change).
.changeset/smooth-steaks-hug.mdAdds a changeset for the minor version bump.
Comments suppressed due to low confidence (3)

packages/react/src/_VisuallyHidden.tsx:19

  • [nitpick] There are no unit tests covering the new _VisuallyHidden component; consider adding tests for both visible and hidden states to ensure the CSS module is applied correctly.
<BoxWithFallback as={as} className={clsx(...

packages/react/src/_VisuallyHidden.tsx:11

  • You reference React.ElementType and React.HTMLAttributes but never import React; please add import React from 'react' or import type {React} from 'react' to satisfy the type usage.
function VisuallyHidden({

packages/react/src/CircleBadge/snapshots/CircleBadge.test.tsx.snap:5

  • [nitpick] These CircleBadge snapshot updates seem unrelated to the _VisuallyHidden change—you may want to verify they’re intentional or revert to avoid introducing noisy snapshot diffs.
 class="sc-fUnMCh kvrJCk"

@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/379060

@primer-integration

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

@github-actionsgithub-actionsBot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 21, 2025
Comment threadpackages/react/src/_VisuallyHidden.tsx Outdated
Co-authored-by: Josh Black <joshblack@github.com>
@jonrohan
jonrohan requested a review from joshblackMay 21, 2025 16:26
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6083 May 21, 2025 17:00 Inactive
@github-actionsgithub-actionsBot 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 Jul 7, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actionsgithub-actionsBot 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 Jul 7, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6083 July 7, 2025 21:32 Inactive
interface Props {
interface Props extends React.ComponentPropsWithoutRef<'span'> {
isVisible?: boolean
as?: React.ElementType

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This component is only used internally, and I verified the only instances pass as="h2"

@jonrohan
jonrohan enabled auto-merge July 7, 2025 22:18
@github-actionsgithub-actionsBot 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 Jul 10, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@jonrohan
jonrohan added this pull request to the merge queueJul 10, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6083 July 10, 2025 00:59 Inactive
auto-merge was automatically disabled July 10, 2025 01:03

Pull Request is not mergeable

Merged via the queue into main with commit 26232b3Jul 10, 2025
@jonrohan
jonrohan deleted the css_module_convert/_visuallyhidden branch July 10, 2025 01:10
@primerprimerBot mentioned this pull request Jul 10, 2025
llastflowers pushed a commit that referenced this pull request Jul 23, 2025
… CSS module styling (#6083)
Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghintegration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jonrohan@joshblack