-
Notifications
You must be signed in to change notification settings - Fork 50
[03] [Project Solar / Phase 1 / Themed CSS for HDS components] Rollup configuration and Sass processing for multiple files #3259
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 reorganizes the Sass architecture for the Helios Design System components to support theming capabilities. It creates a foundation for generating multiple CSS builds with different theming strategies while maintaining the existing component functionality.
Key changes:
- Reorganizes Sass files to separate common components from theming-specific configurations
- Updates Rollup configuration to support multiple CSS output files with custom SCSS compilation
- Creates new themed CSS variants using CSS selectors and prefers-color-scheme approaches
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/components/src/styles/components/index.scss |
New centralized index file importing all component SCSS files |
packages/components/src/styles/@hashicorp/design-system-components.scss |
Refactored to use new components index and updated token paths |
packages/components/src/styles/@hashicorp/design-system-components-theming-with-prefers-color-scheme.scss |
New themed variant using prefers-color-scheme media queries |
packages/components/src/styles/@hashicorp/design-system-components-theming-with-css-selectors.scss |
New themed variant using CSS selectors |
packages/components/rollup.config.mjs |
Updated with custom SCSS compilation function and multiple output configurations |
75bc4b6 to
b258e2e
Compare
1803ce4 to
66b876e
Compare
67f8499 to
d4cd0c3
Compare
66b876e to
1a855c1
Compare
6251490 to
bb949c9
Compare
1a855c1 to
57ea7fa
Compare
bb949c9 to
88f8368
Compare
KristinLBradley
left a comment
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.
Added a comment RE some linter complaints in generated dist files: #3259 (comment) and one suggested fix for a typo in a comment. Otherwise, looks good!
@KristinLBradley these are compiled files, there's not much we can do (as you mentioned, they're generated in the |
โฆadded custom source files for theming + updated rollup config to process different files
โฆth output from `rollup-plugin-scss`
โฆles to CSS files
โฆer-cli-build.js`
โฆ to new custom plugin
โฆugin for every Scss compilation)
โฆvalidate that all the new CSS files are generated too
โฆ for old CSS files that donโt exist anymore)
โฆtion, per code review suggestion #3259 (comment)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
โฆents.scss Co-authored-by: Kristin Bradley <kristin.bradley@hashicorp.com>
2d244fd to
053e6de
Compare
1864883
into
project-solar/phase-1/HDS-5216_modes/modes-feature-branch


๐ Summary
This is built on top of #3239 and is based on the initial spike done by @alex-ju in #3235
๐ ๏ธ Detailed description
In this PR I have:
packages/components/src/styles/components/index.scss)design-system-components.css- current file for HDS componentsdesign-system-components-common.css- new file for themingThen, after discussion and agreement with @alex-ju, I have moved also the existing compilation of the
design-system-components.scssanddesign-system-power-select-overrides.scssfiles to our custom plugin, so we can removerollup-plugin-scssas dev-dependencydesign-system-power-select-overrides.scssis not only copied in thedistfolder, but also compiled to.css(and a.mapfile is generated)๐ How to review
You can look at the single commits, to see the sequence of steps and understand the explorations and thinking behind the PR, or you can look directly at the files, checking how the Scss files have been organized, how the Rollup plugin function has been implemented, and how the path for the
includedeclarations have been updated to make it more obvious where a file was coming from.๐ ๏ธ How to test
Check out the branch, delete the
distfolder underpackages/components, run the commandpnpm buildorpnpm start, and see how different files are copied/generated underpackages/components/dist/styles/@hashicorp(source Scss files, compiled CSS files, map files)You can also go one step further, and update (or add) some design tokens, run the
pnpm buildcommand in thepackages/tokensfolder, and then run the commandpnpm buildin thepackages/componentsfolder and see how the tokens changes are reflected in the generated CSS files for the components:$modesare changed, the filepackages/components/dist/styles/@hashicorp/design-system-components.cssshould remain untouched$valueis changed, the filepackages/components/dist/styles/@hashicorp/design-system-components.cssshould be updated too (the CSS variable corresponding to the token that was changed)๐ External links
Jira ticket: https://hashicorp.atlassian.net/browse/HDS-5505
๐ 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.