-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: Improve CodeTabs tab naming #8552
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?
feat: Improve CodeTabs tab naming #8552
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
|
Lighthouse Results
|
|
nit: the secondary label border style (padding) differs from Figma. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8552 +/- ##
==========================================
+ Coverage 74.96% 75.01% +0.04%
==========================================
Files 103 103
Lines 9036 9036
Branches 312 311 -1
==========================================
+ Hits 6774 6778 +4
+ Misses 2260 2256 -4
Partials 2 2 ☔ View full report in Codecov by Sentry. |
|
nit: my understanding is that this change won't actually affect existing code snippet boxes, for the website, (cc @nodejs/nodejs-website) do we want to update existing code snippet labels? For doc-kit, cc @avivkeller I believe we can simply call most of the in-box code-snippet as "Example", but I worry it would require us to actually change in-source code-snippets (the raw md files)... I wonder if this is the right way of achieving what @canerakdas proposed? |
| { key: 'mjs', label: 'MJS' }, | ||
| { key: 'cjs', label: 'CJS' }, | ||
| { key: 'mjs', label: 'Example', secondaryLabel: 'MJS' }, | ||
| { key: 'cjs', label: 'Example', secondaryLabel: 'CJS' }, |
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.
You should have tabs with and without secondary labels
We'd probably have update the Shiki plugin to change the way it works, rather than changing the raw markdown files. This would also apply to the website. |
I’m wondering whether we could handle this with only CSS by adding content: "Example" via |
|
Thanks for calling this out — this change is mainly meant to showcase the visual output and behavior as a reference and to gather feedback before we lock anything in. |
Not sure I'm a fan of CSS-only solution... That'd force the "Example" tag on all codeboxes |

Description
This PR updates the secondary label styling of the tab components to improve visual clarity and consistency. It also updates the Storybook examples to reflect the new design for easier reference and validation.
Relevant screenshots have been attached for comparison and review
Light mode:
Dark mode :
Related Issues
Related to #8549
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.