Skip to content

Commit 23c827c

Browse files
committed
feat(design): add new export for the default theme
1 parent 4a40119 commit 23c827c

5 files changed

Lines changed: 24 additions & 5 deletions

File tree

libs/design/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
"./scss/global": {
5858
"sass": "./scss/global.scss"
5959
},
60+
"./scss/theme/default": {
61+
"sass": "./scss/theming/default/_index.scss"
62+
},
6063
"./scss/theme": {
6164
"sass": "./scss/theme.scss"
6265
},
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file only exists for builds inside the Daffodil monorepo. Consumers of
2+
// the published package never load it.
3+
//
4+
// Externally, `@daffodil/design/scss/theme/default` resolves through the `sass`
5+
// condition of the `exports` map in package.json, which points straight at
6+
// `scss/theming/default/_index.scss`.
7+
//
8+
// Inside the monorepo there is no `node_modules/@daffodil/design`, so the
9+
// specifier instead resolves via the root tsconfig `paths` mapping
10+
// (`@daffodil/*` -> `dist/*`). That mapping bypasses `exports` entirely, leaving
11+
// Angular's Sass importer to fall back to joining the remaining specifier
12+
// segments onto the package root verbatim. `scss/theme/default` therefore has to
13+
// exist as a real file for the monorepo apps to resolve it.
14+
15+
@forward '../theming/default';

libs/design/scss/theming/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@forward 'configure-palette';
66
@forward 'create-theme/create-theme';
77
@forward 'light-dark';
8-
@forward 'daff-theme';
8+
@forward './default/index';
99
@forward 'get-palette';
1010
@forward 'get-base-color';
1111
@forward 'get-theme-mode';

libs/design/scss/theming/_daff-theme.scss renamed to libs/design/scss/theming/default/_daff-theme.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@use 'configure-palette';
2-
@use './create-theme/create-theme';
3-
@use 'color-palettes' as palette;
4-
@use '../core';
1+
@use '../configure-palette';
2+
@use '../create-theme/create-theme';
3+
@use '../color-palettes' as palette;
4+
@use '../../core';
55

66
$primary: configure-palette.daff-configure-palette(palette.$daff-blue, 60);
77
$secondary: configure-palette.daff-configure-palette(palette.$daff-purple, 60);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@forward 'daff-theme';

0 commit comments

Comments
 (0)