-
Notifications
You must be signed in to change notification settings - Fork 611
Migrate the TabNav component to use CSS modules #6176
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 25e3be4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
👋 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! |
There was a problem hiding this 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 migrates the TabNav
component from styled-components to CSS Modules, replacing custom styled wrappers with BoxWithFallback
and adding scoped CSS in TabNav.module.css
.
- Swapped out
styled-components
usage forBoxWithFallback
and CSS module classes. - Introduced
TabNav.module.css
to encapsulate styles for the nav, tab list, links, and selected state. - Updated tests to remove the
Box
wrapper and use a plain<div>
for markup.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react/src/TabNav/tests/TabNav.test.tsx | Replaced <Box> wrapper with <div> |
packages/react/src/TabNav/TabNav.tsx | Removed styled-components, wired up CSS modules |
packages/react/src/TabNav/TabNav.module.css | New CSS module for TabNav layout and styles |
Comments suppressed due to low confidence (1)
packages/react/src/TabNav/TabNav.module.css:29
- CSS module files typically do not support Sass mixins by default. Either convert this file to a
.module.scss
with proper preprocessor support or replace the mixin with valid PostCSS/CSS syntax for focus styles.
@mixin focusOutline -6px;
ref={ref} | ||
role="tab" | ||
tabIndex={-1} | ||
aria-selected={selected ? true : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For role="tab"
, aria-selected
should always be present with a boolean value (true
or false
). Change to aria-selected={selected}
so it does not get omitted.
aria-selected={selected ? true : undefined} | |
aria-selected={selected} |
Copilot uses AI. Check for mistakes.
size-limit report 📦
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/382519 |
🔴 golden-jobs completed with status |
Changelog
New
Changed
Migrating
TabNav
to use CSS modulesRemoved
Rollout strategy
Testing & Reviewing
Merge checklist