@utrecht/design-tokens 2.1.0 → 2.2.0

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 (79) 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 +34 -37
  5. package/dist/_mixin.scss +1009 -0
  6. package/dist/_variables.scss +34 -37
  7. package/dist/background-image-icon.css +0 -1
  8. package/dist/dark/_mixin-theme.scss +34 -37
  9. package/dist/dark/_mixin.scss +1020 -0
  10. package/dist/dark/_variables.scss +1017 -0
  11. package/dist/dark/index.cjs +1020 -0
  12. package/dist/dark/index.css +34 -37
  13. package/dist/dark/index.d.ts +1139 -0
  14. package/dist/dark/index.flat.json +1016 -0
  15. package/dist/dark/index.json +30694 -0
  16. package/dist/dark/index.mjs +1018 -0
  17. package/dist/dark/index.tokens.json +7885 -0
  18. package/dist/dark/list.json +30694 -0
  19. package/dist/dark/property.css +705 -0
  20. package/dist/dark/root.css +538 -541
  21. package/dist/dark/theme-prince-xml.css +1020 -0
  22. package/dist/dark/theme.css +1020 -0
  23. package/dist/dark/tokens.cjs +37567 -0
  24. package/dist/dark/tokens.d.ts +4842 -0
  25. package/dist/dark/tokens.json +37563 -0
  26. package/dist/dark/variables.cjs +1020 -0
  27. package/dist/dark/variables.css +1020 -0
  28. package/dist/dark/variables.d.ts +1139 -0
  29. package/dist/dark/variables.json +1016 -0
  30. package/dist/dark/variables.less +1017 -0
  31. package/dist/dark/variables.mjs +1018 -0
  32. package/dist/index.cjs +29 -32
  33. package/dist/index.css +149 -82
  34. package/dist/index.d.ts +18 -25
  35. package/dist/index.flat.json +591 -593
  36. package/dist/index.json +4577 -7587
  37. package/dist/index.mjs +31 -34
  38. package/dist/index.tokens.json +385 -71
  39. package/dist/list.json +31811 -0
  40. package/dist/property.css +770 -0
  41. package/dist/root.css +529 -532
  42. package/dist/theme-prince-xml.css +34 -37
  43. package/dist/theme.css +529 -532
  44. package/dist/tokens.cjs +6297 -8992
  45. package/dist/tokens.d.ts +208 -60
  46. package/dist/tokens.json +38705 -0
  47. package/dist/variables.cjs +1009 -0
  48. package/dist/variables.css +1009 -0
  49. package/dist/variables.d.ts +1128 -0
  50. package/dist/variables.json +1005 -0
  51. package/dist/variables.less +34 -37
  52. package/dist/variables.mjs +1007 -0
  53. package/package.json +6 -5
  54. package/src/background-image-icon.scss +0 -1
  55. package/src/brand/utrecht/typography.tokens.json +7 -9
  56. package/src/component/of/progress-indicator.tokens.json +1 -1
  57. package/src/component/utrecht/backdrop.tokens.json +1 -1
  58. package/src/component/utrecht/blockquote.tokens.json +3 -3
  59. package/src/component/utrecht/button.tokens.json +1 -3
  60. package/src/component/utrecht/code-block.tokens.json +2 -2
  61. package/src/component/utrecht/figure.tokens.json +2 -2
  62. package/src/component/utrecht/form-fieldset.tokens.json +2 -2
  63. package/src/component/utrecht/form-toggle.tokens.json +1 -1
  64. package/src/component/utrecht/link.tokens.json +3 -1
  65. package/src/component/utrecht/pagination.tokens.json +1 -1
  66. package/src/component/utrecht/skip-link.tokens.json +4 -2
  67. package/src/component/utrecht/table.tokens.json +1 -1
  68. package/src/component/utrecht/toptask-link.tokens.json +1 -1
  69. package/src/css-property-formatter.mjs +46 -0
  70. package/src/dark/component/tokens.json +1 -1
  71. package/src/index.scss +81 -5
  72. package/style-dictionary-build-dark.mjs +64 -0
  73. package/style-dictionary-build.mjs +41 -0
  74. package/style-dictionary-config.mjs +261 -0
  75. package/dist/figma-tokens.json +0 -40396
  76. package/src/css-property-formatter.js +0 -35
  77. package/src/style-dictionary-config-dark.js +0 -56
  78. package/src/style-dictionary-config.js +0 -63
  79. package/style-dictionary.config.json +0 -143
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.0",
2
+ "version": "2.2.0",
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,13 @@
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
+ "sm": { "font-size": { "value": "14px", "comment": "14px" } },
9
+ "md": { "font-size": { "value": "16px", "comment": "16px" } },
10
+ "lg": { "font-size": { "value": "18px", "comment": "18px" } },
11
+ "xl": { "font-size": { "value": "20px", "comment": "20px" } },
12
+ "2xl": { "font-size": { "value": "22px", "comment": "22px" } },
13
+ "3xl": { "font-size": { "value": "24px", "comment": "24px" } },
14
+ "4xl": { "font-size": { "value": "32px", "comment": "32px" } }
17
15
  },
18
16
  "weight-scale": {
19
17
  "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
  }
@@ -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.sm.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": {
@@ -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
  }
@@ -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": {},
@@ -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,86 @@
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
  }
33
+
34
+ .utrecht-theme--viewport-scale {
35
+ /* stylelint-disable number-max-precision */
36
+ --ams-text-level-6-line-height: 1.6;
37
+ --ams-text-level-6-font-size: clamp(0.9643rem, calc(0.9054rem + 0.2946vw), 1.2rem);
38
+ --ams-text-level-5-line-height: 1.6;
39
+ --ams-text-level-5-font-size: clamp(1.125rem, calc(1.0313rem + 0.4688vw), 1.5rem);
40
+ --ams-text-level-4-line-height: 1.5;
41
+ --ams-text-level-4-font-size: clamp(1.3125rem, calc(1.1719rem + 0.7031vw), 1.875rem);
42
+ --ams-text-level-3-line-height: 1.3;
43
+ --ams-text-level-3-font-size: clamp(1.5313rem, calc(1.3281rem + 1.0156vw), 2.3438rem);
44
+ --ams-text-level-2-line-height: 1.25;
45
+ --ams-text-level-2-font-size: clamp(1.7865rem, calc(1.5007rem + 1.429vw), 2.9297rem);
46
+ --ams-text-level-1-line-height: 1.2;
47
+ --ams-text-level-1-font-size: clamp(2.0842rem, calc(1.6897rem + 1.9724vw), 3.6621rem);
48
+ --ams-text-level-0-line-height: 1.15;
49
+ --ams-text-level-0-font-size: clamp(2.4316rem, calc(1.8951rem + 2.6826vw), 4.5776rem);
50
+ --ams-space-grid-xl: clamp(2rem, calc(0.75rem + 6.25vw), 7rem);
51
+ --ams-space-grid-lg: clamp(1.5rem, calc(0.5625rem + 4.6875vw), 5.25rem);
52
+ --ams-space-grid-md: clamp(1rem, calc(0.375rem + 3.125vw), 3.5rem);
53
+ --ams-space-grid-sm: clamp(0.5rem, calc(0.1875rem + 1.5625vw), 1.75rem);
54
+ --ams-space-grid-xs: clamp(0.25rem, calc(0.09375rem + 0.78125vw), 0.875rem);
55
+ --ams-space-xl: clamp(2.25rem, 2.0625rem + 0.9375vw, 3rem);
56
+ --ams-space-lg: clamp(1.6875rem, 1.5469rem + 0.7031vw, 2.25rem);
57
+ --ams-space-md: clamp(1.125rem, 1.0313rem + 0.4688vw, 1.5rem);
58
+ --ams-space-sm: clamp(0.5625rem, 0.5156rem + 0.2344vw, 0.75rem);
59
+ --ams-space-xs: clamp(0.2813rem, 0.2578rem + 0.1172vw, 0.375rem);
60
+ --utrecht-typography-scale-4xl-font-size: var(--ams-text-level-0-font-size);
61
+ --utrecht-typography-scale-3xl-font-size: var(--ams-text-level-1-font-size);
62
+ --utrecht-typography-scale-2xl-font-size: var(--ams-text-level-2-font-size);
63
+ --utrecht-typography-scale-xl-font-size: var(--ams-text-level-3-font-size);
64
+ --utrecht-typography-scale-lg-font-size: var(--ams-text-level-4-font-size);
65
+ --utrecht-typography-scale-md-font-size: var(--ams-text-level-5-font-size);
66
+ --utrecht-typography-scale-sm-font-size: var(--ams-text-level-6-font-size);
67
+ --utrecht-space-column-5xl: calc(var(--ams-space-grid-xl) * var(--utrecht-space-column-scale, 1));
68
+ --utrecht-space-column-4xl: calc(var(--ams-space-grid-lg) * var(--utrecht-space-column-scale, 1));
69
+ --utrecht-space-column-3xl: calc(var(--ams-space-grid-md) * var(--utrecht-space-column-scale, 1));
70
+ --utrecht-space-column-2xl: calc(var(--ams-space-grid-sm) * var(--utrecht-space-column-scale, 1) * 1.75);
71
+ --utrecht-space-column-xl: calc(var(--ams-space-grid-sm) * var(--utrecht-space-column-scale, 1) * 1.5);
72
+ --utrecht-space-column-lg: calc(var(--ams-space-grid-sm) * var(--utrecht-space-column-scale, 1) * 1.25);
73
+ --utrecht-space-column-md: calc(var(--ams-space-grid-sm) * var(--utrecht-space-column-scale, 1));
74
+ --utrecht-space-column-sm: calc(var(--ams-space-grid-sm) * var(--utrecht-space-column-scale, 1) * 0.75);
75
+ --utrecht-space-column-xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-column-scale, 1));
76
+ --utrecht-space-column-2xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-column-scale, 1) / 2);
77
+ --utrecht-space-column-3xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-column-scale, 1) / 4);
78
+ --utrecht-space-column-4xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-column-scale, 1) / 8);
79
+ --utrecht-space-row-5xl: calc(var(--ams-space-grid-xl) * var(--utrecht-space-row-scale, 1));
80
+ --utrecht-space-row-4xl: calc(var(--ams-space-grid-lg) * var(--utrecht-space-row-scale, 1));
81
+ --utrecht-space-row-3xl: calc(var(--ams-space-grid-md) * var(--utrecht-space-row-scale, 1));
82
+ --utrecht-space-row-2xl: calc(var(--ams-space-grid-sm) * var(--utrecht-space-row-scale, 1) * 1.75);
83
+ --utrecht-space-row-xl: calc(var(--ams-space-grid-sm) * var(--utrecht-space-row-scale, 1) * 1.5);
84
+ --utrecht-space-row-lg: calc(var(--ams-space-grid-sm) * var(--utrecht-space-row-scale, 1) * 1.25);
85
+ --utrecht-space-row-md: calc(var(--ams-space-grid-sm) * var(--utrecht-space-row-scale, 1));
86
+ --utrecht-space-row-sm: calc(var(--ams-space-grid-sm) * var(--utrecht-space-row-scale, 1) * 0.75);
87
+ --utrecht-space-row-xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-row-scale, 1));
88
+ --utrecht-space-row-2xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-row-scale, 1) / 2);
89
+ --utrecht-space-row-3xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-row-scale, 1) / 4);
90
+ --utrecht-space-row-4xs: calc(var(--ams-space-grid-xs) * var(--utrecht-space-row-scale, 1) / 8);
91
+ --utrecht-space-inline-4xl: calc(var(--ams-space-xl) * var(--utrecht-space-inline-scale, 1) * 1.5);
92
+ --utrecht-space-inline-3xl: calc(var(--ams-space-xl) * var(--utrecht-space-inline-scale, 1));
93
+ --utrecht-space-inline-2xl: calc(var(--ams-space-lg) * var(--utrecht-space-inline-scale, 1));
94
+ --utrecht-space-inline-xl: calc(var(--ams-space-md) * var(--utrecht-space-inline-scale, 1) * 1.33);
95
+ --utrecht-space-inline-lg: calc(var(--ams-space-md) * var(--utrecht-space-inline-scale, 1) * 1.125);
96
+ --utrecht-space-inline-md: calc(var(--ams-space-md) * var(--utrecht-space-inline-scale, 1) * 0.9);
97
+ --utrecht-space-inline-sm: calc(var(--ams-space-md) * var(--utrecht-space-inline-scale, 1) * 0.75);
98
+ --utrecht-space-inline-xs: calc(var(--ams-space-sm) * var(--utrecht-space-inline-scale, 1));
99
+ --utrecht-space-inline-2xs: calc(var(--ams-space-xs) * var(--utrecht-space-inline-scale, 1));
100
+ --utrecht-space-inline-3xs: calc(var(--ams-space-xs) * var(--utrecht-space-inline-scale, 1) / 2);
101
+ --utrecht-space-block-4xl: calc(var(--ams-space-xl) * var(--utrecht-space-block-scale, 1) * 1.5);
102
+ --utrecht-space-block-3xl: calc(var(--ams-space-xl) * var(--utrecht-space-block-scale, 1));
103
+ --utrecht-space-block-2xl: calc(var(--ams-space-lg) * var(--utrecht-space-block-scale, 1));
104
+ --utrecht-space-block-xl: calc(var(--ams-space-md) * var(--utrecht-space-block-scale, 1) * 1.33);
105
+ --utrecht-space-block-lg: calc(var(--ams-space-md) * var(--utrecht-space-block-scale, 1) * 1.125);
106
+ --utrecht-space-block-md: calc(var(--ams-space-md) * var(--utrecht-space-block-scale, 1) * 0.9);
107
+ --utrecht-space-block-sm: calc(var(--ams-space-md) * var(--utrecht-space-block-scale, 1) * 0.75);
108
+ --utrecht-space-block-xs: calc(var(--ams-space-sm) * var(--utrecht-space-block-scale, 1));
109
+ --utrecht-space-block-2xs: calc(var(--ams-space-xs) * var(--utrecht-space-block-scale, 1));
110
+ --utrecht-space-block-3xs: calc(var(--ams-space-xs) * var(--utrecht-space-block-scale, 1) / 2);
111
+ }
@@ -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();