Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c7bad46
TODO - added temporary file to main feature branch for phase 1
didoo Sep 25, 2025
71fd7ef
added temporary changeset to feature branch for `$modes` support
didoo Sep 15, 2025
69d5a5c
TEMP - added `$modes` entry to `color.palette.neutral-0`
didoo Sep 15, 2025
ae99955
refactored logic used to provide SD configuration per target
didoo Sep 15, 2025
af2f34e
progress on logic for handling `$modes` - 1
didoo Sep 16, 2025
c0a1e3c
TEMP - added `modes-testing` tokens
didoo Sep 16, 2025
9a55689
TEMP - added `expected-CSS-output` files
didoo Sep 16, 2025
f0c5e94
progress on logic for handling `$modes` - 2
didoo Sep 16, 2025
6cfee07
added `attributes/themeable` transformation
didoo Sep 16, 2025
7cc7853
progress on logic for handling `$modes` - 3
didoo Sep 16, 2025
e8dc4ee
TEMP - used local version of Style Dictionary for debugging
didoo Sep 17, 2025
b5c4125
progress on logic for handling `$modes` - 4
didoo Sep 17, 2025
4cf8fd1
TEMP generated temporary dist files for testing
didoo Sep 16, 2025
2a9547f
TEMP - added examples of generated themed tokens
didoo Sep 19, 2025
76e0358
added logic to generate theming CSS files
didoo Sep 19, 2025
abd9576
REVERT - Removed `modes-testing` tokens
didoo Sep 30, 2025
dc7b2ad
removed `modes-testing` folder from compilation
didoo Sep 30, 2025
8ce296b
added `carbon-extracted` reference in the `source` definitions
didoo Sep 30, 2025
d170478
TEMP - added `$modes` entries for some color and typography tokens, w…
didoo Sep 30, 2025
930f57b
changed `outputReferences` to `false` (temporary) to bypass issue wit…
didoo Sep 30, 2025
d891405
added commented code to `build` to use for debugging issue with missi…
didoo Sep 30, 2025
39319d6
added two new themed tokens generated files, for Scss mixins and for …
didoo Oct 2, 2025
4ead7dc
fixed issue with `cds` naming missing the `g`
didoo Oct 7, 2025
b7c4007
fixed some issues with how the “extra” themed CSS files were generated
didoo Oct 7, 2025
81268fe
TEMP - Re-generated tokens
didoo Sep 30, 2025
b3cf42c
REVERT - used local version of Style Dictionary for debugging
didoo Oct 9, 2025
4b23415
REVERT - added examples of generated themed tokens
didoo Oct 9, 2025
46676c3
REVERT - added `expected-CSS-output` files
didoo Oct 9, 2025
07c1b7f
fixed wrong check for existence of key in object (`0` values would tr…
didoo Oct 27, 2025
30467ec
added `.hds-theme-light/dark` and `[data-hds-theme=“light/dark”]` to …
didoo Oct 27, 2025
f0fb471
re-generated themed tokens
didoo Oct 27, 2025
507c06b
updated generation of tokens’ CSS helpers to use CSS variables for `f…
didoo Oct 27, 2025
d5252d4
re-generated CSS helper files
didoo Oct 27, 2025
2d7deb2
updated generation of extra CSS files to include `.hds-theme-hds/[dat…
didoo Oct 28, 2025
980383a
updated design tokens pipeline to generate a `themed-tokens.json` fil…
didoo Oct 28, 2025
19ff901
re-generated themed tokens
didoo Oct 27, 2025
c1fc24e
updated “src” files to replace `hds` key with `default` in `$modes` d…
didoo Nov 6, 2025
4396bb0
updated logic to replace `hds` key with `default` in `$modes` definit…
didoo Nov 6, 2025
abd1393
re-generated tokens in `dist` folder
didoo Nov 6, 2025
c382225
tweaked logic for CSS selectors for `@media (prefers-color-scheme)` t…
didoo Nov 7, 2025
54be4e6
re-generated tokens in `dist` folder
didoo Nov 7, 2025
32f0fcc
updated generation of extra theming CSS files to avoid CSS variables …
didoo Nov 12, 2025
ac1217c
updated generation of extra theming CSS files to differentiate betwee…
didoo Nov 14, 2025
5039a0f
re-generated tokens in `dist` folder
didoo Nov 14, 2025
5108db5
removed `[data-hds-theme]` CSS selectors for simplicity
didoo Nov 17, 2025
20b962d
re-generated tokens in `dist` folder
didoo Nov 17, 2025
f9c268b
updated logic for generation of extra “themed” CSS files (removed `pr…
didoo Nov 18, 2025
5c338f4
re-generated tokens in `dist` folder
didoo Nov 18, 2025
11877e7
small tweakings before code review
didoo Nov 20, 2025
f8caa0f
renamed `generateExtra***` to `generate***`
didoo Nov 20, 2025
9e45b40
updated comment
didoo Nov 21, 2025
4e131af
Draft a custom plugin to compile the themed SCSS
alex-ju Sep 24, 2025
1ced1d2
updated SCSS files organization for components (split common part) + …
didoo Sep 26, 2025
d416e7f
added support for source maps for generated themed CSS files
didoo Sep 29, 2025
2935a3d
TEMP - Added generation of “alt” CSS for HDS components to compare wi…
didoo Sep 30, 2025
423b892
abstracted logic for custom Rollup plugin to compile multiple Sass fi…
didoo Sep 30, 2025
aeac349
updated `includePaths` for design tokens in Showcase and Website `emb…
didoo Sep 30, 2025
fc45c2f
moved compilation of existing Scss files for components and overrides…
didoo Sep 30, 2025
394a058
removed `rollup-plugin-scss` dev dependency (we use our own custom pl…
didoo Sep 30, 2025
909e008
added CSS compilation for `combined-strategies` tokens
didoo Oct 2, 2025
5c22feb
updated the `prePublish` script in `package.json` of `components` to …
didoo Oct 15, 2025
24c9c9b
simplified architecture of CSS compilation for HDS components (as agr…
didoo Oct 24, 2025
16f51cb
fixed `prepublisOnly` script that was causing error in build (looking…
didoo Oct 24, 2025
afb6e3f
updated `cssFilePath` in blueprints to reflect new Scss file organiza…
didoo Oct 29, 2025
2fa10f4
Apply suggestions from code review
didoo Nov 20, 2025
053e6de
Update packages/components/src/styles/@hashicorp/design-system-compon…
didoo Nov 21, 2025
b883034
Merge pull request #3239 from hashicorp/project-solar/phase-1/HDS-521…
didoo Nov 25, 2025
1864883
Merge pull request #3259 from hashicorp/project-solar/phase-1/HDS-550…
didoo Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/tough-cows-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@hashicorp/design-system-tokens": major
---

MODES - TODOs

- Decide if this is a `major` or a `minor`
- Add a proper changeset entry here
1 change: 1 addition & 0 deletions DELETE-ME.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETE ME!
6 changes: 4 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"start": "rollup --config --watch --environment development",
"prepublishOnly": "pnpm build && test -f 'dist/styles/@hashicorp/design-system-components.css' || (echo \"\n\\033[31m⚠️ Error: the pre-compiled CSS file \\`dist/styles/@hashicorp/design-system-components.css\\` was not found\\033[0m\\n\" && exit 1)"
"test-f:design-system-components": "test -f 'dist/styles/@hashicorp/design-system-components.css' || (echo \"\n\\033[31m⚠️ Error: the pre-compiled CSS file \\`dist/styles/@hashicorp/design-system-components.css\\` was not found\\033[0m\\n\" && exit 1)",
"test-f:design-system-components-common": "test -f 'dist/styles/@hashicorp/design-system-components-common.css' || (echo \"\n\\033[31m⚠️ Error: the pre-compiled CSS file \\`dist/styles/@hashicorp/design-system-components-common.css\\` was not found\\033[0m\\n\" && exit 1)",
"test-f:design-system-power-select-overrides": "test -f 'dist/styles/@hashicorp/design-system-power-select-overrides.css' || (echo \"\n\\033[31m⚠️ Error: the pre-compiled CSS file \\`dist/styles/@hashicorp/design-system-power-select-overrides.css\\` was not found\\033[0m\\n\" && exit 1)",
"prepublishOnly": "pnpm build && pnpm test-f:design-system-components && pnpm test-f:design-system-components-common && pnpm test-f:design-system-power-select-overrides"
},
"dependencies": {
"@codemirror/commands": "^6.8.0",
Expand Down Expand Up @@ -112,7 +115,6 @@
"prettier-plugin-ember-template-tag": "^2.0.5",
"rollup": "^4.39.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-scss": "^4.0.1",
"stylelint": "^16.17.0",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-standard-scss": "^14.0.0",
Expand Down
73 changes: 56 additions & 17 deletions packages/components/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,57 @@
import { Addon } from '@embroider/addon-dev/rollup';
import { babel } from '@rollup/plugin-babel';
import copy from 'rollup-plugin-copy';
import scss from 'rollup-plugin-scss';
import process from 'process';
import path from 'node:path';
import * as sass from 'sass';

const addon = new Addon({
srcDir: 'src',
destDir: 'dist',
});

// Custom SCSS compilation plugin for Rollup
function addScssCompilationPlugins(options) {
return options.map(({ inputFile, outputFile }) => ({
name: `rollup custom plugin to generate ${outputFile}`,
generateBundle() {
try {
const inputFileFullPath = `src/styles/@hashicorp/${inputFile}`;
const outputFileFullPath = `styles/@hashicorp/${outputFile}`;

const result = sass.compile(inputFileFullPath, {
sourceMap: true,
loadPaths: ['node_modules/@hashicorp/design-system-tokens/dist'],
});

// Emit the compiled CSS
this.emitFile({
type: 'asset',
fileName: outputFileFullPath,
source: result.css,
});

// Emit the source map
if (result.sourceMap) {
this.emitFile({
type: 'asset',
fileName: `${outputFileFullPath}.map`,
source: JSON.stringify(result.sourceMap),
});
}
} catch (error) {
this.error(
`Failed to compile SCSS file "${inputFile}": ${error.message}`
);
}
},
}));
}

const plugins = [
// These are the modules that users should be able to import from your
// addon. Anything not listed here may get optimized away.
addon.publicEntrypoints([
'**/*.{js,ts}',
'index.js',
'template-registry.js',
'styles/@hashicorp/design-system-components.scss',
]),
addon.publicEntrypoints(['**/*.{js,ts}', 'index.js', 'template-registry.js']),

// These are the modules that should get reexported into the traditional
// "app" tree. Things in here should also be in publicEntrypoints above, but
Expand All @@ -50,16 +83,22 @@ const plugins = [
// package names.
addon.dependencies(),

scss({
fileName: 'styles/@hashicorp/design-system-components.css',
includePaths: [
'node_modules/@hashicorp/design-system-tokens/dist/products/css',
],
}),

scss({
fileName: 'styles/@hashicorp/design-system-power-select-overrides.css',
}),
// We use a custom plugin for the Sass/SCSS compilation
// so we can have multiple input and multiple outputs
...addScssCompilationPlugins([
{
inputFile: 'design-system-components.scss',
outputFile: 'design-system-components.css',
},
{
inputFile: 'design-system-components-common.scss',
outputFile: 'design-system-components-common.css',
},
{
inputFile: 'design-system-power-select-overrides.scss',
outputFile: 'design-system-power-select-overrides.css',
},
]),

// Ensure that standalone .hbs files are properly integrated as Javascript.
addon.hbs(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// these files come from `packages/tokens/dist/`
@use "products/css/helpers/color";
@use "products/css/helpers/elevation";
@use "products/css/helpers/focus-ring";
@use "products/css/helpers/typography";

// main components file
@use "../components/index";

// screen-reader utility class
@use "../mixins/screen-reader-only" as *;

// The `.sr-only` utility class visually hides content but keeps it accessible to screen readers for accessibility purposes.
.sr-only {
@include screen-reader-only();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,8 @@
* SPDX-License-Identifier: MPL-2.0
*/

// these files come from the 'design-system-tokens' package
@use "tokens";
@use "helpers/color";
@use "helpers/elevation";
@use "helpers/focus-ring";
@use "helpers/typography";
// these are the "standard" HDS tokens (the file comes from `packages/tokens/dist/`)
@use "products/css/tokens";

// Notice: this list can be automatically edited by the Ember blueprint, please don't remove the start/end comments
// START COMPONENTS CSS FILES IMPORTS
@use "../components/accordion";
@use "../components/advanced-table";
@use "../components/alert";
@use "../components/app-footer";
@use "../components/app-frame";
@use "../components/app-header";
@use "../components/app-side-nav";
@use "../components/application-state";
@use "../components/badge";
@use "../components/badge-count";
@use "../components/breadcrumb";
@use "../components/button";
@use "../components/button-set";
@use "../components/card";
@use "../components/code-block";
@use "../components/code-editor";
@use "../components/copy";
@use "../components/dialog-primitive";
@use "../components/disclosure-primitive";
@use "../components/dismiss-button";
@use "../components/dropdown";
@use "../components/flyout";
@use "../components/form"; // multiple components
@use "../components/icon";
@use "../components/icon-tile";
@use "../components/layout"; // multiple components
@use "../components/link"; // multiple components
@use "../components/menu-primitive";
@use "../components/modal";
@use "../components/page-header";
@use "../components/pagination";
@use "../components/reveal";
@use "../components/rich-tooltip";
@use "../components/segmented-group";
@use "../components/separator";
@use "../components/side-nav";
@use "../components/stepper";
@use "../components/table";
@use "../components/tabs";
@use "../components/tag";
@use "../components/text";
@use "../components/time";
@use "../components/toast";
@use "../components/tooltip";
// END COMPONENT CSS FILES IMPORTS

@use "../mixins/screen-reader-only" as *;
// stylelint-disable-next-line selector-class-pattern
.sr-only {
@include screen-reader-only();
}
// these are the styles specific (and only) for the HDS components
@use "./design-system-components-common";
52 changes: 52 additions & 0 deletions packages/components/src/styles/components/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// Notice: this list can be automatically edited by the Ember blueprint, please don't remove the start/end comments
// START COMPONENTS CSS FILES IMPORTS
@use "./accordion";
@use "./advanced-table";
@use "./alert";
@use "./app-footer";
@use "./app-frame";
@use "./app-header";
@use "./app-side-nav";
@use "./application-state";
@use "./badge";
@use "./badge-count";
@use "./breadcrumb";
@use "./button";
@use "./button-set";
@use "./card";
@use "./code-block";
@use "./code-editor";
@use "./copy";
@use "./dialog-primitive";
@use "./disclosure-primitive";
@use "./dismiss-button";
@use "./dropdown";
@use "./flyout";
@use "./form"; // multiple components
@use "./icon";
@use "./icon-tile";
@use "./layout"; // multiple components
@use "./link"; // multiple components
@use "./menu-primitive";
@use "./modal";
@use "./page-header";
@use "./pagination";
@use "./reveal";
@use "./rich-tooltip";
@use "./segmented-group";
@use "./separator";
@use "./side-nav";
@use "./stepper";
@use "./table";
@use "./tabs";
@use "./tag";
@use "./text";
@use "./time";
@use "./toast";
@use "./tooltip";
// END COMPONENT CSS FILES IMPORTS
8 changes: 4 additions & 4 deletions packages/tokens/dist/devdot/css/helpers/typography.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading