@openkfw/design-tokens 0.1.2 → 0.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.
package/README.md CHANGED
@@ -1,12 +1,18 @@
1
1
  # KfW Design Tokens
2
2
 
3
+ ![KfW Design Tokens](/kfw-design-tokens.png)
4
+
3
5
  KfW Design Tokens is the source of truth for designing KfW-branded digital products. By default, it's built to align with our corporate brand and design but allows for customization to fit your particular product.
4
6
  The tokens follow a template that complies with the <a href="https://tr.designtokens.org/">W3C DTCG format</a>.
5
- The documentation for how to using design tokens is accessible only <a href="https://brand-guide.kfw.de/document/85/de#/user-interface/user-interface">internally</a>.
7
+
8
+ **Note: The Design Tokens are still in the pilot phase.** This means that they are currently being tested and evaluated for functionality and usability. Feedback from users during this phase is crucial for making improvements and ensuring that the tokens meet the needs of all stakeholders before a full stable release.
9
+
10
+ The documentation on how to use design tokens is available [internally only](https://brand-guide.kfw.de/document/85/de#/user-interface/user-interface).
11
+ If you have any questions or need assistance, please reach out to our "Design System & Tokens Community" in the internal Webex channel.
6
12
 
7
13
  ![Design Tokens badge](https://img.shields.io/badge/openkfw-design--tokens-005a8c) [![License: MPL-2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen)](./LICENSE) ![GitHub repo size](https://img.shields.io/github/repo-size/openkfw/design-tokens.svg?style=flat-square) ![GitHub package.json version ](https://img.shields.io/github/package-json/v/openkfw/design-tokens) [![NPM package](https://img.shields.io/npm/v/@openkfw/design-tokens.svg)](https://www.npmjs.com/package/@openkfw/design-tokens)
8
14
 
9
- # Customizing KfW Design Tokens for open source
15
+ ## Customizing KfW Design Tokens for open source
10
16
 
11
17
  Although the source code for KfW Design Tokens is free and available under the MPL 2.0 License, KfW fully reserves all rights to the KfW brand. To prevent users from getting confused about the source of a digital product or experience, there are strict restrictions on using the KfW brand and design, even when built into code that we provide. For any customization other than explicitly for the KfW, you must replace the KfW theme. To use KfW Design Tokens as open source software and customize it, please follow the instructions.
12
18
 
@@ -14,7 +20,7 @@ Although the source code for KfW Design Tokens is free and available under the M
14
20
 
15
21
  Run the following command to install the Design Tokens:
16
22
 
17
- ```
23
+ ```bash
18
24
  npm install @openkfw/design-tokens
19
25
  ```
20
26
 
@@ -24,16 +30,19 @@ Import or use files inside the `output` folder, e.g.:
24
30
  @import url("@openkfw/design-tokens/output/web_stable_10px/css/kfw-design-tokens.light.css");
25
31
  ```
26
32
 
27
- # Contributing
33
+ ## ❤️ Contributing
28
34
 
29
- Our commitment to open source means that we are enabling - even encouraging - all interested parties to contribute.
35
+ Our commitment to open source encourages contributions from everyone.
30
36
 
31
- # Licensing
37
+ ## 📒 Licensing
32
38
 
33
39
  Copyright (c) 2025 KfW
34
40
 
35
- Licensed under the **Mozilla Public License 2.0 (MPL-2.0)** (the "License"); you may not use this file except in compliance with the License.
41
+ Licensed under the **Mozilla Public License 2.0 (MPL-2.0)** (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License by reviewing the file [LICENSE](./LICENSE) in the repository. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the [LICENSE](./LICENSE) for the specific language governing permissions and limitations under the License.
42
+
43
+ ## 💁 FAQ
36
44
 
37
- You may obtain a copy of the License by reviewing the file [LICENSE](./LICENSE) in the repository.
45
+ ### How can I use breakpoint design tokens in Tailwind CSS?
38
46
 
39
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the [LICENSE](./LICENSE) for the specific language governing permissions and limitations under the License.
47
+ In Tailwind CSS v3, you can define breakpoints directly in your `tailwind.config.js` using JavaScript.
48
+ In Tailwind CSS v4, you can either use the <a href="https://v3.tailwindcss.com/docs/using-with-preprocessors#using-sass-less-or-stylus">SCSS preprocessor</a> with variables for breakpoints, or use the standard CSS version and define your breakpoints statically in `px` (without variables), since this only affects breakpoints.
package/output/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # README for the Folder Structure in /output
2
2
 
3
- This document describes the structure of the `/output` directory and provides an overview of the files and folders contained within.
4
-
3
+ This document outlines the structure of the /output directory and its contents.
5
4
 
6
5
  ## Folder Structure
7
6
 
@@ -10,13 +9,16 @@ This document describes the structure of the `/output` directory and provides an
10
9
  ├── /figma
11
10
  ├── /penpot
12
11
  ├── /json
13
- ├── /web_stable_10px
14
- └── /web_next_16px
12
+ ├── /web_stable_10px (default)
13
+ └── /web_next_16px (third-party)
15
14
  ```
16
- In the /output directory, you will find all available output formats for Figma, Penpot, JSON, and Web (CSS, SCSS, JS).
17
15
 
18
- In the Web, we differentiate between `/web_stable_10px` and `/web_next_16px`, which use different REM root values.
19
- For KfW.de, MeineKfW, education, and other KfW applications, we use 62.5% (16px = 1.6rem) by default for readability
20
- reasons, meaning that 1rem equals 10px. In third-party systems where we cannot influence the REM root value and it
21
- corresponds to the standard browser font size of 16px (100%), /web_next_16px should be used instead.
22
- Please note that a font size of 10px should never be used. Therefore, it is advisable to set the font size in the to 1.6rem.
16
+ In the `/output` directory, you will find all available output formats for Figma, Penpot, JSON, and Web (CSS, SCSS, JS).
17
+
18
+ ## Web Folder Usage
19
+
20
+ - `/web_stable_10px`: This folder should be used by default. We use it already for KfW.de, MeineKfW, OKP and other KfW applications. It uses a REM root value of 62.5% (1rem = 10px) for optimal readability.
21
+
22
+ - `/web_next_16px`: Use this folder for third-party systems where we cannot influence the REM root value and it corresponds to the standard browser font size of 16px (100%)
23
+
24
+ Note: A font size of 10px should never be used. Therefore, it is advisable to set the font size in the `<body>` to 1.6rem.
@@ -141,95 +141,91 @@
141
141
  }
142
142
  },
143
143
  "Space": {
144
- "Static": {
145
- "5": {
146
- "$value": "5px",
147
- "$type": "spacing"
148
- },
149
- "10": {
150
- "$value": "10px",
151
- "$type": "spacing"
152
- },
153
- "15": {
154
- "$value": "15px",
155
- "$type": "spacing"
156
- },
157
- "20": {
158
- "$value": "20px",
159
- "$type": "spacing"
160
- },
161
- "25": {
162
- "$value": "25px",
163
- "$type": "spacing"
164
- },
165
- "30": {
166
- "$value": "30px",
167
- "$type": "spacing"
168
- },
169
- "35": {
170
- "$value": "35px",
171
- "$type": "spacing"
172
- },
173
- "40": {
174
- "$value": "40px",
175
- "$type": "spacing"
176
- },
177
- "50": {
178
- "$value": "50px",
179
- "$type": "spacing"
180
- },
181
- "60": {
182
- "$value": "60px",
183
- "$type": "spacing"
184
- }
144
+ "5": {
145
+ "$value": "5px",
146
+ "$type": "spacing"
147
+ },
148
+ "10": {
149
+ "$value": "10px",
150
+ "$type": "spacing"
151
+ },
152
+ "15": {
153
+ "$value": "15px",
154
+ "$type": "spacing"
155
+ },
156
+ "20": {
157
+ "$value": "20px",
158
+ "$type": "spacing"
159
+ },
160
+ "25": {
161
+ "$value": "25px",
162
+ "$type": "spacing"
163
+ },
164
+ "30": {
165
+ "$value": "30px",
166
+ "$type": "spacing"
167
+ },
168
+ "35": {
169
+ "$value": "35px",
170
+ "$type": "spacing"
171
+ },
172
+ "40": {
173
+ "$value": "40px",
174
+ "$type": "spacing"
175
+ },
176
+ "50": {
177
+ "$value": "50px",
178
+ "$type": "spacing"
179
+ },
180
+ "60": {
181
+ "$value": "60px",
182
+ "$type": "spacing"
185
183
  }
186
184
  },
187
185
  "Fontsize": {
188
- "Static": {
189
- "Sm": {
190
- "$value": "14px",
191
- "$type": "fontSizes"
192
- },
193
- "Md": {
194
- "$value": "16px",
195
- "$type": "fontSizes"
196
- },
197
- "Lg": {
198
- "$value": "18px",
199
- "$type": "fontSizes"
200
- },
201
- "Xl": {
202
- "$value": "20px",
203
- "$type": "fontSizes"
204
- },
205
- "2xl": {
206
- "$value": "22px",
207
- "$type": "fontSizes"
208
- },
209
- "3xl": {
210
- "$value": "24px",
211
- "$type": "fontSizes"
212
- },
213
- "4xl": {
214
- "$value": "26px",
215
- "$type": "fontSizes"
216
- },
217
- "5xl": {
218
- "$value": "28px",
219
- "$type": "fontSizes"
220
- },
221
- "6xl": {
222
- "$value": "30px",
223
- "$type": "fontSizes"
224
- },
225
- "7xl": {
226
- "$value": "32px",
227
- "$type": "fontSizes"
228
- },
229
- "8xl": {
230
- "$value": "36px",
231
- "$type": "fontSizes"
232
- }
186
+ "Sm": {
187
+ "$value": "14px",
188
+ "$type": "fontSizes"
189
+ },
190
+ "Md": {
191
+ "$value": "16px",
192
+ "$type": "fontSizes"
193
+ },
194
+ "Lg": {
195
+ "$value": "18px",
196
+ "$type": "fontSizes"
197
+ },
198
+ "Xl": {
199
+ "$value": "20px",
200
+ "$type": "fontSizes"
201
+ },
202
+ "2xl": {
203
+ "$value": "22px",
204
+ "$type": "fontSizes"
205
+ },
206
+ "3xl": {
207
+ "$value": "24px",
208
+ "$type": "fontSizes"
209
+ },
210
+ "4xl": {
211
+ "$value": "26px",
212
+ "$type": "fontSizes"
213
+ },
214
+ "5xl": {
215
+ "$value": "28px",
216
+ "$type": "fontSizes"
217
+ },
218
+ "6xl": {
219
+ "$value": "30px",
220
+ "$type": "fontSizes"
221
+ },
222
+ "7xl": {
223
+ "$value": "32px",
224
+ "$type": "fontSizes"
225
+ },
226
+ "8xl": {
227
+ "$value": "36px",
228
+ "$type": "fontSizes"
233
229
  }
234
230
  },
235
231
  "Lineheight": {
@@ -275,15 +271,15 @@
275
271
  "Borderwidth": {
276
272
  "None": {
277
273
  "$value": "0px",
278
- "$type": "dimension"
274
+ "$type": "borderWidth"
279
275
  },
280
276
  "Md": {
281
277
  "$value": "1px",
282
- "$type": "dimension"
278
+ "$type": "borderWidth"
283
279
  },
284
280
  "Lg": {
285
281
  "$value": "2px",
286
- "$type": "dimension"
282
+ "$type": "borderWidth"
287
283
  }
288
284
  },
289
285
  "Fontweight": {
@@ -299,123 +295,19 @@
299
295
  "Letterspacing": {
300
296
  "Tight": {
301
297
  "$value": "-0.5px",
302
- "$type": "dimension"
298
+ "$type": "letterSpacing"
303
299
  },
304
300
  "Normal": {
305
301
  "$value": "0px",
306
- "$type": "dimension"
302
+ "$type": "letterSpacing"
307
303
  },
308
304
  "Wide": {
309
305
  "$value": "0.5px",
310
- "$type": "dimension"
306
+ "$type": "letterSpacing"
311
307
  },
312
308
  "Wider": {
313
309
  "$value": "1px",
314
- "$type": "dimension"
315
- }
316
- },
317
- "Layout": {
318
- "Breakpoint": {
319
- "Xs": {
320
- "$value": "320px",
321
- "$type": "dimension"
322
- },
323
- "Sm": {
324
- "$value": "600px",
325
- "$type": "dimension"
326
- },
327
- "Md": {
328
- "$value": "840px",
329
- "$type": "dimension"
330
- },
331
- "Lg": {
332
- "$value": "960px",
333
- "$type": "dimension"
334
- },
335
- "Xl": {
336
- "$value": "1280px",
337
- "$type": "dimension"
338
- }
339
- },
340
- "Container": {
341
- "Sm": {
342
- "$value": "896px",
343
- "$type": "dimension"
344
- },
345
- "Md": {
346
- "$value": "1080px",
347
- "$type": "dimension"
348
- },
349
- "Lg": {
350
- "$value": "1280px",
351
- "$type": "dimension"
352
- }
353
- },
354
- "Safezone": {
355
- "Static": {
356
- "Md": {
357
- "$value": "20px",
358
- "$type": "dimension"
359
- },
360
- "Lg": {
361
- "$value": "40px",
362
- "$type": "dimension"
363
- }
364
- }
365
- },
366
- "Gridcolumn": {
367
- "1": {
368
- "$value": 1,
369
- "$type": "number"
370
- },
371
- "2": {
372
- "$value": 2,
373
- "$type": "number"
374
- },
375
- "3": {
376
- "$value": 3,
377
- "$type": "number"
378
- },
379
- "4": {
380
- "$value": 4,
381
- "$type": "number"
382
- },
383
- "6": {
384
- "$value": 6,
385
- "$type": "number"
386
- },
387
- "8": {
388
- "$value": 8,
389
- "$type": "number"
390
- },
391
- "12": {
392
- "$value": 12,
393
- "$type": "number"
394
- }
395
- },
396
- "Gridgap": {
397
- "Static": {
398
- "Xs": {
399
- "$value": "12px",
400
- "$type": "dimension"
401
- },
402
- "Sm": {
403
- "$value": "18px",
404
- "$type": "dimension"
405
- },
406
- "Md": {
407
- "$value": "22px",
408
- "$type": "dimension"
409
- },
410
- "Lg": {
411
- "$value": "26px",
412
- "$type": "dimension"
413
- },
414
- "Xl": {
415
- "$value": "36px",
416
- "$type": "dimension"
417
- }
418
- }
310
+ "$type": "letterSpacing"
419
311
  }
420
312
  }
421
313
  },
@@ -491,10 +383,6 @@
491
383
  "$type": "color"
492
384
  }
493
385
  },
494
- "Accent": {
495
- "$value": "#b7f9aa",
496
- "$type": "color"
497
- },
498
386
  "Opaque": {
499
387
  "White-90": {
500
388
  "$value": "#ffffffe6",
@@ -640,31 +528,23 @@
640
528
  "$type": "spacing"
641
529
  },
642
530
  "Large": {
643
- "Min": {
531
+ "Mobile": {
644
532
  "$value": "35px",
645
533
  "$type": "spacing"
646
534
  },
647
- "Max": {
535
+ "Desktop": {
648
536
  "$value": "40px",
649
537
  "$type": "spacing"
650
- },
651
- "Val": {
652
- "$value": "33.333px",
653
- "$type": "spacing"
654
538
  }
655
539
  },
656
540
  "Big": {
657
- "Min": {
541
+ "Mobile": {
658
542
  "$value": "50px",
659
543
  "$type": "spacing"
660
544
  },
661
- "Max": {
545
+ "Desktop": {
662
546
  "$value": "60px",
663
547
  "$type": "spacing"
664
- },
665
- "Val": {
666
- "$value": "46.666px",
667
- "$type": "spacing"
668
548
  }
669
549
  }
670
550
  },
@@ -728,59 +608,43 @@
728
608
  "$type": "fontSizes"
729
609
  },
730
610
  "Heading-1": {
731
- "Min": {
611
+ "Mobile": {
732
612
  "$value": "30px",
733
613
  "$type": "fontSizes"
734
614
  },
735
- "Max": {
615
+ "Desktop": {
736
616
  "$value": "36px",
737
617
  "$type": "fontSizes"
738
- },
739
- "Val": {
740
- "$value": "28px",
741
- "$type": "fontSizes"
742
618
  }
743
619
  },
744
620
  "Heading-2": {
745
- "Min": {
621
+ "Mobile": {
746
622
  "$value": "28px",
747
623
  "$type": "fontSizes"
748
624
  },
749
- "Max": {
625
+ "Desktop": {
750
626
  "$value": "32px",
751
627
  "$type": "fontSizes"
752
- },
753
- "Val": {
754
- "$value": "26.666px",
755
- "$type": "fontSizes"
756
628
  }
757
629
  },
758
630
  "Heading-3": {
759
- "Min": {
631
+ "Mobile": {
760
632
  "$value": "24px",
761
633
  "$type": "fontSizes"
762
634
  },
763
- "Max": {
635
+ "Desktop": {
764
636
  "$value": "26px",
765
637
  "$type": "fontSizes"
766
- },
767
- "Val": {
768
- "$value": "23.333px",
769
- "$type": "fontSizes"
770
638
  }
771
639
  },
772
640
  "Heading-4": {
773
- "Min": {
641
+ "Mobile": {
774
642
  "$value": "20px",
775
643
  "$type": "fontSizes"
776
644
  },
777
- "Max": {
645
+ "Desktop": {
778
646
  "$value": "22px",
779
647
  "$type": "fontSizes"
780
- },
781
- "Val": {
782
- "$value": "19.333px",
783
- "$type": "fontSizes"
784
648
  }
785
649
  },
786
650
  "Heading-5": {
@@ -814,20 +678,6 @@
814
678
  "$value": "4px",
815
679
  "$type": "borderRadius"
816
680
  },
817
- "Focusring": {
818
- "Outline": {
819
- "$value": {
820
- "color": "#00446e",
821
- "width": "2px",
822
- "style": "dashed"
823
- },
824
- "$type": "border"
825
- },
826
- "Outline-offset": {
827
- "$value": "2px",
828
- "$type": "dimension"
829
- }
830
- },
831
681
  "Fontweight": {
832
682
  "Default": {
833
683
  "$value": 400,
@@ -837,48 +687,6 @@
837
687
  "$value": 500,
838
688
  "$type": "fontWeights"
839
689
  }
840
- },
841
- "Breakpoint": {
842
- "Mobile": {
843
- "$value": "600px",
844
- "$type": "dimension"
845
- },
846
- "Tablet": {
847
- "$value": "840px",
848
- "$type": "dimension"
849
- },
850
- "Desktop": {
851
- "$value": "960px",
852
- "$type": "dimension"
853
- }
854
- },
855
- "Contentwrapper": {
856
- "Narrow": {
857
- "$value": "896px",
858
- "$type": "dimension"
859
- },
860
- "Basic": {
861
- "$value": "1080px",
862
- "$type": "dimension"
863
- },
864
- "Extended": {
865
- "$value": "1280px",
866
- "$type": "dimension"
867
- }
868
- },
869
- "Safezone": {
870
- "Min": {
871
- "$value": "20px",
872
- "$type": "dimension"
873
- },
874
- "Max": {
875
- "$value": "40px",
876
- "$type": "dimension"
877
- },
878
- "Val": {
879
- "$value": "-13.333px",
880
- "$type": "dimension"
881
- }
882
690
  }
883
691
  },
884
692
  "$metadata": {