-
Notifications
You must be signed in to change notification settings - Fork 51
[WIP-05] [Project Solar / Phase 1 / Showcase] Scaffolding of the showcase pages for the carbonization of the HDS components #3241
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: project-solar/phase-1/HDS-5242_showcase/add-themes-support
Are you sure you want to change the base?
[WIP-05] [Project Solar / Phase 1 / Showcase] Scaffolding of the showcase pages for the carbonization of the HDS components #3241
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
19234bc
to
cd4e9ef
Compare
cd4e9ef
to
a0b23a9
Compare
519a6a6
to
3863dfa
Compare
a0b23a9
to
403ac45
Compare
403ac45
to
9376a33
Compare
9376a33
to
8bc9cc9
Compare
8bc9cc9
to
f8e77f1
Compare
f8e77f1
to
68248e2
Compare
410ae80
to
859dcde
Compare
dcfc657
to
47f7b3b
Compare
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 scaffolds showcase pages for the carbonization (theming/re-skinning) of HDS components. It introduces infrastructure to compare HDS components with different Carbon themes against their equivalent Carbon web components, supporting the dry-run migration phase.
Key changes:
- Introduces a new
<ShwCarbonizationComparisonGrid>
component for side-by-side theme comparisons - Adds carbonization showcase pages for foundations (Color, Typography, Focus Ring) and components (Badge, BadgeCount, Button, Form/TextInput, SegmentedGroup)
- Integrates Carbon Web Components via CDN and sets up Carbon theming infrastructure
Reviewed Changes
Copilot reviewed 36 out of 44 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
showcase/package.json | Adds Carbon dependencies (@carbon/grid, @carbon/layout, @carbon/themes, @carbon/type, @carbon/web-components, @ibm/plex) |
showcase/app/index.html | Integrates Carbon Web Components via CDN scripts and theming stylesheets |
showcase/app/router.ts | Adds routes for carbonization pages under foundations and components |
showcase/app/templates/index.hbs | Adds navigation links to carbonization pages |
showcase/app/components/shw/carbonization/comparison-grid/index.gts | Implements main comparison grid component for displaying themed variations |
showcase/app/components/shw/carbonization/comparison-grid/item.gts | Implements individual grid item with theme-specific styling |
showcase/app/components/page-foundations/color/carbonization.gts | Showcases color tokens across themes |
showcase/app/components/page-foundations/typography/carbonization.gts | Showcases typography styles across themes |
showcase/app/components/page-foundations/focus-ring/carbonization.gts | Showcases focus ring styles across themes |
showcase/app/components/page-components/badge/carbonization.gts | Showcases Badge component variations |
showcase/app/components/page-components/badge-count/carbonization.gts | Showcases BadgeCount component variations |
showcase/app/components/page-components/button/carbonization.gts | Showcases Button component variations |
showcase/app/components/page-components/form/text-input/carbonization.gts | Showcases TextInput component variations |
showcase/app/components/page-components/segmented-group/carbonization.gts | Showcases SegmentedGroup component variations |
showcase/app/styles/app.scss | Imports carbonization-related SCSS modules |
showcase/app/styles/showcase-components/carbonization/*.scss | Adds styling for carbonization components and theming |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
showcase/app/styles/showcase-components/carbonization/token-preview-color.scss
Outdated
Show resolved
Hide resolved
showcase/app/components/page-components/segmented-group/carbonization.gts
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
ed139c4
to
f644268
Compare
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.
Overall think the approach works really well. The new comparison grid set up is nice from an API standpoint, and the layout will make it easy to pick things up in visual regression testing. Just have some more minor feedback, and comments on specific pages.
|
||
if (this.args.scope === 'theming') { | ||
// here we use the custom HDS theming selector | ||
classes.push(`hds-theme-${this.args.theme}`); |
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.
[Issue] When the global showcase theme is not set to a CSS selector option, the theming classes for each theme example are not being applied, because the CSS file that contains their styling is not being loaded.
We may have to have some encapsulation for these carbonization pages that isolates them from the broader theming being set in the showcase. We would have to load the css selector theming files always on these pages for these theme example to pick up the right tokens.
Ideally these theme examples should not change at all depending on the broader global theme set, and should be isolated examples.
Using css selector HDS theming

<template> | ||
<div class={{this.classNames}} ...attributes> | ||
{{#if @label}} | ||
<ShwLabel |
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.
[Nit] Because these labels are inside the element where the theming classes are applied, they are getting themed as well even though they are outside of the item-content
. Ideally all the labels should be the same across the theme examples. If those theming classes could be moved to only apply to the item-content
that would fix it.

{{#each weights as |weight|}} | ||
<SF.Item> | ||
<p | ||
class="hds-typography-{{style}} hds-font-weight-{{weight}}" |
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.
class="hds-typography-{{style}} hds-font-weight-{{weight}}" | |
class="hds-typography-{{style}} hds-font-weight-{{weight}} hds-foreground-primary" |
[Suggestion] Setting the text color here to an HDS token instead of the showcase default theme, makes the examples more isolated from any theming that happens on the showcase level. You could have the situation where the background of the example is fixed at a value specific to that theme, but the text is changing color based on the showcase global theme.

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.
Note: If this class is added, currently it's still getting overridden by the showcase theme text due to the body.page-foundations-typography p[class^=hds-]
selector so some tweaks would be needed there as well.
} | ||
|
||
.shw-carbonization-comparison-grid__item--area-hds { | ||
--content-background-color: var(--token-color-surface-primary); |
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.
--content-background-color: var(--token-color-surface-primary); | |
--content-background-color: #fff; |
[Suggestion] I would make this hard-coded. When set to the hds variable, if that hds variable updates to some other themed value based on the global showcase theme set, then the background of the theme example updates as well. Ideally it should be static and not change.

📌 Summary
This PR is the initial scaffolding of the showcase pages that will be used for the dry-run migrations (and subsequent actual migration) of the HDS components (as in theming/re-skinning).
This PR is based on top of #3240.
🛠️ Detailed description
In this PR I have:
<ShwCarbonizationComparisonGrid>
component, used to showcase an HDS component with different themes applied (HDS standard + the four Carbon themesg0
/g10
/g90
/g100
) next to the equivalent Carbon web components for that specific variant/state.showcase/app/index.html
file to include the scripts (and the hiding styles for the not-yet-loaded web components)🔎 How to review
Note
This is not the final implementation, there will be likely things we will want to change/update, once we start to work on the dry-run migrations; these changes will likely be done in follow-up PRs.
Check the different carbonized pages and how they've been implemented (also their organization as single file
.gts
components):Review the implementation of the
<ShwCarbonizationComparisonGrid>
component, and see if the API is clear to you; look also at how it's used across the "carbonized" showcase pagesReview how the Carbon Web components are instantiated in the code, and how Carbon theming is applied to them
Note: at the moment there's an open conversation about how to use the
cds-icon
web component in an Ember app, that has not been resolved yet, so we're using theHdsIcon
component instead👉 👉 👉 Previews:
🛠️ How to test
Note
At the moment the HDS component look the same for the different themes, because the underlying design tokens are all the same; once we start the dry-run migrations (in a follow-up PR) they will start to (should) look more and more like the equivalent Carbon web components shown below
Open the different "carbonized" pages and see how the HDS components are rendered, and how the Carbon Web components are rendered
🗒️ TODOs
showcase/app/index.html
file, but importing and instantiating them using the npm packages/dependencies.🔗 External links
Jira ticket: https://hashicorp.atlassian.net/browse/HDS-5533
👀 Component checklist
A changelog entry was added via Changesets if needed (see templates here)💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.