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,135 @@
1
+ {
2
+ "bg": {
3
+ "primary": {
4
+ "type": "color",
5
+ "attributes": {
6
+ "tokenTier": "intent"
7
+ },
8
+ "value": "{color.primary.500}"
9
+ },
10
+ "primary-hover": {
11
+ "type": "color",
12
+ "attributes": {
13
+ "tokenTier": "intent"
14
+ },
15
+ "value": "{color.primary.600}"
16
+ },
17
+ "primary-active": {
18
+ "type": "color",
19
+ "attributes": {
20
+ "tokenTier": "intent"
21
+ },
22
+ "value": "{color.primary.700}"
23
+ },
24
+ "primary-focus": {
25
+ "type": "color",
26
+ "attributes": {
27
+ "tokenTier": "intent"
28
+ },
29
+ "value": "{color.primary.100}"
30
+ },
31
+ "primary-disable": {
32
+ "type": "color",
33
+ "attributes": {
34
+ "tokenTier": "intent"
35
+ },
36
+ "value": "{color.primary.100}"
37
+ },
38
+
39
+ "accent": {
40
+ "type": "color",
41
+ "attributes": {
42
+ "tokenTier": "intent"
43
+ },
44
+ "value": "{color.accent.500}"
45
+ },
46
+ "accent-hover": {
47
+ "type": "color",
48
+ "attributes": {
49
+ "tokenTier": "intent"
50
+ },
51
+ "value": "{color.accent.600}"
52
+ },
53
+ "accent-active": {
54
+ "type": "color",
55
+ "attributes": {
56
+ "tokenTier": "intent"
57
+ },
58
+ "value": "{color.accent.700}"
59
+ },
60
+ "accent-focus": {
61
+ "type": "color",
62
+ "attributes": {
63
+ "tokenTier": "intent"
64
+ },
65
+ "value": "{color.accent.100}"
66
+ },
67
+ "accent-disable": {
68
+ "type": "color",
69
+ "attributes": {
70
+ "tokenTier": "intent"
71
+ },
72
+ "value": "{color.accent.100}"
73
+ },
74
+
75
+ "neutral": {
76
+ "type": "color",
77
+ "attributes": {
78
+ "tokenTier": "intent"
79
+ },
80
+ "value": "{color.neutral.500}"
81
+ },
82
+
83
+ "neutral-hover": {
84
+ "type": "color",
85
+ "attributes": {
86
+ "tokenTier": "intent"
87
+ },
88
+ "value": "{color.neutral.600}"
89
+ },
90
+ "neutral-active": {
91
+ "type": "color",
92
+ "attributes": {
93
+ "tokenTier": "intent"
94
+ },
95
+ "value": "{color.neutral.700}"
96
+ },
97
+ "neutral-focus": {
98
+ "type": "color",
99
+ "attributes": {
100
+ "tokenTier": "intent"
101
+ },
102
+ "value": "{color.neutral.100}"
103
+ },
104
+ "neutral-disable": {
105
+ "type": "color",
106
+ "attributes": {
107
+ "tokenTier": "intent"
108
+ },
109
+ "value": "{color.neutral.100}"
110
+ },
111
+
112
+ // etc. etc.
113
+ "info": {
114
+ "type": "color",
115
+ "attributes": {
116
+ "tokenTier": "intent"
117
+ },
118
+ "value": "{color.accent.100}"
119
+ },
120
+ "warning": {
121
+ "type": "color",
122
+ "attributes": {
123
+ "tokenTier": "intent"
124
+ },
125
+ "value": "{color.primary.100}"
126
+ },
127
+ "success": {
128
+ "type": "color",
129
+ "attributes": {
130
+ "tokenTier": "intent"
131
+ },
132
+ "value": "{color.neutral.100}"
133
+ }
134
+ }
135
+ }
@@ -0,0 +1,265 @@
1
+ {
2
+ "color": {
3
+ "bg": {
4
+ "page": {
5
+ "type": "color",
6
+ "attributes": {
7
+ "tokenTier": "intent"
8
+ },
9
+ "value": "{color.secondary.base}"
10
+ },
11
+ "subtle": {
12
+ "type": "color",
13
+ "attributes": {
14
+ "tokenTier": "intent"
15
+ },
16
+ "value": "{color.secondary.100}"
17
+ },
18
+ "elevated": {
19
+ "type": "color",
20
+ "attributes": {
21
+ "tokenTier": "intent"
22
+ },
23
+ "value": "#FFFFFF"
24
+ },
25
+ "inset": {
26
+ "type": "color",
27
+ "attributes": {
28
+ "tokenTier": "intent"
29
+ },
30
+ "value": "{color.secondary.200}"
31
+ },
32
+
33
+ "primary": {
34
+ "type": "color",
35
+ "attributes": {
36
+ "tokenTier": "intent"
37
+ },
38
+ "value": "{color.primary.500}"
39
+ },
40
+ "primary-hover": {
41
+ "type": "color",
42
+ "attributes": {
43
+ "tokenTier": "intent"
44
+ },
45
+ "value": "oklch(from {color.primary.500} lightness(+7%))"
46
+ },
47
+ "primary-active": {
48
+ "type": "color",
49
+ "attributes": {
50
+ "tokenTier": "intent"
51
+ },
52
+ "value": "{color.primary.700}"
53
+ },
54
+ "primary-subtle": {
55
+ "type": "color",
56
+ "attributes": {
57
+ "tokenTier": "intent"
58
+ },
59
+ "value": "{color.primary.100}"
60
+ },
61
+
62
+ "accent": {
63
+ "type": "color",
64
+ "attributes": {
65
+ "tokenTier": "intent"
66
+ },
67
+ "value": "{color.accent.500}"
68
+ },
69
+ "accent-hover": {
70
+ "type": "color",
71
+ "attributes": {
72
+ "tokenTier": "intent"
73
+ },
74
+ "value": "{color.accent.600}"
75
+ },
76
+ "accent-subtle": {
77
+ "type": "color",
78
+ "attributes": {
79
+ "tokenTier": "intent"
80
+ },
81
+ "value": "{color.accent.100}"
82
+ },
83
+ "neutral": {
84
+ "type": "color",
85
+ "attributes": {
86
+ "tokenTier": "intent"
87
+ },
88
+ "value": "{color.neutral.500}"
89
+ },
90
+
91
+ "neutral-strong": {
92
+ "type": "color",
93
+ "attributes": {
94
+ "tokenTier": "intent"
95
+ },
96
+ "value": "{color.neutral.900}"
97
+ },
98
+
99
+ "info": {
100
+ "type": "color",
101
+ "attributes": {
102
+ "tokenTier": "intent"
103
+ },
104
+ "value": "{color.info.100}"
105
+ },
106
+ "warning": {
107
+ "type": "color",
108
+ "attributes": {
109
+ "tokenTier": "intent"
110
+ },
111
+ "value": "{color.primary.100}"
112
+ },
113
+ "success": {
114
+ "type": "color",
115
+ "attributes": {
116
+ "tokenTier": "intent"
117
+ },
118
+ "value": "{color.neutral.100}"
119
+ }
120
+ },
121
+ "text": {
122
+ "primary": {
123
+ "type": "color",
124
+ "attributes": {
125
+ "tokenTier": "intent"
126
+ },
127
+ "value": "{color.secondary.900}"
128
+ },
129
+ "secondary": {
130
+ "type": "color",
131
+ "attributes": {
132
+ "tokenTier": "intent"
133
+ },
134
+ "value": "{color.secondary.700}"
135
+ },
136
+ "muted": {
137
+ "type": "color",
138
+ "attributes": {
139
+ "tokenTier": "intent"
140
+ },
141
+ "value": "{color.secondary.500}"
142
+ },
143
+ "subtle": {
144
+ "type": "color",
145
+ "attributes": {
146
+ "tokenTier": "intent"
147
+ },
148
+ "value": "{color.secondary.400}"
149
+ },
150
+ "link": {
151
+ "type": "color",
152
+ "attributes": {
153
+ "tokenTier": "intent"
154
+ },
155
+ "value": "{color.accent.700}"
156
+ },
157
+ "link-hover": {
158
+ "type": "color",
159
+ "attributes": {
160
+ "tokenTier": "intent"
161
+ },
162
+ "value": "{color.accent.800}"
163
+ },
164
+
165
+ "info": {
166
+ "type": "color",
167
+ "attributes": {
168
+ "tokenTier": "intent"
169
+ },
170
+ "value": "{color.accent.700}"
171
+ },
172
+ "warning": {
173
+ "type": "color",
174
+ "attributes": {
175
+ "tokenTier": "intent"
176
+ },
177
+ "value": "{color.primary.700}"
178
+ },
179
+ "success": {
180
+ "type": "color",
181
+ "attributes": {
182
+ "tokenTier": "intent"
183
+ },
184
+ "value": "{color.neutral.700}"
185
+ }
186
+ },
187
+
188
+ "border": {
189
+ "subtle": {
190
+ "type": "color",
191
+ "attributes": {
192
+ "tokenTier": "intent"
193
+ },
194
+ "value": "{color.secondary.200}"
195
+ },
196
+ "default": {
197
+ "type": "color",
198
+ "attributes": {
199
+ "tokenTier": "intent"
200
+ },
201
+ "value": "{color.secondary.300}"
202
+ },
203
+ "strong": {
204
+ "type": "color",
205
+ "attributes": {
206
+ "tokenTier": "intent"
207
+ },
208
+ "value": "{color.secondary.400}"
209
+ },
210
+
211
+ "primary": {
212
+ "type": "color",
213
+ "attributes": {
214
+ "tokenTier": "intent"
215
+ },
216
+ "value": "{color.primary.500}"
217
+ },
218
+ "focus": {
219
+ "type": "color",
220
+ "attributes": {
221
+ "tokenTier": "intent"
222
+ },
223
+ "value": "{color.accent.500}"
224
+ },
225
+
226
+ "info": {
227
+ "type": "color",
228
+ "attributes": {
229
+ "tokenTier": "intent"
230
+ },
231
+ "value": "{color.accent.200}"
232
+ },
233
+ "warning": {
234
+ "type": "color",
235
+ "attributes": {
236
+ "tokenTier": "intent"
237
+ },
238
+ "value": "{color.primary.200}"
239
+ },
240
+ "success": {
241
+ "type": "color",
242
+ "attributes": {
243
+ "tokenTier": "intent"
244
+ },
245
+ "value": "{color.neutral.200}"
246
+ },
247
+ "neutral": {
248
+ "type": "color",
249
+ "attributes": {
250
+ "tokenTier": "intent"
251
+ },
252
+ "value": "{color.neutral.300}"
253
+ }
254
+ },
255
+ "feedback": {
256
+ "error": {
257
+ "type": "color",
258
+ "attributes": {
259
+ "tokenTier": "intent"
260
+ },
261
+ "value": "{color.accent.base}"
262
+ }
263
+ }
264
+ }
265
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "text": {
3
+ "body": {
4
+ "size": {
5
+ "value": "var(--font-scale-0)"
6
+ },
7
+ "lineHeight": {
8
+ "value": "1.5"
9
+ },
10
+ "weight": {
11
+ "value": "var(--font-weight-regular)"
12
+ }
13
+ },
14
+ "caption": {
15
+ "size": {
16
+ "value": "var(--font-scale--2)"
17
+ },
18
+ "lineHeight": {
19
+ "value": "1.4"
20
+ },
21
+ "weight": {
22
+ "value": "var(--font-weight-regular)"
23
+ }
24
+ },
25
+ "small": {
26
+ "size": {
27
+ "value": "var(--font-scale--1)"
28
+ },
29
+ "lineHeight": {
30
+ "value": "1.4"
31
+ },
32
+ "weight": {
33
+ "value": "var(--font-weight-regular)"
34
+ }
35
+ }
36
+ },
37
+ "heading": {
38
+ "h1": {
39
+ "size": {
40
+ "value": "var(--font-scale-4)"
41
+ },
42
+ "lineHeight": {
43
+ "value": "1.1"
44
+ },
45
+ "weight": {
46
+ "value": "var(--font-weight-bold)"
47
+ }
48
+ },
49
+ "h2": {
50
+ "size": {
51
+ "value": "var(--font-scale-3)"
52
+ },
53
+ "lineHeight": {
54
+ "value": "1.15"
55
+ },
56
+ "weight": {
57
+ "value": "var(--font-weight-bold)"
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "text": {
3
+ "primary": {
4
+ "type": "color",
5
+ "attributes": {
6
+ "tokenTier": "intent"
7
+ },
8
+ "value": "{color.secondary.900}"
9
+ },
10
+ "secondary": {
11
+ "type": "color",
12
+ "attributes": {
13
+ "tokenTier": "intent"
14
+ },
15
+ "value": "{color.secondary.700}"
16
+ },
17
+ "muted": {
18
+ "type": "color",
19
+ "attributes": {
20
+ "tokenTier": "intent"
21
+ },
22
+ "value": "{color.secondary.500}"
23
+ },
24
+ "subtle": {
25
+ "type": "color",
26
+ "attributes": {
27
+ "tokenTier": "intent"
28
+ },
29
+ "value": "{color.secondary.400}"
30
+ },
31
+ "link": {
32
+ "type": "color",
33
+ "attributes": {
34
+ "tokenTier": "intent"
35
+ },
36
+ "value": "{color.accent.700}"
37
+ },
38
+ "link-hover": {
39
+ "type": "color",
40
+ "attributes": {
41
+ "tokenTier": "intent"
42
+ },
43
+ "value": "{color.accent.800}"
44
+ },
45
+ "info": {
46
+ "type": "color",
47
+ "attributes": {
48
+ "tokenTier": "intent"
49
+ },
50
+ "value": "{color.accent.700}"
51
+ },
52
+ "warning": {
53
+ "type": "color",
54
+ "attributes": {
55
+ "tokenTier": "intent"
56
+ },
57
+ "value": "{color.primary.700}"
58
+ },
59
+ "success": {
60
+ "type": "color",
61
+ "attributes": {
62
+ "tokenTier": "intent"
63
+ },
64
+ "value": "{color.neutral.700}"
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,176 @@
1
+ # 🧩 Design Tokens
2
+
3
+ ## 🧠 What is a design token?
4
+
5
+ **design token = a variable containing a value** used for styling.
6
+
7
+ Instead of this:
8
+
9
+ ```css
10
+ background: #6f53db;
11
+ color: #ffffff;
12
+ border-radius: 8px;
13
+ ```
14
+
15
+ We use this:
16
+
17
+ ```css
18
+ background: var(--color-bg-primary);
19
+ color: var(--color-text-primary);
20
+ border-radius: var(--radius-lg);
21
+ ```
22
+
23
+ ## Why?
24
+
25
+ Because if we change a color later, or add themes, or update branding
26
+
27
+ **We update 1 token instead of 400 files.**
28
+
29
+ 1 Token = **1 variable for design**.
30
+
31
+ ---
32
+
33
+ ## Naming Schema
34
+
35
+ The [schema](https://designtokens.fyi/#/terms/schema/) (how you name your tokens) can vary.
36
+ The one chosen here is very close to the CTI (Category, Type, Item) methodology.
37
+
38
+ - **Category**: color, spacing, border, shadow, etc.
39
+ - **Type**: to describe the kind of category
40
+ - bg (background), text, radius, etc.
41
+ - **Item**: specific purpose / name, but can also be a variant / [priority](https://designtokens.fyi/#/terms/priority/) (primary, secondary, etc.)
42
+
43
+ _All level don't have to be used all the time._
44
+
45
+ <!-- TODO: -->
46
+
47
+ - We can have a token with only Category + Type: `--spacing-multiplier`
48
+ - Or Category + Type + Item: `--color-text-secondary`
49
+ - Or Category + Item: `--border-radius-lg`
50
+
51
+ This Schema can sometimes be expanded with a 4th level:
52
+
53
+ - **Interaction** ([designtoken.fyi](https://designtokens.fyi/#/terms/interaction/)) (or sometimes called state) when needed. (hover, active, disabled, etc.)
54
+ - **Subitem**: rarely used, but can be useful for more complex systems.
55
+
56
+ > See [Style-Dictionary documentation](https://styledictionary.com/info/tokens/#category--type--item) and [Cloudspace Design System](https://cloudscape.design/foundation/visual-foundation/design-tokens/#naming-structure) example on this structure.
57
+
58
+ | Category | Type | Item | Subitem | Interaction (or State) | Example Token Name |
59
+ | -------- | ------- | --------- | ------- | ---------------------- | --------------------------- |
60
+ | color | bg | primary | | hover | `--color-bg-primary-hover` |
61
+ | color | text | secondary | | | `--color-text-secondary` |
62
+ | border | radius | lg | | | `--border-radius-lg` |
63
+ | spacing | | unit | | | `--spacing-unit` |
64
+ | button | primary | bg | hover | | `--button-primary-bg-hover` |
65
+
66
+ ---
67
+
68
+ ## 💡 The 3 things that actually matter
69
+
70
+ For 99% of components, you only care about:
71
+
72
+ ### 1. **Background color (`bg`)**
73
+
74
+ ### 2. **Text color (`text`)**
75
+
76
+ ### 3. **Border color (`border`)**
77
+
78
+ Everything else (shadows, spacing, radius…) is standardized.
79
+
80
+ ---
81
+
82
+ ## 🎨 Token System: Simple Mental Model
83
+
84
+ ---
85
+
86
+ ### **Primitives**
87
+
88
+ Primitives are raw values:
89
+
90
+ ```css
91
+ --color-purple-600: #6f53db;
92
+ --color-white: #ffffff;
93
+ --radius-lg: 8px;
94
+ ```
95
+
96
+ - Can be colors, font-sizes, spacings, radius, shadows, etc.
97
+ - Building blocks of your design system
98
+ - Can be not exclusively linked to your design system, it's a pool of raw values.
99
+
100
+ See [src/tokens/1 - primitives](./1%20-%20primitives/README.md).
101
+
102
+ ---
103
+
104
+ ### 1️⃣ **Theming tokens** (semantic)
105
+
106
+ Tokens that describe a specific interface / theme.
107
+
108
+ **Note:** This is what designers use in tools (Figma, Sketch, etc).
109
+ As a developer, you mostly use these indirectly via intents / component tokens.
110
+
111
+ Examples:
112
+
113
+ ```css
114
+ var(--color-primary) /* main brand color */
115
+ var(--color-danger) /* errors */
116
+ var(--color-success) /* success */
117
+ var(--color-neutral) /* text & lines */
118
+ var(--color-inverse) /* for dark backgrounds */
119
+
120
+ ```
121
+
122
+ They don't express direct color value, and are used as interface to map theming variables.
123
+ They are usually the only ones that get updated during rebranding or theming.
124
+
125
+ See [src/tokens/2 - semantic](./2%20-%20semantic/README.md).
126
+
127
+ ---
128
+
129
+ ### 2️⃣ **Intent tokens**
130
+
131
+ Tokens that describe **what a component needs in the UI**. They refer closer to what a designer thinks when building a component.
132
+
133
+ Example for a button:
134
+
135
+ ```css
136
+ --color-border-primary
137
+ --color-border-primary-hover
138
+
139
+ --button-primary-bg-hover
140
+ --button-primary-fg
141
+ --button-primary-border
142
+
143
+ ```
144
+
145
+ See [src/tokens/3 - intent](./3%20-%20intent/README.md).
146
+
147
+ ---
148
+
149
+ Always use:
150
+
151
+ - semantic tokens **if you’re building a new component**
152
+ - component tokens **if you’re editing an existing component**
153
+ - tone/type classes **in markup**
154
+
155
+ ---
156
+
157
+ ## 🧭 Quick Cheatsheet
158
+
159
+ ### When building a component:
160
+
161
+ 1. Re-use **intent tokens** if possible:
162
+
163
+ ```css
164
+ background: var(--color-bg-primary);
165
+ ```
166
+
167
+ 2. If not, create new **component tokens**:
168
+
169
+ ```css
170
+ background: var(--button-primary-bg);
171
+ ```
172
+
173
+ Component tokents are usually mapped to intent tokens. They are used to match specific component needs.
174
+ See [designtoken.fyi](https://designtokens.fyi/#/terms/component/)
175
+
176
+ Sources: [Cloudscape Design System](https://cloudscape.design/)