@utrecht/design-tokens 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.stylelintrc.json +5 -1
  2. package/CHANGELOG.md +14 -0
  3. package/config.json +8 -0
  4. package/dist/_mixin-theme.scss +64 -55
  5. package/dist/_mixin.scss +1011 -0
  6. package/dist/_variables.scss +64 -55
  7. package/dist/background-image-icon.css +0 -1
  8. package/dist/dark/_mixin-theme.scss +64 -55
  9. package/dist/dark/_mixin.scss +1022 -0
  10. package/dist/dark/_variables.scss +1019 -0
  11. package/dist/dark/index.cjs +1022 -0
  12. package/dist/dark/index.css +64 -55
  13. package/dist/dark/index.d.ts +1143 -0
  14. package/dist/dark/index.flat.json +1018 -0
  15. package/dist/dark/index.json +30708 -0
  16. package/dist/dark/index.mjs +1020 -0
  17. package/dist/dark/index.tokens.json +7790 -0
  18. package/dist/dark/list.json +30708 -0
  19. package/dist/dark/property.css +703 -0
  20. package/dist/dark/root.css +546 -537
  21. package/dist/dark/theme-prince-xml.css +1022 -0
  22. package/dist/dark/theme.css +1022 -0
  23. package/dist/dark/tokens.cjs +37484 -0
  24. package/dist/dark/tokens.d.ts +4792 -0
  25. package/dist/dark/tokens.json +37480 -0
  26. package/dist/dark/variables.cjs +1022 -0
  27. package/dist/dark/variables.css +1022 -0
  28. package/dist/dark/variables.d.ts +1143 -0
  29. package/dist/dark/variables.json +1018 -0
  30. package/dist/dark/variables.less +1019 -0
  31. package/dist/dark/variables.mjs +1020 -0
  32. package/dist/index.cjs +67 -58
  33. package/dist/index.css +131 -118
  34. package/dist/index.d.ts +59 -47
  35. package/dist/index.flat.json +607 -597
  36. package/dist/index.json +7028 -7230
  37. package/dist/index.mjs +67 -58
  38. package/dist/index.tokens.json +2170 -911
  39. package/dist/list.json +31825 -0
  40. package/dist/property.css +768 -0
  41. package/dist/root.css +541 -532
  42. package/dist/theme-prince-xml.css +64 -55
  43. package/dist/theme.css +541 -532
  44. package/dist/tokens.cjs +10583 -9537
  45. package/dist/tokens.d.ts +609 -249
  46. package/dist/tokens.json +38622 -0
  47. package/dist/variables.cjs +1011 -0
  48. package/dist/variables.css +1011 -0
  49. package/dist/variables.d.ts +1132 -0
  50. package/dist/variables.json +1007 -0
  51. package/dist/variables.less +64 -55
  52. package/dist/variables.mjs +1009 -0
  53. package/package.json +6 -5
  54. package/src/background-image-icon.scss +0 -1
  55. package/src/brand/utrecht/typography.tokens.json +9 -9
  56. package/src/component/of/progress-indicator.tokens.json +1 -1
  57. package/src/component/utrecht/accordion.tokens.json +1 -0
  58. package/src/component/utrecht/backdrop.tokens.json +1 -1
  59. package/src/component/utrecht/blockquote.tokens.json +3 -3
  60. package/src/component/utrecht/button.tokens.json +1 -3
  61. package/src/component/utrecht/code-block.tokens.json +2 -2
  62. package/src/component/utrecht/figure.tokens.json +2 -2
  63. package/src/component/utrecht/form-fieldset.tokens.json +2 -2
  64. package/src/component/utrecht/form-toggle.tokens.json +1 -1
  65. package/src/component/utrecht/link.tokens.json +3 -1
  66. package/src/component/utrecht/number-badge.tokens.json +23 -0
  67. package/src/component/utrecht/pagination.tokens.json +1 -1
  68. package/src/component/utrecht/skip-link.tokens.json +4 -2
  69. package/src/component/utrecht/spotlight-section.tokens.json +8 -0
  70. package/src/component/utrecht/table.tokens.json +1 -1
  71. package/src/component/utrecht/textarea.tokens.json +1 -0
  72. package/src/component/utrecht/toptask-link.tokens.json +1 -1
  73. package/src/css-property-formatter.mjs +46 -0
  74. package/src/dark/component/tokens.json +1 -1
  75. package/src/index.scss +2 -5
  76. package/style-dictionary-build-dark.mjs +64 -0
  77. package/style-dictionary-build.mjs +41 -0
  78. package/style-dictionary-config.mjs +261 -0
  79. package/dist/figma-tokens.json +0 -36582
  80. package/src/css-property-formatter.js +0 -35
  81. package/src/style-dictionary-config-dark.js +0 -56
  82. package/src/style-dictionary-config.js +0 -63
  83. package/style-dictionary.config.json +0 -143
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "2.1.1",
3
3
  "author": "Community for NL Design System",
4
4
  "description": "Design Tokens for the Municipality of Utrecht based on the NL Design System architecture",
5
5
  "license": "SEE LICENSE IN ./LICENSE.md",
@@ -17,7 +17,7 @@
17
17
  "directory": "proprietary/design-tokens"
18
18
  },
19
19
  "devDependencies": {
20
- "@divriots/style-dictionary-to-figma": "0.4.0",
20
+ "@tokens-studio/sd-transforms": "1.2.3",
21
21
  "chokidar-cli": "3.0.0",
22
22
  "glob": "10.4.2",
23
23
  "lodash.isplainobject": "4.0.6",
@@ -26,15 +26,16 @@
26
26
  "regex-trie": "1.0.4",
27
27
  "rimraf": "5.0.7",
28
28
  "sass": "1.69.5",
29
- "style-dictionary": "4.0.0-prerelease.8"
29
+ "style-dictionary": "4.0.1"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "pnpm run build:style-dictionary && pnpm run build:scss",
33
33
  "build:scss": "sass --no-source-map src/:dist/",
34
34
  "build:style-dictionary": "pnpm run '/^build:style-dictionary:.*/'",
35
- "build:style-dictionary:default": "style-dictionary build --config src/style-dictionary-config.js",
36
- "build:style-dictionary:dark": "style-dictionary build --config src/style-dictionary-config-dark.js",
35
+ "build:style-dictionary:default": "node ./style-dictionary-build.mjs",
36
+ "build:style-dictionary:dark": "node ./style-dictionary-build-dark.mjs",
37
37
  "build:stylelint": "node ./build-stylelint.mjs",
38
+ "lint-build": "stylelint dist/*.css",
38
39
  "clean": "rimraf dist/",
39
40
  "watch": "pnpm run --parallel '/^watch:.*/'",
40
41
  "watch:style-dictionary": "chokidar --follow-symlinks --initial --command 'pnpm run build' 'src/**/*.tokens.json'"
@@ -7,7 +7,6 @@
7
7
  .utrecht-theme,
8
8
  .utrecht-theme ::backdrop {
9
9
  --utrecht-menulijst-item-background-image: url("./pijltje.svg");
10
- --utrecht-link-icon-left-background-image: url("./pijltje.svg");
11
10
  --utrecht-search-bar-input-background-image: url("./icoon-zoek-rood.svg");
12
11
  --utrecht-select-background-image: url("./arrow-dropdown.svg");
13
12
  --utrecht-link-list-marker-background-image: url("./pijltje-zwart.svg");
@@ -5,15 +5,15 @@
5
5
  "font-family": { "value": "\"Lucida Grande\", \"Lucida Sans Unicode\", \"Lucida Sans\", \"Arial\", sans-serif" }
6
6
  },
7
7
  "scale": {
8
- "2xs": { "font-size": { "value": "0.5rem", "comment": "8px" } },
9
- "xs": { "font-size": { "value": "0.75rem", "comment": "12px" } },
10
- "sm": { "font-size": { "value": "0.875rem", "comment": "14px" } },
11
- "md": { "font-size": { "value": "1rem", "comment": "16px" } },
12
- "lg": { "font-size": { "value": "1.125rem", "comment": "18px" } },
13
- "xl": { "font-size": { "value": "1.25rem", "comment": "20px" } },
14
- "2xl": { "font-size": { "value": "1.375rem", "comment": "22px" } },
15
- "3xl": { "font-size": { "value": "1.5rem", "comment": "24px" } },
16
- "4xl": { "font-size": { "value": "2rem", "comment": "32px" } }
8
+ "2xs": { "font-size": { "value": "8px", "comment": "8px" } },
9
+ "xs": { "font-size": { "value": "12px", "comment": "12px" } },
10
+ "sm": { "font-size": { "value": "14px", "comment": "14px" } },
11
+ "md": { "font-size": { "value": "16px", "comment": "16px" } },
12
+ "lg": { "font-size": { "value": "18px", "comment": "18px" } },
13
+ "xl": { "font-size": { "value": "20px", "comment": "20px" } },
14
+ "2xl": { "font-size": { "value": "22px", "comment": "22px" } },
15
+ "3xl": { "font-size": { "value": "24px", "comment": "24px" } },
16
+ "4xl": { "font-size": { "value": "32px", "comment": "32px" } }
17
17
  },
18
18
  "weight-scale": {
19
19
  "bold": { "font-weight": { "value": "700" } },
@@ -3,7 +3,7 @@
3
3
  "progress-indicator": {
4
4
  "background-color": { "value": "{utrecht.document.background-color}" },
5
5
  "mobile": {
6
- "box-shadow": { "value": "0px 0px 2px 0px rgba(0, 0, 0, 0.2)" }
6
+ "box-shadow": { "value": "0px 0px 2px 0px rgba(0 0 0 / 20%)" }
7
7
  }
8
8
  }
9
9
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "utrecht": {
3
3
  "accordion": {
4
+ "row-gap": { "value": "{utrecht.space.block.xs}" },
4
5
  "section": {
5
6
  "margin-block-start": { "value": "{utrecht.space.block.2xs}" },
6
7
  "margin-block-end": {}
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "fade-in": {
14
14
  "animation-duration": {
15
- "value": "0.4s"
15
+ "value": "400ms"
16
16
  }
17
17
  },
18
18
  "reduced-transparency": {
@@ -12,13 +12,13 @@
12
12
  "margin-block-start": { "value": "1.6em" },
13
13
  "margin-block-end": { "value": "1.6em" },
14
14
  "font-size": {},
15
- "attribution": {
15
+ "caption": {
16
16
  "color": {},
17
- "font-size": { "value": "0.75rem" }
17
+ "font-size": { "value": "{utrecht.typography.scale.xs.font-size}" }
18
18
  },
19
19
  "content": {
20
20
  "color": { "value": "{utrecht.color.red.40}" },
21
- "font-size": { "value": "1.125rem" }
21
+ "font-size": { "value": "{utrecht.typography.scale.lg.font-size}" }
22
22
  }
23
23
  }
24
24
  }
@@ -6,6 +6,7 @@
6
6
  "border-radius": { "value": "0" },
7
7
  "border-width": { "value": "1px" },
8
8
  "color": { "value": "{utrecht.color.grey.40}" },
9
+ "column-gap": { "value": "{utrecht.space.text.xs}" },
9
10
  "font-family": { "value": "{utrecht.typography.sans-serif.font-family}" },
10
11
  "font-size": { "value": "{utrecht.typography.scale.md.font-size}" },
11
12
  "padding-inline-start": { "value": "{utrecht.space.inline.md}" },
@@ -16,9 +17,6 @@
16
17
  "margin-inline-end": { "value": "0" },
17
18
  "margin-block-start": { "value": "{utrecht.space.row.xs}" },
18
19
  "margin-block-end": { "value": "{utrecht.space.row.xs}" },
19
- "icon": {
20
- "gap": { "value": "{utrecht.space.text.xs}" }
21
- },
22
20
  "active": {
23
21
  "background-color": { "value": "{utrecht.color.grey.40}" },
24
22
  "color": { "value": "{utrecht.color.white}" }
@@ -4,8 +4,8 @@
4
4
  "background-color": { "value": "{utrecht.color.grey.95}" },
5
5
  "color": { "value": "{utrecht.color.black}" },
6
6
  "font-family": {},
7
- "font-size": { "value": "16px" },
8
- "line-height": { "value": "24px" },
7
+ "font-size": { "value": "{utrecht.typography.scale.md.font-size}" },
8
+ "line-height": { "value": "{utrecht.typography.line-height.md}" },
9
9
  "margin-block-end": { "value": "{utrecht.space.block.lg}" },
10
10
  "margin-block-start": { "value": "{utrecht.space.block.lg}" },
11
11
  "margin-inline-end": {},
@@ -5,8 +5,8 @@
5
5
  "margin-block-start": {},
6
6
  "caption": {
7
7
  "color": { "value": "#727272" },
8
- "font-size": { "value": "14px" },
9
- "line-height": { "value": "20px" }
8
+ "font-size": { "value": "{utrecht.typography.scale.sm.font-size}" },
9
+ "line-height": { "value": "{utrecht.typography.line-height.md}" }
10
10
  }
11
11
  }
12
12
  }
@@ -10,9 +10,9 @@
10
10
  "legend": {
11
11
  "color": {},
12
12
  "font-family": {},
13
- "font-size": { "value": "1rem" },
13
+ "font-size": { "value": "{utrecht.typography.scale.md.font-size}" },
14
14
  "font-weight": { "value": "{utrecht.typography.weight-scale.bold.font-weight}" },
15
- "line-height": { "value": "1.4" },
15
+ "line-height": { "value": "{utrecht.typography.line-height.md}" },
16
16
  "margin-block-end": { "value": "{utrecht.space.block.sm}" },
17
17
  "margin-block-start": { "value": "{utrecht.space.block.xl}" },
18
18
  "disabled": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "utrecht": {
3
3
  "form-toggle": {
4
- "accent-color": { "value": "hsla(0, 0%, 48%, 1)" },
4
+ "accent-color": { "value": "hsla(0 0% 48% / 100%)" },
5
5
  "background-color": { "value": "{utrecht.color.white}" },
6
6
  "border-color": { "value": "transparent" },
7
7
  "border-radius": { "value": "10em" },
@@ -12,7 +12,9 @@
12
12
  "color": { "value": "{utrecht.link.color}" }
13
13
  },
14
14
  "focus": {
15
- "color": { "value": "{utrecht.color.blue.40}" },
15
+ "color": { "value": "{utrecht.color.blue.40}" }
16
+ },
17
+ "focus-visible": {
16
18
  "text-decoration": { "value": "none" }
17
19
  },
18
20
  "hover": {
@@ -0,0 +1,23 @@
1
+ {
2
+ "utrecht": {
3
+ "number-badge": {
4
+ "background-color": {
5
+ "value": "{utrecht.color.red.40}"
6
+ },
7
+ "border-radius": {
8
+ "value": "{utrecht.number-badge.font-size}"
9
+ },
10
+ "color": {
11
+ "value": "{utrecht.color.white}"
12
+ },
13
+ "font-size": { "value": "{utrecht.typography.scale.md.font-size}" },
14
+ "font-weight": {},
15
+ "padding-block": {
16
+ "value": "1ex"
17
+ },
18
+ "padding-inline": {
19
+ "value": "1ex"
20
+ }
21
+ }
22
+ }
23
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "utrecht": {
3
3
  "pagination": {
4
- "font-size": { "value": "14px" },
4
+ "font-size": { "value": "{utrecht.typography.scale.sm.font-size}" },
5
5
  "font-family": {},
6
6
  "margin-block-start": { "value": "0" },
7
7
  "margin-block-end": { "value": "1em" },
@@ -10,8 +10,10 @@
10
10
  "text-decoration": { "value": "{utrecht.link.text-decoration}" },
11
11
  "focus": {
12
12
  "color": { "value": "{utrecht.topnav.link.focus.color}" },
13
- "background-color": { "value": "{utrecht.topnav.link.focus.background-color}" },
14
- "text-decoration": { "value": "{utrecht.link.focus.text-decoration}" }
13
+ "background-color": { "value": "{utrecht.topnav.link.focus.background-color}" }
14
+ },
15
+ "focus-visible": {
16
+ "text-decoration": { "value": "{utrecht.link.focus-visible.text-decoration}" }
15
17
  }
16
18
  }
17
19
  }
@@ -18,6 +18,14 @@
18
18
  "warning": {
19
19
  "background-color": { "value": "{utrecht.color.yellow.80}" },
20
20
  "color": {}
21
+ },
22
+ "error": {
23
+ "background-color": { "value": "{utrecht.color.red.95}" },
24
+ "color": {}
25
+ },
26
+ "ok": {
27
+ "background-color": { "value": "{utrecht.color.green.90}" },
28
+ "color": {}
21
29
  }
22
30
  }
23
31
  }
@@ -4,7 +4,7 @@
4
4
  "margin-block-start": { "value": "{utrecht.space.block.md}" },
5
5
  "margin-block-end": { "value": "0" },
6
6
  "caption": {
7
- "font-size": { "value": "1.125em" },
7
+ "font-size": { "value": "{utrecht.typography.scale.lg.font-size}" },
8
8
  "font-weight": { "value": "{utrecht.typography.weight-scale.bold.font-weight}" },
9
9
  "font-family": {},
10
10
  "color": {},
@@ -2,6 +2,7 @@
2
2
  "utrecht": {
3
3
  "textarea": {
4
4
  "border-bottom-width": { "value": "3px" },
5
+ "border-block-end-width": { "value": "3px" },
5
6
  "line-height": { "value": "{utrecht.typography.line-height.md}" },
6
7
  "disabled": {
7
8
  "border-color": {},
@@ -3,7 +3,7 @@
3
3
  "toptask-link": {
4
4
  "background-color": { "value": "{utrecht.button.primary-action.background-color}" },
5
5
  "color": { "value": "{utrecht.button.primary-action.color}" },
6
- "font-size": { "value": "1rem" },
6
+ "font-size": { "value": "{utrecht.typography.scale.md.font-size}" },
7
7
  "line-height": { "value": "1.2" },
8
8
  "min-block-size": { "value": "8.25rem" },
9
9
  "min-inline-size": { "value": "15rem" },
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license EUPL-1.2
3
+ * Copyright (c) 2021 Robbert Broersma
4
+ */
5
+
6
+ const stringSort = (a, b) => (a === b ? 0 : a > b ? 1 : -1);
7
+
8
+ export const propertyFormatter = function ({ dictionary }) {
9
+ let { allTokens } = dictionary;
10
+
11
+ // https://drafts.css-houdini.org/css-properties-values-api/#the-css-property-rule-interface
12
+ const css = allTokens
13
+ .sort((tokenA, tokenB) => stringSort(tokenA.name, tokenB.name))
14
+ .filter(
15
+ (token) =>
16
+ token['$extensions'] &&
17
+ token['$extensions']['nl.nldesignsystem.css.property'] &&
18
+ token['$extensions']['nl.nldesignsystem.css.property'].syntax !== '*' &&
19
+ typeof token['$extensions']['nl.nldesignsystem.css.property'].inherits === 'boolean',
20
+ )
21
+ .map((token) => {
22
+ let str = `@property --${token.name} { `;
23
+ const cssProperty = token['$extensions']['nl.nldesignsystem.css.property'];
24
+
25
+ const syntax = Array.isArray(cssProperty.syntax) ? cssProperty.syntax.join(' | ') : cssProperty.syntax;
26
+
27
+ str += `syntax: '${syntax}'; `;
28
+
29
+ str += `inherits: ${cssProperty.inherits}; `;
30
+
31
+ if (cssProperty.initialValue) {
32
+ str += `initial-value: ${cssProperty.initialValue}; `;
33
+ }
34
+
35
+ str += `}`;
36
+
37
+ return str;
38
+ })
39
+ .join('\n');
40
+
41
+ return css;
42
+ };
43
+
44
+ export const propertyFormatterHooksConfig = {
45
+ 'css/property': propertyFormatter,
46
+ };
@@ -215,7 +215,7 @@
215
215
  }
216
216
  },
217
217
  "form-toggle": {
218
- "accent-color": { "value": "hsla(0, 0%, 48%, 1)" },
218
+ "accent-color": { "value": "hsla(0 0% 48% / 100%)" },
219
219
  "background-color": { "value": "{utrecht.color.white}" },
220
220
  "border-color": { "value": "transparent" },
221
221
  "color": { "value": "{utrecht.color.black}" },
package/src/index.scss CHANGED
@@ -11,8 +11,7 @@
11
11
 
12
12
  @import "./responsive";
13
13
 
14
- .utrecht-theme,
15
- .utrecht-theme ::backdrop {
14
+ .utrecht-theme {
16
15
  @include utrecht-theme;
17
16
 
18
17
  utrecht-page-footer,
@@ -27,9 +26,7 @@
27
26
 
28
27
  @media (prefers-color-scheme: dark) {
29
28
  .utrecht-theme--media-query,
30
- .utrecht-theme--media-query ::backdrop,
31
- .utrecht-theme--media-query-color-scheme,
32
- .utrecht-theme--media-query-color-scheme ::backdrop {
29
+ .utrecht-theme--media-query-color-scheme {
33
30
  @include utrecht-theme--dark;
34
31
  }
35
32
  }
@@ -0,0 +1,64 @@
1
+ import { register } from '@tokens-studio/sd-transforms';
2
+ import StyleDictionary from 'style-dictionary';
3
+ import { typeDtcgDelegate } from 'style-dictionary/utils';
4
+ import { readFile } from 'node:fs/promises';
5
+ import { createStyleDictionaryConfig } from './style-dictionary-config.mjs';
6
+
7
+ const build = async () => {
8
+ const themeConfig = JSON.parse(await readFile('./config.json', 'utf-8'));
9
+ StyleDictionary.registerPreprocessor({
10
+ name: 'dtcg-delegate',
11
+ preprocessor: typeDtcgDelegate,
12
+ });
13
+
14
+ register(StyleDictionary, {
15
+ // TODO: Enable `excludeParentKeys` when Figma is the source of design tokens
16
+ // excludeParentKeys: true,
17
+ });
18
+
19
+ const config = {
20
+ ...createStyleDictionaryConfig({
21
+ themeName: `${themeConfig.prefix}-theme--dark`,
22
+ }),
23
+ log: 'warn',
24
+ preprocessors: ['tokens-studio', 'dtcg-delegate'],
25
+ source: [
26
+ '../../components/**/tokens.json',
27
+ '../../components/**/*.tokens.json',
28
+ './src/brand/tokens.json',
29
+ './src/brand/**/*.tokens.json',
30
+ './src/common/tokens.json',
31
+ './src/common/**/*.tokens.json',
32
+ './src/component/tokens.json',
33
+ './src/component/**/*.tokens.json',
34
+
35
+ // Additional dark theme tokens
36
+ './src/dark/tokens.json',
37
+ './src/dark/*.tokens.json',
38
+ './src/dark/**/tokens.json',
39
+ './src/dark/**.tokens.json',
40
+ ],
41
+ };
42
+
43
+ Object.values(config.platforms).forEach((platform) => {
44
+ platform.buildPath = 'dist/dark/';
45
+
46
+ if (Array.isArray(platform.files)) {
47
+ platform.files.forEach((file) => {
48
+ if (file.destination === 'variables.css') {
49
+ file.options.selector = '.utrecht-theme--dark, .utrecht-theme--dark ::backdrop';
50
+ }
51
+ if (file.destination === '_mixin.scss') {
52
+ file.options.selector = '@mixin utrecht-theme--dark';
53
+ }
54
+ });
55
+ }
56
+ });
57
+
58
+ const sd = new StyleDictionary(config);
59
+
60
+ await sd.cleanAllPlatforms();
61
+ await sd.buildAllPlatforms();
62
+ };
63
+
64
+ build();
@@ -0,0 +1,41 @@
1
+ import { register } from '@tokens-studio/sd-transforms';
2
+ import StyleDictionary from 'style-dictionary';
3
+ import { typeDtcgDelegate } from 'style-dictionary/utils';
4
+ import { readFile } from 'node:fs/promises';
5
+ import { createStyleDictionaryConfig } from './style-dictionary-config.mjs';
6
+
7
+ const build = async () => {
8
+ const themeConfig = JSON.parse(await readFile('./config.json', 'utf-8'));
9
+ StyleDictionary.registerPreprocessor({
10
+ name: 'dtcg-delegate',
11
+ preprocessor: typeDtcgDelegate,
12
+ });
13
+
14
+ register(StyleDictionary, {
15
+ // TODO: Enable `excludeParentKeys` when Figma is the source of design tokens
16
+ // excludeParentKeys: true,
17
+ });
18
+
19
+ const sd = new StyleDictionary({
20
+ ...createStyleDictionaryConfig({
21
+ themeName: `${themeConfig.prefix}-theme`,
22
+ }),
23
+ log: 'warn',
24
+ preprocessors: ['tokens-studio', 'dtcg-delegate'],
25
+ source: [
26
+ '../../components/**/tokens.json',
27
+ '../../components/**/*.tokens.json',
28
+ './src/brand/tokens.json',
29
+ './src/brand/**/*.tokens.json',
30
+ './src/common/tokens.json',
31
+ './src/common/**/*.tokens.json',
32
+ './src/component/tokens.json',
33
+ './src/component/**/*.tokens.json',
34
+ ],
35
+ });
36
+
37
+ await sd.cleanAllPlatforms();
38
+ await sd.buildAllPlatforms();
39
+ };
40
+
41
+ build();