@marioschmidt/design-system-components 1.7.6 → 1.7.7

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 (147) hide show
  1. package/dist/www/css/advertorial/components/article.css +1 -1
  2. package/dist/www/css/advertorial/components/audioplayer.css +1 -1
  3. package/dist/www/css/advertorial/components/avatar.css +1 -1
  4. package/dist/www/css/advertorial/components/badge.css +1 -1
  5. package/dist/www/css/advertorial/components/breadcrumb.css +1 -1
  6. package/dist/www/css/advertorial/components/breakingnews.css +1 -1
  7. package/dist/www/css/advertorial/components/button.css +1 -1
  8. package/dist/www/css/advertorial/components/card.css +1 -1
  9. package/dist/www/css/advertorial/components/carousel.css +1 -1
  10. package/dist/www/css/advertorial/components/chip.css +1 -1
  11. package/dist/www/css/advertorial/components/datepicker.css +1 -1
  12. package/dist/www/css/advertorial/components/drawers.css +1 -1
  13. package/dist/www/css/advertorial/components/dropdown.css +1 -1
  14. package/dist/www/css/advertorial/components/footer.css +1 -1
  15. package/dist/www/css/advertorial/components/icon.css +1 -1
  16. package/dist/www/css/advertorial/components/iconbutton.css +1 -1
  17. package/dist/www/css/advertorial/components/infoelement.css +1 -1
  18. package/dist/www/css/advertorial/components/inputfield.css +1 -1
  19. package/dist/www/css/advertorial/components/liveticker.css +1 -1
  20. package/dist/www/css/advertorial/components/mediaplayer.css +1 -1
  21. package/dist/www/css/advertorial/components/menu.css +1 -1
  22. package/dist/www/css/advertorial/components/newsticker.css +1 -1
  23. package/dist/www/css/advertorial/components/pagination.css +1 -1
  24. package/dist/www/css/advertorial/components/paywall.css +1 -1
  25. package/dist/www/css/advertorial/components/quote.css +1 -1
  26. package/dist/www/css/advertorial/components/radiobutton.css +1 -1
  27. package/dist/www/css/advertorial/components/search.css +1 -1
  28. package/dist/www/css/advertorial/components/sectiontitle.css +1 -1
  29. package/dist/www/css/advertorial/components/separator.css +1 -1
  30. package/dist/www/css/advertorial/components/skeletons.css +1 -1
  31. package/dist/www/css/advertorial/components/slider.css +1 -1
  32. package/dist/www/css/advertorial/components/specialnavi.css +1 -1
  33. package/dist/www/css/advertorial/components/spinner.css +1 -1
  34. package/dist/www/css/advertorial/components/tab.css +1 -1
  35. package/dist/www/css/advertorial/components/table.css +1 -1
  36. package/dist/www/css/advertorial/components/teaser.css +1 -1
  37. package/dist/www/css/advertorial/components/toggleswitch.css +1 -1
  38. package/dist/www/css/advertorial/components/video.css +1 -1
  39. package/dist/www/css/advertorial/theme.css +1 -1
  40. package/dist/www/css/advertorial/tokens.css +1 -1
  41. package/dist/www/css/bild/components/alert.css +1 -1
  42. package/dist/www/css/bild/components/article.css +1 -1
  43. package/dist/www/css/bild/components/audioplayer.css +1 -1
  44. package/dist/www/css/bild/components/avatar.css +1 -1
  45. package/dist/www/css/bild/components/badge.css +1 -1
  46. package/dist/www/css/bild/components/breadcrumb.css +1 -1
  47. package/dist/www/css/bild/components/breakingnews.css +1 -1
  48. package/dist/www/css/bild/components/button.css +1 -1
  49. package/dist/www/css/bild/components/card.css +1 -1
  50. package/dist/www/css/bild/components/carousel.css +1 -1
  51. package/dist/www/css/bild/components/chip.css +1 -1
  52. package/dist/www/css/bild/components/datepicker.css +1 -1
  53. package/dist/www/css/bild/components/drawers.css +1 -1
  54. package/dist/www/css/bild/components/dropdown.css +1 -1
  55. package/dist/www/css/bild/components/empties.css +1 -1
  56. package/dist/www/css/bild/components/footer.css +1 -1
  57. package/dist/www/css/bild/components/gallery.css +1 -1
  58. package/dist/www/css/bild/components/icon.css +1 -1
  59. package/dist/www/css/bild/components/iconbutton.css +1 -1
  60. package/dist/www/css/bild/components/infoelement.css +1 -1
  61. package/dist/www/css/bild/components/inputfield.css +1 -1
  62. package/dist/www/css/bild/components/kicker.css +1 -1
  63. package/dist/www/css/bild/components/liveticker.css +1 -1
  64. package/dist/www/css/bild/components/mediaplayer.css +1 -1
  65. package/dist/www/css/bild/components/menu.css +1 -1
  66. package/dist/www/css/bild/components/menuitem.css +1 -1
  67. package/dist/www/css/bild/components/newsticker.css +1 -1
  68. package/dist/www/css/bild/components/pagination.css +1 -1
  69. package/dist/www/css/bild/components/partnerlinks.css +1 -1
  70. package/dist/www/css/bild/components/paywall.css +1 -1
  71. package/dist/www/css/bild/components/quote.css +1 -1
  72. package/dist/www/css/bild/components/radiobutton.css +1 -1
  73. package/dist/www/css/bild/components/search.css +1 -1
  74. package/dist/www/css/bild/components/sectiontitle.css +1 -1
  75. package/dist/www/css/bild/components/selection.css +1 -1
  76. package/dist/www/css/bild/components/separator.css +1 -1
  77. package/dist/www/css/bild/components/skeletons.css +1 -1
  78. package/dist/www/css/bild/components/slider.css +1 -1
  79. package/dist/www/css/bild/components/specialnavi.css +1 -1
  80. package/dist/www/css/bild/components/spinner.css +1 -1
  81. package/dist/www/css/bild/components/subheader.css +1 -1
  82. package/dist/www/css/bild/components/tab.css +1 -1
  83. package/dist/www/css/bild/components/table.css +1 -1
  84. package/dist/www/css/bild/components/teaser.css +1 -1
  85. package/dist/www/css/bild/components/toggleswitch.css +1 -1
  86. package/dist/www/css/bild/components/video.css +1 -1
  87. package/dist/www/css/bild/theme.css +1 -1
  88. package/dist/www/css/bild/tokens.css +1 -1
  89. package/dist/www/css/bundles/advertorial.css +1 -1
  90. package/dist/www/css/bundles/bild.css +1 -1
  91. package/dist/www/css/bundles/sportbild.css +1 -1
  92. package/dist/www/css/shared/colorprimitive.css +1 -1
  93. package/dist/www/css/shared/fontprimitive.css +1 -1
  94. package/dist/www/css/shared/primitives.css +1 -1
  95. package/dist/www/css/shared/sizeprimitive.css +1 -1
  96. package/dist/www/css/shared/spaceprimitive.css +1 -1
  97. package/dist/www/css/sportbild/components/alert.css +1 -1
  98. package/dist/www/css/sportbild/components/article.css +1 -1
  99. package/dist/www/css/sportbild/components/audioplayer.css +1 -1
  100. package/dist/www/css/sportbild/components/avatar.css +1 -1
  101. package/dist/www/css/sportbild/components/badge.css +1 -1
  102. package/dist/www/css/sportbild/components/breadcrumb.css +1 -1
  103. package/dist/www/css/sportbild/components/breakingnews.css +1 -1
  104. package/dist/www/css/sportbild/components/button.css +1 -1
  105. package/dist/www/css/sportbild/components/card.css +1 -1
  106. package/dist/www/css/sportbild/components/carousel.css +1 -1
  107. package/dist/www/css/sportbild/components/chip.css +1 -1
  108. package/dist/www/css/sportbild/components/datepicker.css +1 -1
  109. package/dist/www/css/sportbild/components/drawers.css +1 -1
  110. package/dist/www/css/sportbild/components/dropdown.css +1 -1
  111. package/dist/www/css/sportbild/components/empties.css +1 -1
  112. package/dist/www/css/sportbild/components/footer.css +1 -1
  113. package/dist/www/css/sportbild/components/gallery.css +1 -1
  114. package/dist/www/css/sportbild/components/icon.css +1 -1
  115. package/dist/www/css/sportbild/components/iconbutton.css +1 -1
  116. package/dist/www/css/sportbild/components/infoelement.css +1 -1
  117. package/dist/www/css/sportbild/components/inputfield.css +1 -1
  118. package/dist/www/css/sportbild/components/kicker.css +1 -1
  119. package/dist/www/css/sportbild/components/liveticker.css +1 -1
  120. package/dist/www/css/sportbild/components/mediaplayer.css +1 -1
  121. package/dist/www/css/sportbild/components/menu.css +1 -1
  122. package/dist/www/css/sportbild/components/menuitem.css +1 -1
  123. package/dist/www/css/sportbild/components/newsticker.css +1 -1
  124. package/dist/www/css/sportbild/components/pagination.css +1 -1
  125. package/dist/www/css/sportbild/components/partnerlinks.css +1 -1
  126. package/dist/www/css/sportbild/components/paywall.css +1 -1
  127. package/dist/www/css/sportbild/components/quote.css +1 -1
  128. package/dist/www/css/sportbild/components/radiobutton.css +1 -1
  129. package/dist/www/css/sportbild/components/search.css +1 -1
  130. package/dist/www/css/sportbild/components/sectiontitle.css +1 -1
  131. package/dist/www/css/sportbild/components/selection.css +1 -1
  132. package/dist/www/css/sportbild/components/separator.css +1 -1
  133. package/dist/www/css/sportbild/components/skeletons.css +1 -1
  134. package/dist/www/css/sportbild/components/slider.css +1 -1
  135. package/dist/www/css/sportbild/components/specialnavi.css +1 -1
  136. package/dist/www/css/sportbild/components/spinner.css +1 -1
  137. package/dist/www/css/sportbild/components/subheader.css +1 -1
  138. package/dist/www/css/sportbild/components/tab.css +1 -1
  139. package/dist/www/css/sportbild/components/table.css +1 -1
  140. package/dist/www/css/sportbild/components/teaser.css +1 -1
  141. package/dist/www/css/sportbild/components/toggleswitch.css +1 -1
  142. package/dist/www/css/sportbild/components/video.css +1 -1
  143. package/dist/www/css/sportbild/theme.css +1 -1
  144. package/dist/www/css/sportbild/tokens.css +1 -1
  145. package/dist/www/icons/manifest.json +2 -2
  146. package/package.json +1 -1
  147. package/dist/www/css/README.md +0 -942
@@ -1,942 +0,0 @@
1
- # 🌐 CSS - Design System Tokens
2
-
3
- > **CSS Custom Properties for Web Applications**
4
- >
5
- > Responsive, multi-brand ready with **Dual-Axis Architecture**.
6
-
7
- ---
8
-
9
- ## 📋 Table of Contents
10
-
11
- - [🚀 Quick Start](#-quick-start)
12
- - [🔀 Dual-Axis Architecture](#-dual-axis-architecture)
13
- - [📁 File Structure](#-file-structure)
14
- - [📝 Naming Conventions](#-naming-conventions)
15
- - [🏷️ Data Attributes](#️-data-attributes)
16
- - [📦 Bundle Options](#-bundle-options)
17
- - [🎨 Token Categories](#-token-categories)
18
- - [📱 Responsive Tokens](#-responsive-tokens)
19
- - [🎚️ Density Tokens](#️-density-tokens)
20
- - [🧩 Component Tokens](#-component-tokens)
21
- - [✍️ Typography & Effects](#️-typography--effects)
22
- - [💡 Usage Examples](#-usage-examples)
23
- - [📚 Storybook](#-storybook)
24
-
25
- ---
26
-
27
- ## 🚀 Quick Start
28
-
29
- ### 1. HTML Setup
30
-
31
- ```html
32
- <!DOCTYPE html>
33
- <html data-color-brand="bild" data-content-brand="bild" data-theme="light" data-density="default">
34
- <head>
35
- <!-- Option A: All-in-one Bundle -->
36
- <link rel="stylesheet" href="css/bundles/bild.css">
37
-
38
- <!-- Option B: Modular (recommended for optimization) -->
39
- <link rel="stylesheet" href="css/shared/primitives.css">
40
- <link rel="stylesheet" href="css/bild/theme.css">
41
- <link rel="stylesheet" href="css/bild/tokens.css">
42
- <link rel="stylesheet" href="css/bild/components/button.css">
43
- </head>
44
- <body>
45
- <!-- Your content -->
46
- </body>
47
- </html>
48
- ```
49
-
50
- ### 2. Use Tokens
51
-
52
- ```css
53
- .my-component {
54
- /* Semantic tokens */
55
- color: var(--text-color-primary);
56
- background: var(--surface-color-primary);
57
-
58
- /* Spacing tokens */
59
- padding: var(--grid-space-resp-base);
60
- gap: var(--stack-space-resp-sm);
61
-
62
- /* Component tokens */
63
- border-radius: var(--button-border-radius);
64
- }
65
- ```
66
-
67
- ### 3. Switch Themes (JavaScript)
68
-
69
- ```javascript
70
- // Toggle dark mode
71
- document.documentElement.dataset.theme = 'dark';
72
-
73
- // Switch density
74
- document.documentElement.dataset.density = 'dense';
75
-
76
- // Switch color brand (colors + effects)
77
- document.documentElement.dataset.colorBrand = 'sportbild';
78
-
79
- // Switch content brand (typography + sizing)
80
- document.documentElement.dataset.contentBrand = 'advertorial';
81
- ```
82
-
83
- ---
84
-
85
- ## 🔀 Dual-Axis Architecture
86
-
87
- The CSS output uses a **Dual-Axis Architecture** to separate concerns:
88
-
89
- ```
90
- ┌─────────────────────────────────────────────────────────────────┐
91
- │ data-color-brand │ data-content-brand │
92
- │ (ColorBrand Axis) │ (ContentBrand Axis) │
93
- ├────────────────────────────┼────────────────────────────────────┤
94
- │ Colors │ Typography │
95
- │ Effects/Shadows │ Sizing/Spacing │
96
- │ │ Breakpoints │
97
- │ │ Density │
98
- ├────────────────────────────┼────────────────────────────────────┤
99
- │ Values: bild, sportbild │ Values: bild, sportbild, │
100
- │ │ advertorial │
101
- └────────────────────────────┴────────────────────────────────────┘
102
- ```
103
-
104
- ### Why Dual-Axis?
105
-
106
- **Advertorial** content needs its own typography and sizing but should inherit colors from the parent brand (BILD or SportBILD). The Dual-Axis architecture enables this:
107
-
108
- ```html
109
- <!-- Advertorial in BILD context -->
110
- <html data-color-brand="bild" data-theme="light">
111
- <article data-content-brand="advertorial">
112
- <!-- Uses BILD colors + Advertorial typography -->
113
- </article>
114
- </html>
115
-
116
- <!-- Advertorial in SportBILD context -->
117
- <html data-color-brand="sportbild" data-theme="dark">
118
- <article data-content-brand="advertorial">
119
- <!-- Uses SportBILD colors + Advertorial typography -->
120
- </article>
121
- </html>
122
- ```
123
-
124
- ---
125
-
126
- ## 📁 File Structure
127
-
128
- ```
129
- dist/css/
130
- ├── shared/
131
- │ └── primitives.css # Color, Space, Size, Font primitives
132
-
133
- ├── bundles/ # All-in-one bundles per brand
134
- │ ├── bild.css # (~122 KB)
135
- │ ├── sportbild.css # (~124 KB)
136
- │ └── advertorial.css # (~81 KB)
137
-
138
- ├── bild/ # Modular files
139
- │ ├── theme.css # Semantic colors + Effects (light/dark)
140
- │ ├── tokens.css # Breakpoints + Typography + Density
141
- │ └── components/ # Component-specific tokens
142
- │ ├── button.css
143
- │ ├── article.css
144
- │ ├── teaser.css
145
- │ └── ... (52 components)
146
-
147
- ├── sportbild/ # Same structure as bild
148
- │ └── ...
149
-
150
- └── advertorial/ # ContentBrand only (no theme.css content)
151
- ├── theme.css # Empty (inherits from ColorBrand)
152
- ├── tokens.css # Typography + Breakpoints
153
- └── components/ # 39 components
154
- ```
155
-
156
- ---
157
-
158
- ## 📝 Naming Conventions
159
-
160
- CSS tokens use **kebab-case** with hyphen separation before AND after numbers:
161
-
162
- | Token Type | Example | Pattern |
163
- |------------|---------|---------|
164
- | Spacing | `--space-1-x`, `--space-2-x` | Numbers separated by hyphens |
165
- | Decimal spacing | `--space-0-p-5-x`, `--space-1-p-25-x` | Decimals use `p` for point |
166
- | Colors | `--color-bild-red-50`, `--alpha-red-50-a-80` | Numbers and suffixes separated |
167
- | Typography | `.display-1`, `.headline-2` | Class names with hyphen before number |
168
- | Effects | `.shadow-soft-sm`, `.shadow-hard-md` | Size abbreviations in lowercase |
169
-
170
- > **Note:** This ensures consistency and readability. The build system normalizes any Figma input format to this convention.
171
-
172
- ---
173
-
174
- ## 🏷️ Data Attributes
175
-
176
- ### Required Attributes
177
-
178
- | Attribute | Values | Axis | Description |
179
- |-----------|--------|------|-------------|
180
- | `data-color-brand` | `bild`, `sportbild` | ColorBrand | Colors + Effects |
181
- | `data-content-brand` | `bild`, `sportbild`, `advertorial` | ContentBrand | Typography + Sizing |
182
- | `data-theme` | `light`, `dark` | - | Color mode |
183
- | `data-density` | `default`, `dense`, `spacious` | - | Spacing density |
184
-
185
- ### Selector Patterns
186
-
187
- ```css
188
- /* ColorBrand Axis (colors + effects) */
189
- [data-color-brand="bild"][data-theme="light"] { --text-color-primary: ...; }
190
- [data-color-brand="bild"][data-theme="dark"] { --text-color-primary: ...; }
191
- [data-color-brand="bild"][data-theme="light"] .shadow-soft-md { box-shadow: ...; }
192
-
193
- /* ContentBrand Axis (typography + sizing) */
194
- [data-content-brand="bild"] { --grid-space-resp-base: ...; }
195
- [data-content-brand="bild"] { .headline-1 { font-family: ...; } }
196
-
197
- /* ContentBrand + Density */
198
- [data-content-brand="bild"][data-density="default"] { ... }
199
- [data-content-brand="bild"][data-density="dense"] { ... }
200
-
201
- /* ContentBrand + Breakpoints */
202
- @media (min-width: 600px) {
203
- [data-content-brand="bild"] { ... }
204
- }
205
- ```
206
-
207
- ---
208
-
209
- ## 📦 Bundle Options
210
-
211
- ### Option A: All-in-One Bundle
212
-
213
- Best for: Simple projects, quick prototyping.
214
-
215
- ```html
216
- <link rel="stylesheet" href="css/bundles/bild.css">
217
- ```
218
-
219
- Contains: Primitives + Theme + Tokens + All Components (~122 KB)
220
-
221
- ### Option B: Modular Loading
222
-
223
- Best for: Production, optimal bundle size.
224
-
225
- ```html
226
- <!-- Core (always needed) -->
227
- <link rel="stylesheet" href="css/shared/primitives.css">
228
- <link rel="stylesheet" href="css/bild/theme.css">
229
- <link rel="stylesheet" href="css/bild/tokens.css">
230
-
231
- <!-- Only components you use -->
232
- <link rel="stylesheet" href="css/bild/components/button.css">
233
- <link rel="stylesheet" href="css/bild/components/teaser.css">
234
- ```
235
-
236
- ### Option C: Theme + Tokens Only
237
-
238
- Best for: Using only semantic tokens, no component tokens.
239
-
240
- ```html
241
- <link rel="stylesheet" href="css/shared/primitives.css">
242
- <link rel="stylesheet" href="css/bild/theme.css">
243
- <link rel="stylesheet" href="css/bild/tokens.css">
244
- ```
245
-
246
- ---
247
-
248
- ## 🎨 Token Categories
249
-
250
- ### 1. Primitives (shared/primitives.css)
251
-
252
- Raw design values, brand-independent.
253
-
254
- ```css
255
- :root {
256
- /* Colors */
257
- --color-bild-red-50: #DD0000;
258
- --color-neutral-15: #232629;
259
- --color-neutral-100: #FFFFFF;
260
-
261
- /* Spacing (note: numbers are hyphen-separated) */
262
- --space-1-x: 8px;
263
- --space-2-x: 16px;
264
- --space-3-x: 24px;
265
-
266
- /* Sizes */
267
- --size-4-x: 32px;
268
- --size-6-x: 48px;
269
-
270
- /* Fonts */
271
- --font-family-gotham-xnarrow: Gotham XNarrow;
272
- --font-weight-bold: 700;
273
- }
274
- ```
275
-
276
- ### 2. Semantic Tokens (theme.css)
277
-
278
- Meaningful design intent, theme-aware. Uses **ColorBrand** axis.
279
-
280
- ```css
281
- [data-color-brand="bild"][data-theme="light"] {
282
- /* Text */
283
- --text-color-primary: var(--color-neutral-15, #232629);
284
- --text-color-accent: var(--color-bild-red-50, #DD0000);
285
-
286
- /* Surfaces */
287
- --surface-color-primary: var(--color-neutral-100, #FFFFFF);
288
- --surface-color-secondary: var(--color-neutral-96, #F2F4F5);
289
-
290
- /* Borders */
291
- --border-color-medium-contrast: var(--color-neutral-85, #CED4DA);
292
-
293
- /* Core */
294
- --core-color-primary: var(--color-bild-red-50, #DD0000);
295
- }
296
- ```
297
-
298
- ### 3. Responsive Tokens (tokens.css)
299
-
300
- Breakpoint-aware sizing and typography. Uses **ContentBrand** axis.
301
-
302
- ```css
303
- /* Base (mobile-first) */
304
- [data-content-brand="bild"] {
305
- --headline-1-font-size: 48px;
306
- --grid-space-resp-base: var(--space-1-p-5-x, 12px);
307
- }
308
-
309
- /* Tablet (600px+) */
310
- @media (min-width: 600px) {
311
- [data-content-brand="bild"] {
312
- --headline-1-font-size: 72px;
313
- }
314
- }
315
-
316
- /* Desktop (1024px+) */
317
- @media (min-width: 1024px) {
318
- [data-content-brand="bild"] {
319
- --headline-1-font-size: 100px;
320
- --grid-space-resp-base: var(--space-2-x, 16px);
321
- }
322
- }
323
- ```
324
-
325
- ### 4. Component Tokens (components/*.css)
326
-
327
- Component-specific design decisions. Uses both axes.
328
-
329
- ```css
330
- /* Colors → ColorBrand Axis */
331
- [data-color-brand="bild"][data-theme="light"] {
332
- --button-primary-brand-bg-color-idle: var(--color-bild-red-50, #DD0000);
333
- --button-primary-label-color: var(--color-neutral-100, #FFFFFF);
334
- }
335
-
336
- /* Density → ContentBrand Axis */
337
- [data-content-brand="bild"][data-density="default"] {
338
- --density-button-inline-space: var(--space-2-p-5-x, 20px);
339
- --density-button-label-font-size: 17px;
340
- }
341
-
342
- /* Sizing → ContentBrand Axis */
343
- [data-content-brand="bild"] {
344
- --button-border-radius: var(--border-radius-md);
345
- --button-border-width-size: var(--border-width-thick);
346
- }
347
- ```
348
-
349
- ---
350
-
351
- ## 📱 Responsive Tokens
352
-
353
- ### Breakpoints
354
-
355
- | Breakpoint | Min-Width | Device Class |
356
- |------------|-----------|--------------|
357
- | `xs` | 320px | Mobile (base) |
358
- | `sm` | 390px | Large mobile |
359
- | `md` | 600px | Tablet |
360
- | `lg` | 1024px | Desktop |
361
-
362
- ### Cascade Optimization
363
-
364
- Tokens only appear in media queries when values change:
365
-
366
- ```css
367
- /* Base value */
368
- [data-content-brand="bild"] {
369
- --article-headline-font-size: var(--headline-2-font-size); /* xs: 40px */
370
- }
371
-
372
- /* Changes at md */
373
- @media (min-width: 600px) {
374
- [data-content-brand="bild"] {
375
- --article-headline-font-size: var(--headline-1-font-size); /* md: 72px */
376
- }
377
- }
378
-
379
- /* lg inherits from md (no redundant declaration) */
380
- ```
381
-
382
- ---
383
-
384
- ## 🎚️ Density Tokens
385
-
386
- Density tokens control spacing intensity across three modes: `default`, `dense`, and `spacious`.
387
-
388
- ### Semantic Density (tokens.css)
389
-
390
- Semantic density tokens are included in `tokens.css` and define responsive spacing values:
391
-
392
- ```css
393
- /* Constant spacing (no breakpoint dependency) */
394
- [data-content-brand="bild"][data-density="default"] {
395
- --density-stack-space-const-3-xs: var(--space-0-p-25-x, 2px);
396
- --density-stack-space-const-sm: var(--space-1-x, 8px);
397
- --density-stack-space-const-lg: var(--space-2-x, 16px);
398
- }
399
-
400
- /* Responsive spacing (breakpoint × density) */
401
- [data-content-brand="bild"][data-density="default"] {
402
- --density-xs-stack-space-resp-sm: var(--space-1-x, 8px);
403
- --density-xs-stack-space-resp-md: var(--space-1-p-5-x, 12px);
404
- }
405
-
406
- @media (min-width: 600px) {
407
- [data-content-brand="bild"][data-density="default"] {
408
- --density-md-stack-space-resp-sm: var(--space-1-p-5-x, 12px);
409
- --density-md-stack-space-resp-md: var(--space-2-x, 16px);
410
- }
411
- }
412
- ```
413
-
414
- ### Alias Chain: Breakpoint → Density → Primitive
415
-
416
- Responsive breakpoint tokens reference density tokens, which in turn reference primitives:
417
-
418
- ```css
419
- /* BreakpointMode → Density → Primitive */
420
- --stack-space-resp-md: var(--density-xs-stack-space-resp-md);
421
-
422
- --density-xs-stack-space-resp-md: var(--space-1-p-5-x, 12px);
423
-
424
- --space-1-p-5-x: 12px;
425
- ```
426
-
427
- This three-level chain enables:
428
- - **Density switching** via `data-density` attribute without recompilation
429
- - **Breakpoint switching** via native `@media` queries
430
- - **Fallback values** for robustness
431
-
432
- ### Component Density Tokens
433
-
434
- Component-specific density tokens (e.g., Button, InputField) are in component files:
435
-
436
- ```css
437
- /* Component density tokens */
438
- [data-content-brand="bild"][data-density="default"] {
439
- --density-button-inline-space: var(--space-2-p-5-x, 20px);
440
- --density-button-stack-space: var(--space-1-x, 8px);
441
- }
442
-
443
- [data-content-brand="bild"][data-density="dense"] {
444
- --density-button-inline-space: var(--space-2-x, 16px);
445
- --density-button-stack-space: var(--space-0-p-75-x, 6px);
446
- }
447
-
448
- [data-content-brand="bild"][data-density="spacious"] {
449
- --density-button-inline-space: var(--space-3-x, 24px);
450
- --density-button-stack-space: var(--space-1-p-5-x, 12px);
451
- }
452
- ```
453
-
454
- ---
455
-
456
- ## 🧩 Component Tokens
457
-
458
- ### Structure per Component
459
-
460
- Each component file contains:
461
-
462
- ```css
463
- /* === COLOR TOKENS (LIGHT MODE) === */
464
- [data-color-brand="bild"][data-theme="light"] {
465
- --component-bg-color: ...;
466
- --component-text-color: ...;
467
- }
468
-
469
- /* === COLOR TOKENS (DARK MODE) === */
470
- [data-color-brand="bild"][data-theme="dark"] {
471
- --component-bg-color: ...;
472
- --component-text-color: ...;
473
- }
474
-
475
- /* === DENSITY TOKENS === */
476
- [data-content-brand="bild"][data-density="default"] { ... }
477
- [data-content-brand="bild"][data-density="dense"] { ... }
478
- [data-content-brand="bild"][data-density="spacious"] { ... }
479
-
480
- /* === TYPOGRAPHY TOKENS === */
481
- [data-content-brand="bild"] {
482
- .component-label { font-family: ...; font-size: ...; }
483
- }
484
-
485
- /* === BREAKPOINT TOKENS === */
486
- [data-content-brand="bild"] { ... }
487
- @media (min-width: 600px) { [data-content-brand="bild"] { ... } }
488
- @media (min-width: 1024px) { [data-content-brand="bild"] { ... } }
489
- ```
490
-
491
- ### Available Components
492
-
493
- **BILD/SportBILD (52):** Accordion, Alert, Article, AudioPlayer, Avatar, Badge, Breadcrumb, BreakingNews, Button, Card, Carousel, Chip, Datepicker, Drawers, Dropdown, Empties, Foldout, Footer, Gallery, Hey, Icon, InfoElement, InputField, Kicker, LiveTicker, MediaPlayer, Menu, MenuItem, NewsTicker, Pagination, PartnerLinks, Paywall, Quote, RadioButton, Search, SectionTitle, Selection, Separator, Skeletons, Slider, SocialShareButton, SpecialNavi, Spinner, Subheader, Tab, Table, Teaser, TextLink, ToggleSwitch, Video, ...
494
-
495
- **Advertorial (39):** Subset of above (no Alert, Gallery, Hey, etc.)
496
-
497
- ---
498
-
499
- ## ✍️ Typography & Effects
500
-
501
- ### Typography Classes
502
-
503
- Typography tokens are output as CSS classes under **ContentBrand**:
504
-
505
- ```css
506
- [data-content-brand="bild"] {
507
- .button-label {
508
- font-family: var(--label-font-family);
509
- font-weight: 700;
510
- font-size: var(--button-label-font-size);
511
- line-height: var(--button-label-line-height);
512
- letter-spacing: var(--letter-space-positive-sm);
513
- text-transform: uppercase;
514
- }
515
- }
516
- ```
517
-
518
- > **Note:** `font-size` is output in px by default (configurable via `FONT_SIZE_UNIT` in `style-dictionary.config.js`). `line-height` is always unitless (ratio-based, e.g., `1.33`).
519
-
520
- Usage:
521
- ```html
522
- <span class="button-label">Click Me</span>
523
- ```
524
-
525
- ### Effect Classes (Mode-Agnostic with var() Support)
526
-
527
- Shadow effects use a **mode-agnostic architecture** where the shadow structure is constant but colors adapt to the theme via CSS Custom Properties:
528
-
529
- ```css
530
- /* Step 1: Semantic shadow colors (theme-aware) */
531
- [data-color-brand="bild"][data-theme="light"] {
532
- --shadow-color-soft-key-sm: var(--color-neutral-0-a-7, rgba(0,0,0,0.07));
533
- --shadow-color-soft-ambient-sm: var(--color-neutral-0-a-10, rgba(0,0,0,0.1));
534
- }
535
-
536
- [data-color-brand="bild"][data-theme="dark"] {
537
- --shadow-color-soft-key-sm: var(--color-neutral-0-a-20, rgba(0,0,0,0.2));
538
- --shadow-color-soft-ambient-sm: var(--color-neutral-0-a-30, rgba(0,0,0,0.3));
539
- }
540
-
541
- /* Step 2: Mode-agnostic shadow effect (no [data-theme] needed!) */
542
- [data-color-brand="bild"] .shadow-soft-sm {
543
- box-shadow:
544
- var(--size-0-x, 0px) var(--size-0-p-25-x, 2px) var(--size-0-p-5-x, 4px) var(--size-0-x, 0px) var(--shadow-color-soft-key-sm),
545
- var(--size-0-x, 0px) var(--size-0-p-125-x, 1px) var(--size-0-p-375-x, 3px) var(--size-0-p-125-x, 1px) var(--shadow-color-soft-ambient-sm);
546
- }
547
- ```
548
-
549
- **Why this architecture?**
550
- - Shadow **dimensions** (offset, blur, spread) are identical between light/dark modes
551
- - Only **colors** change per theme
552
- - Results in **smaller CSS** (no duplicate shadow definitions)
553
- - Full **var() support** enables runtime theming
554
-
555
- **Fallback Strategy:**
556
- - Dimension properties (`--size-*`) get fallbacks (primitive references)
557
- - Color properties (`--shadow-color-*`) don't get fallbacks (semantic references should fail visibly if theme not set)
558
-
559
- Usage:
560
- ```html
561
- <div class="shadow-soft-md">Elevated card</div>
562
- <div class="shadow-hard-lg">Strong shadow</div>
563
- ```
564
-
565
- ---
566
-
567
- ## 💡 Usage Examples
568
-
569
- ### Standard BILD App
570
-
571
- ```html
572
- <html data-color-brand="bild" data-content-brand="bild" data-theme="light" data-density="default">
573
- ```
574
-
575
- ### Advertorial in BILD
576
-
577
- ```html
578
- <html data-color-brand="bild" data-theme="light">
579
- <main data-content-brand="bild">
580
- <!-- Regular BILD content -->
581
- </main>
582
- <article data-content-brand="advertorial">
583
- <!-- Advertorial with BILD colors but Advertorial typography -->
584
- </article>
585
- </html>
586
- ```
587
-
588
- ### Advertorial in SportBILD (Dark Mode)
589
-
590
- ```html
591
- <html data-color-brand="sportbild" data-theme="dark">
592
- <article data-content-brand="advertorial" data-density="spacious">
593
- <!-- Advertorial with SportBILD dark colors -->
594
- </article>
595
- </html>
596
- ```
597
-
598
- ### Basic Button
599
-
600
- ```html
601
- <button class="my-button">
602
- <span class="button-label">Submit</span>
603
- </button>
604
- ```
605
-
606
- ```css
607
- .my-button {
608
- background: var(--button-primary-brand-bg-color-idle);
609
- color: var(--button-primary-label-color);
610
- padding: var(--density-button-stack-space) var(--density-button-inline-space);
611
- border-radius: var(--button-border-radius);
612
- border: var(--button-border-width-size) solid transparent;
613
- }
614
-
615
- .my-button:hover {
616
- background: var(--button-primary-brand-bg-color-hover);
617
- }
618
- ```
619
-
620
- ### Theme Toggle
621
-
622
- ```javascript
623
- const toggle = document.getElementById('theme-toggle');
624
- toggle.addEventListener('click', () => {
625
- const html = document.documentElement;
626
- html.dataset.theme = html.dataset.theme === 'light' ? 'dark' : 'light';
627
- });
628
- ```
629
-
630
- ### Density Selector
631
-
632
- ```javascript
633
- function setDensity(density) {
634
- document.documentElement.dataset.density = density;
635
- }
636
-
637
- // Usage
638
- setDensity('dense'); // Compact UI
639
- setDensity('default'); // Normal UI
640
- setDensity('spacious'); // Generous spacing
641
- ```
642
-
643
- ---
644
-
645
- ## 🕸️ Shadow DOM / Web Components
646
-
647
- The CSS output is **Shadow DOM compatible** for use with frameworks like **Stencil**, **Lit**, or native Web Components.
648
-
649
- ### How It Works
650
-
651
- CSS Custom Properties **inherit through the Shadow DOM boundary**:
652
-
653
- ```html
654
- <!-- Light DOM: Tokens are set here -->
655
- <body data-color-brand="bild" data-content-brand="bild" data-theme="light">
656
-
657
- <!-- Shadow DOM: Tokens are inherited! -->
658
- <my-button>
659
- <!-- #shadow-root -->
660
- <!-- var(--button-primary-bg) works here! -->
661
- </my-button>
662
-
663
- </body>
664
- ```
665
-
666
- ### Stencil Component Example
667
-
668
- ```tsx
669
- // my-button.tsx
670
- @Component({
671
- tag: 'my-button',
672
- shadow: true,
673
- styles: `
674
- .btn {
675
- /* Token values inherit from Light DOM automatically */
676
- background: var(--button-primary-brand-bg-color-idle);
677
- color: var(--button-primary-label-color);
678
- padding: var(--button-stack-space) var(--button-inline-space);
679
- border-radius: var(--button-border-radius);
680
- }
681
-
682
- .btn:hover {
683
- background: var(--button-primary-brand-bg-color-hover);
684
- }
685
-
686
- .label {
687
- font-family: var(--font-family-gotham);
688
- font-weight: var(--font-weight-bold);
689
- font-size: var(--button-label-font-size);
690
- }
691
- `
692
- })
693
- export class MyButton {
694
- render() {
695
- return (
696
- <button class="btn">
697
- <span class="label"><slot></slot></span>
698
- </button>
699
- );
700
- }
701
- }
702
- ```
703
-
704
- ### Multi-Brand Theming
705
-
706
- ```html
707
- <!-- BILD Brand -->
708
- <body data-color-brand="bild" data-content-brand="bild" data-theme="light">
709
- <my-button>Red Button</my-button>
710
- </body>
711
-
712
- <!-- SportBILD Brand -->
713
- <body data-color-brand="sportbild" data-content-brand="sportbild" data-theme="dark">
714
- <my-button>Blue Button</my-button>
715
- </body>
716
- ```
717
-
718
- The same component automatically adapts to different brands!
719
-
720
- ### Dual Selectors
721
-
722
- CSS output includes dual selectors for both Light DOM and Shadow DOM:
723
-
724
- ```css
725
- /* Works in Light DOM AND Shadow DOM (when attribute on component) */
726
- [data-color-brand="bild"][data-theme="light"],
727
- :host([data-color-brand="bild"][data-theme="light"]) {
728
- --button-primary-brand-bg-color-idle: var(--color-bild-red-50, #DD0000);
729
- }
730
- ```
731
-
732
- ### What Works in Shadow DOM
733
-
734
- | Feature | Status | Notes |
735
- |---------|--------|-------|
736
- | Token Variables | ✅ | CSS Custom Properties inherit through Shadow DOM |
737
- | @media Breakpoints | ✅ | Global, work everywhere |
738
- | Light/Dark Mode | ✅ | Variables change, components update |
739
- | Density Modes | ✅ | Variables inherit |
740
- | Typography Classes | ⚠️ | Use `var()` directly instead of classes |
741
- | Effect Classes | ⚠️ | Use `var()` directly instead of classes |
742
-
743
- ### Best Practice
744
-
745
- **For Shadow DOM components, use CSS Custom Properties directly:**
746
-
747
- ```css
748
- /* ✅ Recommended - Variables inherit */
749
- .label {
750
- font-family: var(--font-family-gotham);
751
- font-size: var(--display-1-font-size);
752
- line-height: var(--display-1-line-height);
753
- }
754
-
755
- /* ⚠️ Classes require attribute on component */
756
- .label {
757
- /* This needs [data-content-brand] on the component itself */
758
- }
759
- ```
760
-
761
- > **Note:** Typography classes (`.display-1`, `.body`, etc.) are convenience utilities for Light DOM. For Shadow DOM, use the underlying CSS Custom Properties directly.
762
-
763
- ### Stencil Project Setup
764
-
765
- The design system includes a pre-configured Stencil project with demo components:
766
-
767
- ```bash
768
- # Build tokens first (required)
769
- npm run build
770
-
771
- # Build Stencil components
772
- npm run build:stencil
773
-
774
- # Start dev server with hot reload (port 3333)
775
- npm run dev:stencil
776
- ```
777
-
778
- **Demo Components:**
779
- - `<ds-button>` – Button with variant prop (primary, secondary, tertiary)
780
- - `<ds-card>` – Card with surface prop (primary, secondary)
781
-
782
- **Brand Switcher (index.html):**
783
-
784
- The demo page includes a brand switcher with all four theming axes:
785
-
786
- | Selector | Options | Data Attribute |
787
- |----------|---------|----------------|
788
- | Color Brand | BILD, SportBILD | `data-color-brand` |
789
- | Theme | Light, Dark | `data-theme` |
790
- | Content Brand | BILD, SportBILD, Advertorial | `data-content-brand` |
791
- | Density | Default, Dense, Spacious | `data-density` |
792
-
793
- **Project Structure:**
794
- ```
795
- build-config/stencil/
796
- stencil.config.ts # Stencil configuration
797
- tsconfig.json # TypeScript config
798
-
799
- src/components/
800
- ds-button/ # Button component
801
- ds-card/ # Card component
802
- index.html # Dev/test page with brand switcher
803
- ```
804
-
805
- > See [CLAUDE.md](../../CLAUDE.md#stencil-web-components-integration) for complete Stencil documentation.
806
-
807
- ---
808
-
809
- ## 📚 Storybook
810
-
811
- The design system includes a **Storybook 8.x** setup for component development and documentation with full 4-axis token support.
812
-
813
- ### Quick Start
814
-
815
- ```bash
816
- # Build tokens first (required)
817
- npm run build
818
-
819
- # Start Storybook dev server (port 6006)
820
- npm run storybook
821
-
822
- # Build static Storybook site
823
- npm run build:storybook
824
- ```
825
-
826
- ### Features
827
-
828
- **4-Axis Token Switching in Toolbar:**
829
-
830
- | Toolbar Control | Options | Description |
831
- |-----------------|---------|-------------|
832
- | Color Brand | BILD, SportBILD | Colors + effects axis |
833
- | Content Brand | BILD, SportBILD, Advertorial | Typography + sizing axis |
834
- | Dark Mode Toggle (🌙) | Light, Dark | Unified UI + content theming |
835
- | Density | Default, Dense, Spacious | Spacing density |
836
-
837
- ### Dark Mode Integration
838
-
839
- The `storybook-dark-mode` addon provides unified dark mode:
840
-
841
- - **Moon icon (🌙)** in toolbar toggles both Storybook UI and content area
842
- - Design tokens (`data-theme`) sync automatically via localStorage polling
843
- - Custom BILD themes match the design system look
844
-
845
- ### Writing Stories
846
-
847
- ```typescript
848
- // src/components/ds-button/ds-button.stories.ts
849
- import type { Meta, StoryObj } from '@storybook/web-components';
850
- import { html } from 'lit';
851
- import './ds-button';
852
-
853
- const meta: Meta = {
854
- title: 'Components/Button',
855
- component: 'ds-button',
856
- tags: ['autodocs'],
857
- argTypes: {
858
- variant: {
859
- control: 'select',
860
- options: ['primary', 'secondary', 'tertiary'],
861
- },
862
- },
863
- };
864
-
865
- export default meta;
866
- type Story = StoryObj;
867
-
868
- export const Primary: Story = {
869
- args: { variant: 'primary' },
870
- render: (args) => html`
871
- <ds-button variant=${args.variant}>Primary Button</ds-button>
872
- `,
873
- };
874
- ```
875
-
876
- ### Styleguide Documentation
877
-
878
- The `src/docs/` directory contains visual documentation pages for design system foundations:
879
-
880
- | Page | File | Description |
881
- |------|------|-------------|
882
- | Introduction | `intro.mdx` | Overview, brand architecture, links |
883
- | Colors | `colors.mdx` | Color palettes with visual swatches |
884
- | Typography | `typography.mdx` | Font families, weights, text styles |
885
- | Spacing | `spacing.mdx` | Spacing scale, density modes |
886
- | Effects | `effects.mdx` | Shadow tokens with live previews |
887
-
888
- These pages use MDX with `@storybook/blocks` and include styled visual elements like color swatches, spacing bars, and shadow cards.
889
-
890
- ### Configuration
891
-
892
- | File | Purpose |
893
- |------|---------|
894
- | `build-config/storybook/main.ts` | Framework, addons, static dirs |
895
- | `build-config/storybook/preview.ts` | Decorators, toolbar controls |
896
- | `build-config/storybook/preview-body.html` | Dark mode sync script |
897
- | `build-config/storybook/manager.ts` | Custom BILD UI themes |
898
-
899
- > See [CLAUDE.md](../../CLAUDE.md#storybook-integration) for complete Storybook documentation.
900
-
901
- ---
902
-
903
- ## 🌐 Browser Support
904
-
905
- CSS Custom Properties are supported in all modern browsers:
906
-
907
- - Chrome 49+
908
- - Firefox 31+
909
- - Safari 9.1+
910
- - Edge 15+
911
-
912
- ### Conditional Fallback Strategy
913
-
914
- Fallback values are included **conditionally** based on reference type:
915
-
916
- ```css
917
- /* ✅ WITH fallback: Primitive references (split-loading safety) */
918
- --text-color-primary: var(--color-neutral-15, #232629);
919
- --grid-space-resp-base: var(--space-1-p-5-x, 12px);
920
-
921
- /* ❌ WITHOUT fallback: Semantic references (fail visible) */
922
- --button-primary-bg: var(--bg-color-brand-solid);
923
- ```
924
-
925
- **Rationale:**
926
- - **Primitive references** get fallbacks → protects against missing `primitives.css` in split-file loading
927
- - **Semantic references** don't get fallbacks → missing `data-theme` should fail visibly, not silently degrade
928
-
929
- > See [CLAUDE.md](../../CLAUDE.md#shadow-effects-css-architecture) for detailed fallback architecture.
930
-
931
- ---
932
-
933
- ## 📖 Related Documentation
934
-
935
- | Document | Description |
936
- |----------|-------------|
937
- | [JavaScript/React](../js/README.md) | ESM tokens with React ThemeProvider |
938
- | [Android Compose](../../../tokens-android/docs/USAGE.md) | Kotlin tokens for Jetpack Compose |
939
- | [iOS SwiftUI](../../../tokens-ios/Documentation/USAGE.md) | Swift tokens for SwiftUI |
940
- | [Tokens README](../../../../README.md) | Token pipeline overview |
941
- | [Main README](../../../../README.md) | Project overview |
942
- | [CLAUDE.md](../../../../CLAUDE.md) | Architecture & build details |