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