Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9729199
added `$modes` entry to `color.palette.neutral-0`
didoo Sep 15, 2025
560b40b
refactored logic used to provide SD configuration per target
didoo Sep 15, 2025
807dbc1
progress on logic for handling `$modes` - 1
didoo Sep 16, 2025
e91963c
TEMP - added `modes-testing` tokens
didoo Sep 16, 2025
7462def
TEMP - added `expected-CSS-output` files
didoo Sep 16, 2025
7971ae5
progress on logic for handling `$modes` - 2
didoo Sep 16, 2025
7ceebbf
added `attributes/themeable` transformation
didoo Sep 16, 2025
cc7aece
progress on logic for handling `$modes` - 3
didoo Sep 16, 2025
c9f47de
TEMP - used local version of Style Dictionary for debugging
didoo Sep 17, 2025
8aff3a2
progress on logic for handling `$modes` - 4
didoo Sep 17, 2025
a21bf77
TEMP generated temporary dist files for testing
didoo Sep 16, 2025
fef192f
added examples of generated themed tokens
didoo Sep 19, 2025
94cdd2c
added logic to generate theming CSS files
didoo Sep 19, 2025
3230ae2
REVERT - Removed `modes-testing` tokens
didoo Sep 30, 2025
9ba0f20
removed `modes-testing` folder from compilation
didoo Sep 30, 2025
139fc97
added `carbon-extracted` reference in the `source` definitions
didoo Sep 30, 2025
3ff97d2
TEMP - added `$modes` entries for some color and typography tokens, w…
didoo Sep 30, 2025
604b35e
changed `outputReferences` to `false` (temporary) to bypass issue wit…
didoo Sep 30, 2025
c490d5f
added commented code to `build` to use for debugging issue with missi…
didoo Sep 30, 2025
9bcc21c
added two new themed tokens generated files, for Scss mixins and for …
didoo Oct 2, 2025
b84ec98
fixed issue with `cds` naming missing the `g`
didoo Oct 7, 2025
9c54d11
fixed some issues with how the β€œextra” themed CSS files were generated
didoo Oct 7, 2025
57ea7fa
TEMP - Re-generated tokens
didoo Sep 30, 2025
3ac1bf7
Draft a custom plugin to compile the themed SCSS
alex-ju Sep 24, 2025
ab78469
updated SCSS files organization for components (split common part) + …
didoo Sep 26, 2025
b23ebb1
added support for source maps for generated themed CSS files
didoo Sep 29, 2025
75cffd5
TEMP - Added generation of β€œalt” CSS for HDS components to compare wi…
didoo Sep 30, 2025
9123219
abstracted logic for custom Rollup plugin to compile multiple Sass fi…
didoo Sep 30, 2025
b405a30
updated `includePaths` for design tokens in Showcase and Website `emb…
didoo Sep 30, 2025
38ec393
moved compilation of existing Scss files for components and overrides…
didoo Sep 30, 2025
8978d16
removed `rollup-plugin-scss` dev dependency (we use our own custom pl…
didoo Sep 30, 2025
88f8368
added CSS compilation for `combined-strategies` tokens
didoo Oct 2, 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
},
"pnpm": {
"overrides": {
"ember-composable-helpers": "npm:@nullvoxpopuli/ember-composable-helpers@^5.2.11"
"ember-composable-helpers": "npm:@nullvoxpopuli/ember-composable-helpers@^5.2.11",
"style-dictionary": "file:/Users/cristianorastelli/src/github/style-dictionary-didoo"
},
"patchedDependencies": {
"broccoli-asset-rewrite": "patches/broccoli-asset-rewrite.patch"
Expand Down
1 change: 0 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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
85 changes: 68 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 plugins 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,34 @@ 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-theming-with-css-selectors.scss',
outputFile: 'design-system-components-theming-with-css-selectors.css',
},
{
inputFile:
'design-system-components-theming-with-prefers-color-scheme.scss',
outputFile:
'design-system-components-theming-with-prefers-color-scheme.css',
},
{
inputFile:
'design-system-components-theming-with-combined-strategies.scss',
outputFile:
'design-system-components-theming-with-combined-strategies.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,22 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// these files come from `packages/tokens/dist/`
@use "products/css/themed-tokens/with-combined-strategies/tokens.css";
// TODO understand if these are common/shared or we should have different ones for the themed tokens
@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 *;

.sr-only {
@include screen-reader-only();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// these files come from `packages/tokens/dist/`
@use "products/css/themed-tokens/with-css-selectors/tokens.css";
// TODO understand if these are common/shared or we should have different ones for the themed tokens
@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 *;

.sr-only {
@include screen-reader-only();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// these files come from `packages/tokens/dist/`
@use "products/css/themed-tokens/with-prefers-color-scheme/tokens.css";
// TODO understand if these are common/shared or we should have different ones for the themed tokens
@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 *;

.sr-only {
@include screen-reader-only();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,20 @@
* 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 files come from `packages/tokens/dist/`
@use "products/css/tokens";
// TODO understand if these are common/shared or we should have different ones for the themed tokens
@use "products/css/helpers/color";
@use "products/css/helpers/elevation";
@use "products/css/helpers/focus-ring";
@use "products/css/helpers/typography";

// 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
// main components file
@use "../components/index";

// screen-reader utility class
@use "../mixins/screen-reader-only" as *;
// stylelint-disable-next-line selector-class-pattern

.sr-only {
@include screen-reader-only();
}
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
Loading
Loading