unholy-design-tokens 1.0.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 (111) hide show
  1. package/.github/workflows/lint-format-build.yml +35 -0
  2. package/.github/workflows/publish_release.yml +18 -0
  3. package/.prettierrc +9 -0
  4. package/ANALOGY_HOUSE.md +139 -0
  5. package/ANALOGY_I18NEXT.md +160 -0
  6. package/LICENSE +201 -0
  7. package/README.md +90 -0
  8. package/WHY_THIS_EXISTS.md +74 -0
  9. package/bin/build-tokens.ts +34 -0
  10. package/build/css/bg/bg.css +60 -0
  11. package/build/css/border/border.css +51 -0
  12. package/build/css/colors.css +204 -0
  13. package/build/css/conditional.css +8 -0
  14. package/build/css/cube/cube.block.css +18 -0
  15. package/build/css/cube/cube.composition.css +16 -0
  16. package/build/css/cube/cube.utility.css +185 -0
  17. package/build/css/font/font.css +24 -0
  18. package/build/css/space.css +20 -0
  19. package/build/css/text/text.css +48 -0
  20. package/build/css/themes/private-theme.css +228 -0
  21. package/build/css/themes/public-theme.css +228 -0
  22. package/build/css/variant/variant.css +42 -0
  23. package/build/css/variants.css +167 -0
  24. package/build/types/theme.d.ts +932 -0
  25. package/build/types/tokens.ts +653 -0
  26. package/dist/bin/build-tokens.js +27 -0
  27. package/dist/scripts/build-style-dictionary.js +32 -0
  28. package/dist/scripts/generate-typography-tokens.js +125 -0
  29. package/dist/src/colors/color.config.js +45 -0
  30. package/dist/src/colors/color.filter.js +19 -0
  31. package/dist/src/colors/color.formatter.js +25 -0
  32. package/dist/src/colors/index.js +2 -0
  33. package/dist/src/cube-css/cube.config.js +42 -0
  34. package/dist/src/cube-css/cube.formatter.js +89 -0
  35. package/dist/src/style-dictionary.config.js +143 -0
  36. package/dist/src/type-declarations/type-declarations.config.js +29 -0
  37. package/dist/src/type-declarations/type-declarations.formatter.js +111 -0
  38. package/dist/src/utils/helpers.js +9 -0
  39. package/dist/src/utils/index.js +4 -0
  40. package/dist/src/utils/template.js +83 -0
  41. package/dist/src/utils/tokens.js +80 -0
  42. package/dist/src/utils/utopia.js +19 -0
  43. package/eslint.config.js +67 -0
  44. package/package.json +60 -0
  45. package/scripts/build-style-dictionary.ts +44 -0
  46. package/scripts/generate-typography-tokens.ts +138 -0
  47. package/src/LICENSE +201 -0
  48. package/src/README.md +88 -0
  49. package/src/colors/color.config.ts +48 -0
  50. package/src/colors/color.filter.ts +28 -0
  51. package/src/colors/color.formatter.ts +43 -0
  52. package/src/colors/index.ts +6 -0
  53. package/src/cube-css/cube.config.ts +50 -0
  54. package/src/cube-css/cube.formatter.ts +104 -0
  55. package/src/formatters/spacing.js +95 -0
  56. package/src/style-dictionary.config.ts +151 -0
  57. package/src/theme/README.md +256 -0
  58. package/src/theme/cube-theme-addon.js +44 -0
  59. package/src/theme/helper.js +38 -0
  60. package/src/theme/index.js +6 -0
  61. package/src/theme/theme.config.js +42 -0
  62. package/src/theme/theme.filter.js +42 -0
  63. package/src/theme/theme.formatter.js +71 -0
  64. package/src/tokens/1 - primitives/README.md +58 -0
  65. package/src/tokens/1 - primitives/border.json +54 -0
  66. package/src/tokens/1 - primitives/breakpoint.json +10 -0
  67. package/src/tokens/1 - primitives/color-pool.json +266 -0
  68. package/src/tokens/1 - primitives/color.json +266 -0
  69. package/src/tokens/1 - primitives/font-scale.json +27 -0
  70. package/src/tokens/1 - primitives/font.json +23 -0
  71. package/src/tokens/1 - primitives/shadow.json +26 -0
  72. package/src/tokens/1 - primitives/space.json +27 -0
  73. package/src/tokens/2 - semantic/README.md +49 -0
  74. package/src/tokens/2 - semantic/border.json +27 -0
  75. package/src/tokens/2 - semantic/color.json +263 -0
  76. package/src/tokens/2 - semantic/details.md +1 -0
  77. package/src/tokens/2 - semantic/layout.json +52 -0
  78. package/src/tokens/2 - semantic/radius.json +13 -0
  79. package/src/tokens/2 - semantic/shadow.json +19 -0
  80. package/src/tokens/2 - semantic/spacing.json +25 -0
  81. package/src/tokens/3 - intent/README.md +43 -0
  82. package/src/tokens/3 - intent/background.json +135 -0
  83. package/src/tokens/3 - intent/color.json +265 -0
  84. package/src/tokens/3 - intent/font.json +61 -0
  85. package/src/tokens/3 - intent/text +67 -0
  86. package/src/tokens/README.md +176 -0
  87. package/src/tokens/color/brand.json +316 -0
  88. package/src/tokens/component/theming.json +69 -0
  89. package/src/tokens/conditional.json +40 -0
  90. package/src/tokens/custom/4 - (OPTIONAL) cube css/README.md +38 -0
  91. package/src/tokens/custom/4 - (OPTIONAL) cube css/block.json +24 -0
  92. package/src/tokens/custom/4 - (OPTIONAL) cube css/composition.json +26 -0
  93. package/src/tokens/custom/4 - (OPTIONAL) cube css/global.json +15 -0
  94. package/src/tokens/custom/4 - (OPTIONAL) cube css/utility.json +224 -0
  95. package/src/tokens/custom/OKlch/color.json +61 -0
  96. package/src/tokens/custom/OKlch/state.json +107 -0
  97. package/src/tokens/custom/OKlch/theme-color.json +34 -0
  98. package/src/tokens/custom/OKlch/variant.json +67 -0
  99. package/src/tokens/custom/components/highlighted.json +16 -0
  100. package/src/tokens/state.js +29 -0
  101. package/src/tokens/theme-color.json +34 -0
  102. package/src/type-declarations/type-declarations.config.ts +34 -0
  103. package/src/type-declarations/type-declarations.formatter.ts +122 -0
  104. package/src/utils/helpers.ts +11 -0
  105. package/src/utils/index.ts +4 -0
  106. package/src/utils/template.ts +110 -0
  107. package/src/utils/tokens.ts +95 -0
  108. package/src/utils/utopia.ts +36 -0
  109. package/tailwind.md +720 -0
  110. package/tsconfig.json +19 -0
  111. package/turbowatch.ts +14 -0
@@ -0,0 +1,23 @@
1
+ {
2
+ "font": {
3
+ "minFont": { "value": 14 },
4
+ "maxFont": { "value": 24 },
5
+
6
+ "minViewport": { "value": 360 },
7
+ "maxViewport": { "value": 1280 },
8
+
9
+ "scaleMin": { "value": 1.125 },
10
+ "scaleMax": { "value": 1.2 },
11
+
12
+ "steps": {
13
+ "value": [0, 1, 2, 3, 4, 5, 6]
14
+ },
15
+
16
+ "weight": {
17
+ "light": { "value": 300 },
18
+ "normal": { "value": 400 },
19
+ "medium": { "value": 500 },
20
+ "bold": { "value": 700 }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "shadow": {
3
+ // "xs": {
4
+ // "value": 0.25
5
+ // },
6
+ // "sm": {
7
+ // "value": 0.5
8
+ // },
9
+ // "md": {
10
+ // "value": 1
11
+ // },
12
+ // "lg": {
13
+ // "value": 2
14
+ // },
15
+ // "xl": {
16
+ // "value": 4
17
+ // },
18
+ // If you prefer rely on a personal scale
19
+ "base": {
20
+ "value": 1
21
+ },
22
+ "scale": {
23
+ "value": 1.5
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "space": {
3
+ "fluid": {
4
+ "min": { "value": "1rem" },
5
+ "max": { "value": "1.5rem" },
6
+ "min_viewport": { "value": "360px" },
7
+ "max_viewport": { "value": "1280px" }
8
+ },
9
+ "unit": {
10
+ "default": { "value": "1rem" },
11
+ "fluid": {
12
+ "value": "clamp(var(--space-fluid-min), calc(var(--space-fluid-min) + (var(--space-fluid-max) - var(--space-fluid-min)) * ((100vw - var(--space-fluid-min-viewport)) / (var(--space-fluid-max-viewport) - var(--space-fluid-min-viewport)))), var(--space-fluid-max))"
13
+ }
14
+ },
15
+
16
+ "multiplier": {
17
+ "unit": { "value": "1rem" },
18
+ "xxs": { "value": 0.25 },
19
+ "xs": { "value": 0.5 },
20
+ "sm": { "value": 0.75 },
21
+ "md": { "value": 1 },
22
+ "lg": { "value": 2 },
23
+ "xl": { "value": 3.25 },
24
+ "xxl": { "value": 5.25 }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,49 @@
1
+ # Semantic Tokens Tier
2
+
3
+ Semantic tokens answer the question:
4
+
5
+ > “What is this thing?”
6
+
7
+ Semantic tokens define **meaning** inside the design system.
8
+
9
+ ## Why this term "semantic" is confusing designers and developers
10
+
11
+ These tokens don't define the semantic in the HTML or front-end, they define meaning in the design system tokens hierarchy.
12
+
13
+ > See [_About HTML semantics and front-end architecture_](https://nicolasgallagher.com/about-html-semantics-front-end-architecture/)
14
+
15
+ ## Why to use semantic tokens
16
+
17
+ - Use [aliasing](https://designtokens.fyi/#/terms/alias/) to create a presentation interface that is decoupled from raw values.
18
+ - They usually are usued in multiple locations, linked to a common purpose.
19
+ - They create a stable API for theming and branding.
20
+
21
+ ```css
22
+ /* Mostly colors are aliased through different token Tier */
23
+
24
+ /* colors */
25
+ --color-primary-500: var(--color-arylide-yellow-500); /* will resolve to primitive #e3c567 */
26
+ --color-secondary-500: var(--color-night-500); /* will resolve to primitive #0b0c0c */
27
+
28
+ /* but depending on system, it can also be aliased for convenience elsewhere */
29
+ --spacing-multiplier: 1.5; /* Semantic value that applies to a specific theming */
30
+ --spacing-xs: calc(var(--spacing-unit) * var(--spacing-multiplier) * 0.5);
31
+ --spacing-md: calc(var(--spacing-unit) * var(--spacing-multiplier) * 1);
32
+
33
+ /* border */
34
+ --radius-medium: calc(var(--border-radius-base) * var(--border-radius-scale));
35
+
36
+ /* etc. */
37
+ ```
38
+
39
+ If you wish to change your primary color, you only need to update `--color-primary-500` to point to another primitive color from the pool of colors.
40
+
41
+ ## How semantic tokens are defined
42
+
43
+ - **Reference primitives, no raw values**
44
+ - **Answer "what is this thing?"**
45
+ - **Ideal Token Tier for changing themes**
46
+
47
+ ## Next Steps
48
+
49
+ From here, you can create [**intent tokens**](../3%20-%20intent/README.md) that will map these semantic tokens to specific component needs.
@@ -0,0 +1,27 @@
1
+ {
2
+ "border": {
3
+ "$type": "color",
4
+ "width": {
5
+ "default": {
6
+ "value": "var(--border-width-base)"
7
+ },
8
+ "xsmall": {
9
+ "value": "calc(var(--border-width-base) / 2 * var(--border-width-scale))"
10
+ },
11
+ "small": {
12
+ "value": "calc(var(--border-width-base) * var(--border-width-scale))"
13
+ },
14
+ "medium": {
15
+ "value": "var(--border-width-base)"
16
+ },
17
+ "large": {
18
+ "value": "calc(var(--border-width-base) * 2 * var(--border-width-scale))"
19
+ }
20
+ },
21
+ "style": {
22
+ "default": {
23
+ "value": "var(--border-style-solid)"
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,263 @@
1
+ {
2
+ "color": {
3
+ "primary": {
4
+ "100": {
5
+ "value": "{color.yellow.100}",
6
+ "type": "color",
7
+ "attributes": { "tokenTier": "semantic" }
8
+ },
9
+ "200": {
10
+ "value": "{color.yellow.200}",
11
+ "type": "color",
12
+ "attributes": { "tokenTier": "semantic" }
13
+ },
14
+ "300": {
15
+ "value": "{color.yellow.300}",
16
+ "type": "color",
17
+ "attributes": { "tokenTier": "semantic" }
18
+ },
19
+ "400": {
20
+ "value": "{color.yellow.400}",
21
+ "type": "color",
22
+ "attributes": { "tokenTier": "semantic" }
23
+ },
24
+ "500": {
25
+ "value": "{color.yellow.500}",
26
+ "type": "color",
27
+ "attributes": { "tokenTier": "semantic" }
28
+ },
29
+ "600": {
30
+ "value": "{color.yellow.600}",
31
+ "type": "color",
32
+ "attributes": { "tokenTier": "semantic" }
33
+ },
34
+ "700": {
35
+ "value": "{color.yellow.700}",
36
+ "type": "color",
37
+ "attributes": { "tokenTier": "semantic" }
38
+ },
39
+ "800": {
40
+ "value": "{color.yellow.800}",
41
+ "type": "color",
42
+ "attributes": { "tokenTier": "semantic" }
43
+ },
44
+ "900": {
45
+ "value": "{color.yellow.900}",
46
+ "type": "color",
47
+ "attributes": { "tokenTier": "semantic" }
48
+ },
49
+ "base": {
50
+ "value": "{color.yellow.base}",
51
+ "type": "color",
52
+ "attributes": { "tokenTier": "semantic" }
53
+ }
54
+ },
55
+
56
+ "secondary": {
57
+ "100": {
58
+ "value": "{color.vanilla-custard.100}",
59
+ "type": "color",
60
+ "attributes": { "tokenTier": "semantic" }
61
+ },
62
+ "200": {
63
+ "value": "{color.vanilla-custard.200}",
64
+ "type": "color",
65
+ "attributes": { "tokenTier": "semantic" }
66
+ },
67
+ "300": {
68
+ "value": "{color.vanilla-custard.300}",
69
+ "type": "color",
70
+ "attributes": { "tokenTier": "semantic" }
71
+ },
72
+ "400": {
73
+ "value": "{color.vanilla-custard.400}",
74
+ "type": "color",
75
+ "attributes": { "tokenTier": "semantic" }
76
+ },
77
+ "500": {
78
+ "value": "{color.vanilla-custard.500}",
79
+ "type": "color",
80
+ "attributes": { "tokenTier": "semantic" }
81
+ },
82
+ "600": {
83
+ "value": "{color.vanilla-custard.600}",
84
+ "type": "color",
85
+ "attributes": { "tokenTier": "semantic" }
86
+ },
87
+ "700": {
88
+ "value": "{color.vanilla-custard.700}",
89
+ "type": "color",
90
+ "attributes": { "tokenTier": "semantic" }
91
+ },
92
+ "800": {
93
+ "value": "{color.vanilla-custard.800}",
94
+ "type": "color",
95
+ "attributes": { "tokenTier": "semantic" }
96
+ },
97
+ "900": {
98
+ "value": "{color.vanilla-custard.900}",
99
+ "type": "color",
100
+ "attributes": { "tokenTier": "semantic" }
101
+ },
102
+ "base": {
103
+ "value": "{color.vanilla-custard.base}",
104
+ "type": "color",
105
+ "attributes": { "tokenTier": "semantic" }
106
+ }
107
+ },
108
+
109
+ "accent": {
110
+ "100": {
111
+ "value": "{color.intense-cherry.100}",
112
+ "type": "color",
113
+ "attributes": { "tokenTier": "semantic" }
114
+ },
115
+ "200": {
116
+ "value": "{color.intense-cherry.200}",
117
+ "type": "color",
118
+ "attributes": { "tokenTier": "semantic" }
119
+ },
120
+ "300": {
121
+ "value": "{color.intense-cherry.300}",
122
+ "type": "color",
123
+ "attributes": { "tokenTier": "semantic" }
124
+ },
125
+ "400": {
126
+ "value": "{color.intense-cherry.400}",
127
+ "type": "color",
128
+ "attributes": { "tokenTier": "semantic" }
129
+ },
130
+ "500": {
131
+ "value": "{color.intense-cherry.500}",
132
+ "type": "color",
133
+ "attributes": { "tokenTier": "semantic" }
134
+ },
135
+ "600": {
136
+ "value": "{color.intense-cherry.600}",
137
+ "type": "color",
138
+ "attributes": { "tokenTier": "semantic" }
139
+ },
140
+ "700": {
141
+ "value": "{color.intense-cherry.700}",
142
+ "type": "color",
143
+ "attributes": { "tokenTier": "semantic" }
144
+ },
145
+ "800": {
146
+ "value": "{color.intense-cherry.800}",
147
+ "type": "color",
148
+ "attributes": { "tokenTier": "semantic" }
149
+ },
150
+ "900": {
151
+ "value": "{color.intense-cherry.900}",
152
+ "type": "color",
153
+ "attributes": { "tokenTier": "semantic" }
154
+ },
155
+ "base": {
156
+ "value": "{color.intense-cherry.base}",
157
+ "type": "color",
158
+ "attributes": { "tokenTier": "semantic" }
159
+ }
160
+ },
161
+
162
+ "neutral": {
163
+ "100": {
164
+ "value": "{color.graphite.100}",
165
+ "type": "color",
166
+ "attributes": { "tokenTier": "semantic" }
167
+ },
168
+ "200": {
169
+ "value": "{color.graphite.200}",
170
+ "type": "color",
171
+ "attributes": { "tokenTier": "semantic" }
172
+ },
173
+ "300": {
174
+ "value": "{color.graphite.300}",
175
+ "type": "color",
176
+ "attributes": { "tokenTier": "semantic" }
177
+ },
178
+ "400": {
179
+ "value": "{color.graphite.400}",
180
+ "type": "color",
181
+ "attributes": { "tokenTier": "semantic" }
182
+ },
183
+ "500": {
184
+ "value": "{color.graphite.500}",
185
+ "type": "color",
186
+ "attributes": { "tokenTier": "semantic" }
187
+ },
188
+ "600": {
189
+ "value": "{color.graphite.600}",
190
+ "type": "color",
191
+ "attributes": { "tokenTier": "semantic" }
192
+ },
193
+ "700": {
194
+ "value": "{color.graphite.700}",
195
+ "type": "color",
196
+ "attributes": { "tokenTier": "semantic" }
197
+ },
198
+ "800": {
199
+ "value": "{color.graphite.800}",
200
+ "type": "color",
201
+ "attributes": { "tokenTier": "semantic" }
202
+ },
203
+ "900": {
204
+ "value": "{color.graphite.900}",
205
+ "type": "color",
206
+ "attributes": { "tokenTier": "semantic" }
207
+ },
208
+ "base": {
209
+ "value": "{color.graphite.base}",
210
+ "type": "color",
211
+ "attributes": { "tokenTier": "semantic" }
212
+ }
213
+ },
214
+
215
+ "info": {
216
+ "100": {
217
+ "value": "{color.vanilla-cream.300}",
218
+ "type": "color",
219
+ "attributes": { "tokenTier": "semantic" }
220
+ },
221
+ "200": {
222
+ "value": "{color.vanilla-cream.500}",
223
+ "type": "color",
224
+ "attributes": { "tokenTier": "semantic" }
225
+ },
226
+ "300": {
227
+ "value": "{color.vanilla-cream.700}",
228
+ "type": "color",
229
+ "attributes": { "tokenTier": "semantic" }
230
+ },
231
+ "400": {
232
+ "value": "{color.vanilla-cream.900}",
233
+ "type": "color",
234
+ "attributes": { "tokenTier": "semantic" }
235
+ },
236
+ "500": {
237
+ "value": "{color.vanilla-cream.base}",
238
+ "type": "color",
239
+ "attributes": { "tokenTier": "semantic" }
240
+ },
241
+ "600": {
242
+ "value": "{color.vanilla-cream.100}",
243
+ "type": "color",
244
+ "attributes": { "tokenTier": "semantic" }
245
+ },
246
+ "700": {
247
+ "value": "{color.vanilla-cream.200}",
248
+ "type": "color",
249
+ "attributes": { "tokenTier": "semantic" }
250
+ },
251
+ "800": {
252
+ "value": "{color.vanilla-cream.400}",
253
+ "type": "color",
254
+ "attributes": { "tokenTier": "semantic" }
255
+ },
256
+ "900": {
257
+ "value": "{color.vanilla-cream.600}",
258
+ "type": "color",
259
+ "attributes": { "tokenTier": "semantic" }
260
+ }
261
+ }
262
+ }
263
+ }
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1,52 @@
1
+ {
2
+ "layout": {
3
+ // Define when layout should switch between different modes (row/column)
4
+ "breakAt": {
5
+ "value": "{breakpoint.md}"
6
+ },
7
+ "gutter": {
8
+ "sm": { "value": "{spacing.sm}" },
9
+ "md": { "value": "{spacing.md}" },
10
+ "lg": { "value": "{spacing.lg}" },
11
+ "xl": { "value": "{spacing.xl}" }
12
+ },
13
+ "direction": {
14
+ "value": "column"
15
+ },
16
+ "align": {
17
+ "start": { "value": "flex-start" },
18
+ "center": { "value": "center" },
19
+ "end": { "value": "flex-end" }
20
+ },
21
+ "justify": {
22
+ "start": { "value": "flex-start" },
23
+ "center": { "value": "center" },
24
+ "end": { "value": "flex-end" },
25
+ "between": { "value": "space-between" }
26
+ },
27
+ "gap": {
28
+ "xs": { "value": "{spacing.xs}" },
29
+ "sm": { "value": "{spacing.sm}" },
30
+ "md": { "value": "{spacing.md}" },
31
+ "lg": { "value": "{spacing.lg}" },
32
+ "xl": { "value": "{spacing.xl}" }
33
+ },
34
+ "overlay": {
35
+ "zIndex": { "value": 1000 },
36
+ "opacity": { "value": 0 },
37
+ "blur": { "value": "8px" }
38
+ },
39
+ "spaceUnit": {
40
+ // To decide between using {spacing.unit.default} or {spacing.unit.fluid}
41
+ "value": "{space.unit.fluid}"
42
+ },
43
+ "depth-base": {
44
+ "value": "6px"
45
+ },
46
+ "mobile": {
47
+ "padding": {
48
+ "value": "{spacing.md}"
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "radius": {
3
+ "light": {
4
+ "value": "calc(var(--border-radius-base) / var(--border-radius-scale))"
5
+ },
6
+ "medium": {
7
+ "value": "calc(var(--border-radius-base) * var(--border-radius-scale))"
8
+ },
9
+ "heavy": {
10
+ "value": "calc(var(--border-radius-base) * 2 * var(--border-radius-scale))"
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "shadow": {
3
+ "xs": {
4
+ "value": "calc(var(--shadow-base) / 3 * var(--shadow-scale))"
5
+ },
6
+ "sm": {
7
+ "value": "calc(var(--shadow-base) / 2 * var(--shadow-scale))"
8
+ },
9
+ "md": {
10
+ "value": "calc(var(--shadow-base) * var(--shadow-scale))"
11
+ },
12
+ "lg": {
13
+ "value": "calc(var(--shadow-base) * 2 * var(--shadow-scale))"
14
+ },
15
+ "xl": {
16
+ "value": "calc(var(--shadow-base) * 4 * var(--shadow-scale))"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "spacing": {
3
+ "xxs": {
4
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-xxs))"
5
+ },
6
+ "xs": {
7
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-xs))"
8
+ },
9
+ "sm": {
10
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-sm))"
11
+ },
12
+ "md": {
13
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-md))"
14
+ },
15
+ "lg": {
16
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-lg))"
17
+ },
18
+ "xl": {
19
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-xl))"
20
+ },
21
+ "xxl": {
22
+ "value": "calc(var(--_layout-space-unit) * var(--_space-multiplier-xxl))"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,43 @@
1
+ # 📂 Intent Tokens
2
+
3
+ Intent tokens translate UI states like "success" or "danger" (designer language) into consistent visual.
4
+
5
+ They answer the question:
6
+
7
+ > “Why am I using it?”
8
+
9
+ This is the **developer-facing API** for stateful components.
10
+
11
+ ```css
12
+ --color-bg-primary: var(--color-primary-500); /* will resolve to semantic var */
13
+ --color-bg-secondary: var(--color-secondary-500); /* will resolve to semantic var */
14
+ /* ... */
15
+ ```
16
+
17
+ ## Why to use intent tokens
18
+
19
+ - Create a stable interface for components that need to convey UI meaning and semantic (see [_About HTML semantics and front-end architecture_](https://nicolasgallagher.com/about-html-semantics-front-end-architecture/)).
20
+ - They do not change with themes (light/dark/brand), only with UX meaning.
21
+ - You don't think in term of color anymore (see [🏠 House-Building Analogy](../../../ANALOGY_HOUSE.md)).
22
+
23
+ ## 💡 The 3 things that actually matter
24
+
25
+ For 99% of components, you only care about:
26
+
27
+ ### 1. **Background color (`bg`)**
28
+
29
+ ### 2. **Text color (`text`)**
30
+
31
+ ### 3. **Border color (`border`)**
32
+
33
+ Everything else (shadows, spacing, radii…) is usually standardized in the previous tiers.
34
+
35
+ ## How intent tokens are (or can be) defined
36
+
37
+ - **Usually reference semantic**
38
+ - **Names reflect UX meaning, not visual result**
39
+ - **Schema: `purpose.priority.property` or `purpose.priority.property.state`**
40
+
41
+ ## Next Steps
42
+
43
+ (Optional) you can create specific token as related to [CUBE CSS](https://cube.fyi/) based on these intent tokens. See [src/tokens/4 - (OPTIONAL) cube](<../custom/4%20-%20(OPTIONAL)%20cube%20css/README.md>)