@openkfw/design-tokens 0.1.3 → 0.2.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.
package/README.md CHANGED
@@ -1,8 +1,14 @@
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
 
@@ -15,7 +21,8 @@ Although the source code for KfW Design Tokens is free and available under the M
15
21
  Run the following command to install the Design Tokens:
16
22
 
17
23
  ```bash
18
- npm install @openkfw/design-tokens
24
+
25
+ npm i -D @openkfw/design-tokens
19
26
  ```
20
27
 
21
28
  Import or use files inside the `output` folder, e.g.:
@@ -26,7 +33,7 @@ Import or use files inside the `output` folder, e.g.:
26
33
 
27
34
  ## ❤️ Contributing
28
35
 
29
- Our commitment to open source means that we are enabling - even encouraging - all interested parties to contribute.
36
+ Our commitment to open source encourages contributions from everyone.
30
37
 
31
38
  ## 📒 Licensing
32
39
 
@@ -38,4 +45,5 @@ Licensed under the **Mozilla Public License 2.0 (MPL-2.0)** (the "License"); you
38
45
 
39
46
  ### How can I use breakpoint design tokens in Tailwind CSS?
40
47
 
41
- In Tailwind CSS v3, you can easily add breakpoints by defining them in your tailwind.config.js file using JavaScript. In Tailwind CSS v4, if you want to use CSS variables with breakpoints, you may need to utilize a preprocessor like <a href="https://v3.tailwindcss.com/docs/using-with-preprocessors#using-sass-less-or-stylus">Sass</a>, as CSS variables and breakpoints do not work seamlessly together in that version.
48
+ In Tailwind CSS v3, you can define breakpoints directly in your `tailwind.config.js` using JavaScript.
49
+ 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
  },
@@ -636,31 +528,23 @@
636
528
  "$type": "spacing"
637
529
  },
638
530
  "Large": {
639
- "Min": {
531
+ "Mobile": {
640
532
  "$value": "35px",
641
533
  "$type": "spacing"
642
534
  },
643
- "Max": {
535
+ "Desktop": {
644
536
  "$value": "40px",
645
537
  "$type": "spacing"
646
- },
647
- "Val": {
648
- "$value": "33.333px",
649
- "$type": "spacing"
650
538
  }
651
539
  },
652
540
  "Big": {
653
- "Min": {
541
+ "Mobile": {
654
542
  "$value": "50px",
655
543
  "$type": "spacing"
656
544
  },
657
- "Max": {
545
+ "Desktop": {
658
546
  "$value": "60px",
659
547
  "$type": "spacing"
660
- },
661
- "Val": {
662
- "$value": "46.666px",
663
- "$type": "spacing"
664
548
  }
665
549
  }
666
550
  },
@@ -724,59 +608,43 @@
724
608
  "$type": "fontSizes"
725
609
  },
726
610
  "Heading-1": {
727
- "Min": {
611
+ "Mobile": {
728
612
  "$value": "30px",
729
613
  "$type": "fontSizes"
730
614
  },
731
- "Max": {
615
+ "Desktop": {
732
616
  "$value": "36px",
733
617
  "$type": "fontSizes"
734
- },
735
- "Val": {
736
- "$value": "28px",
737
- "$type": "fontSizes"
738
618
  }
739
619
  },
740
620
  "Heading-2": {
741
- "Min": {
621
+ "Mobile": {
742
622
  "$value": "28px",
743
623
  "$type": "fontSizes"
744
624
  },
745
- "Max": {
625
+ "Desktop": {
746
626
  "$value": "32px",
747
627
  "$type": "fontSizes"
748
- },
749
- "Val": {
750
- "$value": "26.666px",
751
- "$type": "fontSizes"
752
628
  }
753
629
  },
754
630
  "Heading-3": {
755
- "Min": {
631
+ "Mobile": {
756
632
  "$value": "24px",
757
633
  "$type": "fontSizes"
758
634
  },
759
- "Max": {
635
+ "Desktop": {
760
636
  "$value": "26px",
761
637
  "$type": "fontSizes"
762
- },
763
- "Val": {
764
- "$value": "23.333px",
765
- "$type": "fontSizes"
766
638
  }
767
639
  },
768
640
  "Heading-4": {
769
- "Min": {
641
+ "Mobile": {
770
642
  "$value": "20px",
771
643
  "$type": "fontSizes"
772
644
  },
773
- "Max": {
645
+ "Desktop": {
774
646
  "$value": "22px",
775
647
  "$type": "fontSizes"
776
- },
777
- "Val": {
778
- "$value": "19.333px",
779
- "$type": "fontSizes"
780
648
  }
781
649
  },
782
650
  "Heading-5": {
@@ -810,20 +678,6 @@
810
678
  "$value": "4px",
811
679
  "$type": "borderRadius"
812
680
  },
813
- "Focusring": {
814
- "Outline": {
815
- "$value": {
816
- "color": "#00446e",
817
- "width": "2px",
818
- "style": "dashed"
819
- },
820
- "$type": "border"
821
- },
822
- "Outline-offset": {
823
- "$value": "2px",
824
- "$type": "dimension"
825
- }
826
- },
827
681
  "Fontweight": {
828
682
  "Default": {
829
683
  "$value": 400,
@@ -833,48 +687,6 @@
833
687
  "$value": 500,
834
688
  "$type": "fontWeights"
835
689
  }
836
- },
837
- "Breakpoint": {
838
- "Mobile": {
839
- "$value": "600px",
840
- "$type": "dimension"
841
- },
842
- "Tablet": {
843
- "$value": "840px",
844
- "$type": "dimension"
845
- },
846
- "Desktop": {
847
- "$value": "960px",
848
- "$type": "dimension"
849
- }
850
- },
851
- "Contentwrapper": {
852
- "Narrow": {
853
- "$value": "896px",
854
- "$type": "dimension"
855
- },
856
- "Basic": {
857
- "$value": "1080px",
858
- "$type": "dimension"
859
- },
860
- "Extended": {
861
- "$value": "1280px",
862
- "$type": "dimension"
863
- }
864
- },
865
- "Safezone": {
866
- "Min": {
867
- "$value": "20px",
868
- "$type": "dimension"
869
- },
870
- "Max": {
871
- "$value": "40px",
872
- "$type": "dimension"
873
- },
874
- "Val": {
875
- "$value": "-13.333px",
876
- "$type": "dimension"
877
- }
878
690
  }
879
691
  },
880
692
  "$metadata": {
@@ -6982,42 +6982,26 @@
6982
6982
  ]
6983
6983
  },
6984
6984
  "focusring": {
6985
- "outline": {
6986
- "key": "{semantic.focusring.outline}",
6987
- "$type": "border",
6985
+ "outline-width": {
6986
+ "key": "{semantic.focusring.outline-width}",
6987
+ "$type": "dimension",
6988
6988
  "$value": {
6989
- "color": {
6990
- "colorSpace": "srgb",
6991
- "components": [
6992
- 0,
6993
- 0.2667,
6994
- 0.4314
6995
- ],
6996
- "hex": "#00446e"
6997
- },
6998
- "width": {
6999
- "unit": "px",
7000
- "value": 2
7001
- },
7002
- "style": "dashed"
6989
+ "unit": "px",
6990
+ "value": 2
7003
6991
  },
7004
6992
  "filePath": "tokens/tokens.json",
7005
6993
  "isSource": true,
7006
6994
  "original": {
7007
- "$type": "border",
7008
- "$value": {
7009
- "color": "{semantic.color.fn.active}",
7010
- "width": "{base.borderwidth.lg}",
7011
- "style": "dashed"
7012
- },
7013
- "key": "{semantic.focusring.outline}"
6995
+ "$type": "dimension",
6996
+ "$value": "{base.borderwidth.lg}",
6997
+ "key": "{semantic.focusring.outline-width}"
7014
6998
  },
7015
- "name": "outline",
6999
+ "name": "outline-width",
7016
7000
  "attributes": {},
7017
7001
  "path": [
7018
7002
  "semantic",
7019
7003
  "focusring",
7020
- "outline"
7004
+ "outline-width"
7021
7005
  ]
7022
7006
  },
7023
7007
  "outline-offset": {
@@ -7041,6 +7025,29 @@
7041
7025
  "focusring",
7042
7026
  "outline-offset"
7043
7027
  ]
7028
+ },
7029
+ "outline-style": {
7030
+ "key": "{semantic.focusring.outline-style}",
7031
+ "$type": "strokeStyle",
7032
+ "$value": "dashed",
7033
+ "filePath": "tokens/tokens.json",
7034
+ "isSource": true,
7035
+ "original": {
7036
+ "$type": "strokeStyle",
7037
+ "$value": "dashed",
7038
+ "key": "{semantic.focusring.outline-style}"
7039
+ },
7040
+ "name": "kfw-focusring-outline-style",
7041
+ "attributes": {
7042
+ "category": "semantic",
7043
+ "type": "focusring",
7044
+ "item": "outline-style"
7045
+ },
7046
+ "path": [
7047
+ "semantic",
7048
+ "focusring",
7049
+ "outline-style"
7050
+ ]
7044
7051
  }
7045
7052
  },
7046
7053
  "fontweight": {