@pure-ds/storybook 0.4.15 → 0.4.17
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/.storybook/addons/html-preview/Panel.jsx +75 -23
- package/.storybook/addons/html-preview/preview.js +27 -1
- package/.storybook/docs.css +7 -0
- package/.storybook/htmlPreview.css +6 -6
- package/.storybook/htmlPreview.js +27 -1
- package/.storybook/manager-head.html +13 -0
- package/.storybook/preview-head.html +5 -0
- package/.storybook/preview.js +1 -1
- package/dist/pds-reference.json +2 -7
- package/package.json +2 -2
- package/public/assets/js/app.js +617 -10565
- package/public/assets/js/lit.js +3 -1048
- package/public/assets/js/pds.js +396 -7354
- package/public/assets/pds/components/pds-calendar.js +1 -1
- package/public/assets/pds/custom-elements.json +263 -18
- package/public/assets/pds/pds-runtime-config.json +1 -1
- package/public/assets/pds/styles/pds-components.css +83 -221
- package/public/assets/pds/styles/pds-components.css.js +166 -442
- package/public/assets/pds/styles/pds-styles.css +240 -437
- package/public/assets/pds/styles/pds-styles.css.js +479 -881
- package/public/assets/pds/styles/pds-utilities.css +151 -214
- package/public/assets/pds/styles/pds-utilities.css.js +302 -428
- package/src/js/pds-configurator/pds-demo.js +11 -1
- package/src/js/pds-core/pds-generator.js +88 -38
- package/src/js/pds-core/pds-ontology.js +1 -1
- package/stories/components/PdsCalendar.stories.js +2 -2
- package/stories/components/PdsDrawer.stories.js +15 -15
- package/stories/components/PdsJsonform.stories.js +78 -0
- package/stories/components/PdsRichtext.stories.js +4 -17
- package/stories/components/PdsScrollrow.stories.js +224 -72
- package/stories/components/PdsSplitpanel.stories.js +63 -28
- package/stories/components/PdsTabstrip.stories.js +7 -7
- package/stories/enhancements/Accordion.stories.js +2 -2
- package/stories/enhancements/Dropdowns.stories.js +13 -10
- package/stories/enhancements/RangeSliders.stories.js +9 -9
- package/stories/enhancements/RequiredFields.stories.js +8 -8
- package/stories/enhancements/Toggles.stories.js +45 -36
- package/stories/enhancements/_enhancement-header.js +2 -2
- package/stories/foundations/Colors.stories.js +13 -13
- package/stories/foundations/HTMLDefaults.stories.js +4 -4
- package/stories/foundations/Icons.stories.js +123 -288
- package/stories/foundations/MeshGradients.stories.js +161 -250
- package/stories/foundations/SmartSurfaces.stories.js +147 -64
- package/stories/foundations/Spacing.stories.js +30 -30
- package/stories/foundations/Typography.stories.js +352 -723
- package/stories/foundations/ZIndex.stories.js +124 -141
- package/stories/layout/LayoutOverview.stories.js +343 -250
- package/stories/layout/LayoutSystem.stories.js +60 -76
- package/stories/patterns/InteractiveStates.stories.js +29 -29
- package/stories/patterns/Utilities.stories.js +17 -5
- package/stories/primitives/Alerts.stories.js +6 -6
- package/stories/primitives/Cards.stories.js +22 -11
- package/stories/primitives/Forms.stories.js +17 -8
- package/stories/primitives/Media.stories.js +23 -20
- package/stories/utilities/Backdrop.stories.js +68 -27
- package/stories/utils/PdsAsk.stories.js +1 -1
- package/public/assets/js/app.js.map +0 -7
- package/public/assets/js/lit.js.map +0 -7
- package/public/assets/js/pds.js.map +0 -7
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
+
import { highlight, getCurrentTheme, preloadShiki } from "../utils/shiki.js";
|
|
3
|
+
|
|
4
|
+
// Pre-load Shiki
|
|
5
|
+
preloadShiki();
|
|
6
|
+
|
|
7
|
+
const layoutOverviewStyles = html`
|
|
8
|
+
<style>
|
|
9
|
+
.story-compare-grid { margin-block: var(--spacing-6); }
|
|
10
|
+
.story-code-block { font-size: var(--font-size-sm); overflow-x: auto; }
|
|
11
|
+
.story-note { margin-block-start: var(--spacing-3); }
|
|
12
|
+
.story-list { margin-block: var(--spacing-4); }
|
|
13
|
+
.story-checkmark { font-size: var(--font-size-xl); }
|
|
14
|
+
</style>
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
// Code samples for comparison
|
|
18
|
+
const tailwindCode = `<div class="p-4 mt-2 rounded-lg shadow-md bg-white
|
|
19
|
+
flex flex-col gap-2">
|
|
20
|
+
<div class="text-lg font-bold">
|
|
21
|
+
A Nice Box With a Title
|
|
22
|
+
</div>
|
|
23
|
+
<div class="text-sm text-gray-500">
|
|
24
|
+
The subtitle of the item
|
|
25
|
+
</div>
|
|
26
|
+
<div class="text-base">
|
|
27
|
+
The body of the item with some descriptive text.
|
|
28
|
+
</div>
|
|
29
|
+
</div>`;
|
|
30
|
+
|
|
31
|
+
const pdsCode = `<article class="card surface-overlay">
|
|
32
|
+
<header>
|
|
33
|
+
<h3>A Nice Box With a Title</h3>
|
|
34
|
+
<small class="text-muted">
|
|
35
|
+
The subtitle of the item
|
|
36
|
+
</small>
|
|
37
|
+
</header>
|
|
38
|
+
<p>
|
|
39
|
+
The body of the item with some descriptive text.
|
|
40
|
+
</p>
|
|
41
|
+
</article>`;
|
|
2
42
|
|
|
3
43
|
export default {
|
|
4
44
|
title: "Foundations/Layout",
|
|
@@ -12,277 +52,330 @@ export default {
|
|
|
12
52
|
},
|
|
13
53
|
};
|
|
14
54
|
|
|
15
|
-
export const LayoutIntroduction = () =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
55
|
+
export const LayoutIntroduction = () => {
|
|
56
|
+
const container = document.createElement("div");
|
|
57
|
+
container.classList.add("stack-lg");
|
|
58
|
+
|
|
59
|
+
container.innerHTML = `
|
|
60
|
+
<style>
|
|
61
|
+
.story-render-result {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
|
|
65
|
+
margin: var(--spacing-4) 0;
|
|
66
|
+
padding: var(--spacing-4);
|
|
22
67
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
style="margin: var(--spacing-6) 0;"
|
|
36
|
-
>
|
|
37
|
-
<div class="card surface-subtle">
|
|
38
|
-
<h3>❌ Tailwind Approach</h3>
|
|
39
|
-
<pre
|
|
40
|
-
style="font-size: var(--font-size-sm); overflow-x: auto;"
|
|
41
|
-
><code><div class="p-4 mt-2 rounded-lg
|
|
42
|
-
bg-white shadow-md flex
|
|
43
|
-
flex-col gap-2">
|
|
44
|
-
<div class="text-lg font-bold">
|
|
45
|
-
Title
|
|
46
|
-
</div>
|
|
47
|
-
<div class="text-sm text-gray-500">
|
|
48
|
-
Description
|
|
49
|
-
</div>
|
|
50
|
-
</div></code></pre>
|
|
51
|
-
<p class="text-muted" style="margin-top: var(--spacing-3);">
|
|
52
|
-
8 utility classes, no semantic meaning, hard to maintain.
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
68
|
+
> .card {
|
|
69
|
+
width: 400px
|
|
70
|
+
;}
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
73
|
+
${layoutOverviewStyles.strings[0]}
|
|
74
|
+
<header>
|
|
75
|
+
<h1>Layout in PDS</h1>
|
|
76
|
+
<h4 class="text-muted">
|
|
77
|
+
Power through composition of high-level concepts, not atomic control.
|
|
78
|
+
</h4>
|
|
79
|
+
</header>
|
|
55
80
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
</tr>
|
|
84
|
-
</thead>
|
|
85
|
-
<tbody>
|
|
86
|
-
<tr>
|
|
87
|
-
<td><strong>1. Semantic HTML</strong></td>
|
|
88
|
-
<td>Native elements with built-in styling</td>
|
|
89
|
-
<td>
|
|
90
|
-
<code><article></code>, <code><nav></code>,
|
|
91
|
-
<code><section></code>, <code><header></code>
|
|
92
|
-
</td>
|
|
93
|
-
<td>Always start here</td>
|
|
94
|
-
</tr>
|
|
95
|
-
<tr>
|
|
96
|
-
<td><strong>2. Primitives</strong></td>
|
|
97
|
-
<td>Single-class components with full styling</td>
|
|
98
|
-
<td><code>.card</code>, <code>.alert</code>, <code>.badge</code></td>
|
|
99
|
-
<td>Common UI patterns</td>
|
|
100
|
-
</tr>
|
|
101
|
-
<tr>
|
|
102
|
-
<td><strong>3. Layout Patterns</strong></td>
|
|
103
|
-
<td>High-level structural utilities</td>
|
|
104
|
-
<td>
|
|
105
|
-
<code>.container</code>, <code>.grid-auto-md</code>,
|
|
106
|
-
<code>.stack-md</code>
|
|
107
|
-
</td>
|
|
108
|
-
<td>Page structure</td>
|
|
109
|
-
</tr>
|
|
110
|
-
<tr>
|
|
111
|
-
<td><strong>4. Composable Utilities</strong></td>
|
|
112
|
-
<td>Minimal, purposeful utilities</td>
|
|
113
|
-
<td><code>.flex</code>, <code>.gap-md</code>, <code>.grow</code></td>
|
|
114
|
-
<td>Custom compositions</td>
|
|
115
|
-
</tr>
|
|
116
|
-
<tr>
|
|
117
|
-
<td><strong>5. Inline Styles</strong></td>
|
|
118
|
-
<td>One-off values using tokens</td>
|
|
119
|
-
<td><code>style="margin-top: var(--spacing-4)"</code></td>
|
|
120
|
-
<td>Rare exceptions</td>
|
|
121
|
-
</tr>
|
|
122
|
-
</tbody>
|
|
123
|
-
</table>
|
|
124
|
-
</article>
|
|
125
|
-
|
|
126
|
-
<article class="card">
|
|
127
|
-
<h2>Why PDS Has <em>Some</em> Utilities</h2>
|
|
128
|
-
|
|
129
|
-
<p>
|
|
130
|
-
PDS isn't anti-utility. It's anti-<em>atomic</em>. We include utilities
|
|
131
|
-
that:
|
|
132
|
-
</p>
|
|
133
|
-
|
|
134
|
-
<div class="stack-md" style="margin: var(--spacing-4) 0;">
|
|
135
|
-
<div class="flex gap-md items-start">
|
|
136
|
-
<span style="font-size: var(--font-size-xl);">✓</span>
|
|
137
|
-
<div>
|
|
138
|
-
<strong>Solve common layout problems</strong>
|
|
139
|
-
<p class="text-muted">
|
|
140
|
-
<code>.flex</code>, <code>.grid</code>, <code>.gap-*</code> —
|
|
141
|
-
fundamental building blocks
|
|
81
|
+
<article class="card surface-translucent-75">
|
|
82
|
+
<h2>Why PDS Avoids Low-Level Utilities</h2>
|
|
83
|
+
|
|
84
|
+
<p>
|
|
85
|
+
Frameworks like Tailwind offer atomic utilities for every CSS property:
|
|
86
|
+
<code>.p-4</code>, <code>.mt-2</code>, <code>.text-sm</code>,
|
|
87
|
+
<code>.relative</code>.
|
|
88
|
+
</p>
|
|
89
|
+
|
|
90
|
+
<p>
|
|
91
|
+
While this approach offers maximum flexibility, it comes at a steep cost:
|
|
92
|
+
bloated HTML, poor maintainability, and a lack of semantic meaning.
|
|
93
|
+
</p>
|
|
94
|
+
|
|
95
|
+
<header>
|
|
96
|
+
<h3>Let's compare Tailwind and PDS styling</h3>
|
|
97
|
+
<small>Look at the box below</small>
|
|
98
|
+
</header>
|
|
99
|
+
|
|
100
|
+
<div class="story-render-result">
|
|
101
|
+
<article class="card surface-overlay">
|
|
102
|
+
<header>
|
|
103
|
+
<h3>A Nice Box With a Title</h3>
|
|
104
|
+
<small class="text-muted">The subtitle of the item</small>
|
|
105
|
+
</header>
|
|
106
|
+
<p>
|
|
107
|
+
The body of the item with some descriptive text.
|
|
142
108
|
</p>
|
|
143
|
-
</
|
|
144
|
-
</div>
|
|
109
|
+
</article>
|
|
110
|
+
</div>
|
|
145
111
|
|
|
146
|
-
<div class="
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
112
|
+
<div class="grid grid-cols-2 gap-lg surface-translucent-50 story-compare-grid">
|
|
113
|
+
<div class="card surface-subtle">
|
|
114
|
+
<header>
|
|
115
|
+
<h3>❌ Tailwind Approach</h3>
|
|
116
|
+
<small class="text-muted">Atomic utilities for everything</small>
|
|
117
|
+
</header>
|
|
118
|
+
<div class="story-code-block code-tailwind"></div>
|
|
119
|
+
<p class="text-muted story-note">
|
|
120
|
+
13 utility classes, no semantic meaning, hard to maintain.
|
|
153
121
|
</p>
|
|
154
122
|
</div>
|
|
155
|
-
</div>
|
|
156
123
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
124
|
+
<div class="card surface-elevated">
|
|
125
|
+
<header>
|
|
126
|
+
<h3>✅ PDS Approach</h3>
|
|
127
|
+
<small class="text-muted">Semantic HTML + primitives</small>
|
|
128
|
+
</header>
|
|
129
|
+
<div class="story-code-block code-pds"></div>
|
|
130
|
+
<p class="text-muted story-note">
|
|
131
|
+
Semantic HTML + 4 primitive classes. Self-documenting.
|
|
164
132
|
</p>
|
|
165
133
|
</div>
|
|
166
134
|
</div>
|
|
167
|
-
</
|
|
135
|
+
</article>
|
|
168
136
|
|
|
169
|
-
<h3>What PDS Does NOT Include</h3>
|
|
170
137
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
138
|
+
<div class="alert alert-info">
|
|
139
|
+
<span class="alert-icon">
|
|
140
|
+
<pds-icon icon="info" size="md"></pds-icon>
|
|
141
|
+
</span>
|
|
174
142
|
<div>
|
|
175
|
-
<
|
|
176
|
-
<
|
|
177
|
-
<p
|
|
178
|
-
|
|
179
|
-
|
|
143
|
+
<h4 class="alert-title">The verdict</h4>
|
|
144
|
+
<p>Both approaches render identical output—but only one is maintainable.</p>
|
|
145
|
+
<p>
|
|
146
|
+
Don't even start thinking of dark and light modes, responsiveness, or
|
|
147
|
+
accessibility. With atomic utilities, every one of those concerns must be
|
|
148
|
+
manually addressed with more classes and more complexity.
|
|
180
149
|
</p>
|
|
181
150
|
</div>
|
|
182
151
|
</div>
|
|
183
152
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
|
|
153
|
+
<article class="card">
|
|
154
|
+
<h2>The PDS Layout Hierarchy</h2>
|
|
155
|
+
|
|
156
|
+
<table class="table-bordered">
|
|
157
|
+
<thead>
|
|
158
|
+
<tr>
|
|
159
|
+
<th>Level</th>
|
|
160
|
+
<th>What</th>
|
|
161
|
+
<th>Examples</th>
|
|
162
|
+
<th>Use When</th>
|
|
163
|
+
</tr>
|
|
164
|
+
</thead>
|
|
165
|
+
<tbody>
|
|
166
|
+
<tr>
|
|
167
|
+
<td><strong>1. Semantic HTML</strong></td>
|
|
168
|
+
<td>Native elements with built-in styling</td>
|
|
169
|
+
<td>
|
|
170
|
+
<code><article></code>, <code><nav></code>,
|
|
171
|
+
<code><section></code>, <code><header></code>
|
|
172
|
+
</td>
|
|
173
|
+
<td>Always start here</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td><strong>2. Primitives</strong></td>
|
|
177
|
+
<td>Single-class components with full styling</td>
|
|
178
|
+
<td><code>.card</code>, <code>.alert</code>, <code>.badge</code></td>
|
|
179
|
+
<td>Common UI patterns</td>
|
|
180
|
+
</tr>
|
|
181
|
+
<tr>
|
|
182
|
+
<td><strong>3. Layout Patterns</strong></td>
|
|
183
|
+
<td>High-level structural utilities</td>
|
|
184
|
+
<td>
|
|
185
|
+
<code>.container</code>, <code>.grid-auto-md</code>,
|
|
186
|
+
<code>.stack-md</code>
|
|
187
|
+
</td>
|
|
188
|
+
<td>Page structure</td>
|
|
189
|
+
</tr>
|
|
190
|
+
<tr>
|
|
191
|
+
<td><strong>4. Composable Utilities</strong></td>
|
|
192
|
+
<td>Minimal, purposeful utilities</td>
|
|
193
|
+
<td><code>.flex</code>, <code>.gap-md</code>, <code>.grow</code></td>
|
|
194
|
+
<td>Custom compositions</td>
|
|
195
|
+
</tr>
|
|
196
|
+
<tr>
|
|
197
|
+
<td><strong>5. Inline Styles</strong></td>
|
|
198
|
+
<td>One-off values using tokens</td>
|
|
199
|
+
<td><code>style="margin-top: var(--spacing-4)"</code></td>
|
|
200
|
+
<td>Rare exceptions</td>
|
|
201
|
+
</tr>
|
|
202
|
+
</tbody>
|
|
203
|
+
</table>
|
|
204
|
+
</article>
|
|
205
|
+
|
|
206
|
+
<article class="card">
|
|
207
|
+
<h2>Why PDS Has <em>Some</em> Utilities</h2>
|
|
208
|
+
|
|
209
|
+
<p>
|
|
210
|
+
PDS isn't anti-utility. It's anti-<em>atomic</em>. We include utilities
|
|
211
|
+
that:
|
|
212
|
+
</p>
|
|
213
|
+
|
|
214
|
+
<div class="stack-md story-list">
|
|
215
|
+
<div class="flex gap-md items-start">
|
|
216
|
+
<span class="story-checkmark">✓</span>
|
|
217
|
+
<div>
|
|
218
|
+
<strong>Solve common layout problems</strong>
|
|
219
|
+
<p class="text-muted">
|
|
220
|
+
<code>.flex</code>, <code>.grid</code>, <code>.gap-*</code> —
|
|
221
|
+
fundamental building blocks
|
|
222
|
+
</p>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<div class="flex gap-md items-start">
|
|
227
|
+
<span class="story-checkmark">✓</span>
|
|
228
|
+
<div>
|
|
229
|
+
<strong>Encode complete patterns</strong>
|
|
230
|
+
<p class="text-muted">
|
|
231
|
+
<code>.stack-md</code> = flex + column + gap (one class instead of
|
|
232
|
+
three)
|
|
233
|
+
</p>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div class="flex gap-md items-start">
|
|
238
|
+
<span class="story-checkmark">✓</span>
|
|
239
|
+
<div>
|
|
240
|
+
<strong>Can't be achieved with primitives</strong>
|
|
241
|
+
<p class="text-muted">
|
|
242
|
+
<code>.truncate</code>, <code>.grow</code> — no semantic element
|
|
243
|
+
provides this
|
|
244
|
+
</p>
|
|
245
|
+
</div>
|
|
194
246
|
</div>
|
|
195
247
|
</div>
|
|
196
248
|
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
249
|
+
<h3>What PDS Does NOT Include</h3>
|
|
250
|
+
|
|
251
|
+
<div class="stack-md story-list">
|
|
252
|
+
<div class="flex gap-md items-start">
|
|
253
|
+
<span class="story-checkmark">✗</span>
|
|
254
|
+
<div>
|
|
255
|
+
<strong>Spacing utilities</strong> (<code>.p-4</code>,
|
|
256
|
+
<code>.mt-2</code>, <code>.mx-auto</code>)
|
|
257
|
+
<p class="text-muted">
|
|
258
|
+
Primitives handle padding. Use <code>.section</code> or inline
|
|
259
|
+
styles with tokens.
|
|
260
|
+
</p>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<div class="flex gap-md items-start">
|
|
265
|
+
<span class="story-checkmark">✗</span>
|
|
266
|
+
<div>
|
|
267
|
+
<strong>Typography scale</strong> (<code>.text-sm</code>,
|
|
268
|
+
<code>.text-2xl</code>)
|
|
269
|
+
<p class="text-muted">
|
|
270
|
+
Use semantic elements:
|
|
271
|
+
<code><h1></code>-<code><h6></code>,
|
|
272
|
+
<code><small></code>, <code><strong></code>
|
|
273
|
+
</p>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<div class="flex gap-md items-start">
|
|
278
|
+
<span class="story-checkmark">✗</span>
|
|
279
|
+
<div>
|
|
280
|
+
<strong>Position/display</strong> (<code>.relative</code>,
|
|
281
|
+
<code>.block</code>, <code>.hidden</code>)
|
|
282
|
+
<p class="text-muted">
|
|
283
|
+
Component-internal concerns. Components handle their own
|
|
284
|
+
positioning.
|
|
285
|
+
</p>
|
|
286
|
+
</div>
|
|
206
287
|
</div>
|
|
207
288
|
</div>
|
|
208
|
-
</
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
</
|
|
283
|
-
</
|
|
284
|
-
</
|
|
285
|
-
|
|
286
|
-
|
|
289
|
+
</article>
|
|
290
|
+
|
|
291
|
+
<article class="card">
|
|
292
|
+
<h2>Quick Reference: Layout Utilities</h2>
|
|
293
|
+
|
|
294
|
+
<table class="table-bordered">
|
|
295
|
+
<thead>
|
|
296
|
+
<tr>
|
|
297
|
+
<th>Category</th>
|
|
298
|
+
<th>Classes</th>
|
|
299
|
+
<th>Purpose</th>
|
|
300
|
+
</tr>
|
|
301
|
+
</thead>
|
|
302
|
+
<tbody>
|
|
303
|
+
<tr>
|
|
304
|
+
<td><strong>Container</strong></td>
|
|
305
|
+
<td><code>.container</code></td>
|
|
306
|
+
<td>Centered max-width wrapper with padding</td>
|
|
307
|
+
</tr>
|
|
308
|
+
<tr>
|
|
309
|
+
<td><strong>Grid</strong></td>
|
|
310
|
+
<td>
|
|
311
|
+
<code>.grid</code>, <code>.grid-cols-*</code>,
|
|
312
|
+
<code>.grid-auto-*</code>
|
|
313
|
+
</td>
|
|
314
|
+
<td>CSS Grid layouts</td>
|
|
315
|
+
</tr>
|
|
316
|
+
<tr>
|
|
317
|
+
<td><strong>Flex</strong></td>
|
|
318
|
+
<td>
|
|
319
|
+
<code>.flex</code>, <code>.flex-col</code>, <code>.flex-wrap</code>,
|
|
320
|
+
<code>.grow</code>
|
|
321
|
+
</td>
|
|
322
|
+
<td>Flexbox layouts</td>
|
|
323
|
+
</tr>
|
|
324
|
+
<tr>
|
|
325
|
+
<td><strong>Stack</strong></td>
|
|
326
|
+
<td>
|
|
327
|
+
<code>.stack-sm</code>, <code>.stack-md</code>,
|
|
328
|
+
<code>.stack-lg</code>, <code>.stack-xl</code>
|
|
329
|
+
</td>
|
|
330
|
+
<td>Vertical rhythm (flex + column + gap)</td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr>
|
|
333
|
+
<td><strong>Gap</strong></td>
|
|
334
|
+
<td>
|
|
335
|
+
<code>.gap-xs</code>, <code>.gap-sm</code>, <code>.gap-md</code>,
|
|
336
|
+
<code>.gap-lg</code>, <code>.gap-xl</code>
|
|
337
|
+
</td>
|
|
338
|
+
<td>Spacing between flex/grid children</td>
|
|
339
|
+
</tr>
|
|
340
|
+
<tr>
|
|
341
|
+
<td><strong>Alignment</strong></td>
|
|
342
|
+
<td><code>.items-*</code>, <code>.justify-*</code></td>
|
|
343
|
+
<td>Cross-axis and main-axis alignment</td>
|
|
344
|
+
</tr>
|
|
345
|
+
<tr>
|
|
346
|
+
<td><strong>Width</strong></td>
|
|
347
|
+
<td>
|
|
348
|
+
<code>.max-w-sm</code>, <code>.max-w-md</code>,
|
|
349
|
+
<code>.max-w-lg</code>, <code>.max-w-xl</code>
|
|
350
|
+
</td>
|
|
351
|
+
<td>Content width constraints</td>
|
|
352
|
+
</tr>
|
|
353
|
+
<tr>
|
|
354
|
+
<td><strong>Section</strong></td>
|
|
355
|
+
<td><code>.section</code>, <code>.section-lg</code></td>
|
|
356
|
+
<td>Vertical padding for content blocks</td>
|
|
357
|
+
</tr>
|
|
358
|
+
<tr>
|
|
359
|
+
<td><strong>Responsive</strong></td>
|
|
360
|
+
<td><code>.mobile-stack</code></td>
|
|
361
|
+
<td>Stack on mobile, row on desktop</td>
|
|
362
|
+
</tr>
|
|
363
|
+
</tbody>
|
|
364
|
+
</table>
|
|
365
|
+
</article>
|
|
366
|
+
`;
|
|
367
|
+
|
|
368
|
+
const theme = getCurrentTheme();
|
|
369
|
+
|
|
370
|
+
highlight(tailwindCode, "html", theme).then((h) => {
|
|
371
|
+
container.querySelector(".code-tailwind").innerHTML = h;
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
highlight(pdsCode, "html", theme).then((h) => {
|
|
375
|
+
container.querySelector(".code-pds").innerHTML = h;
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
return container;
|
|
379
|
+
};
|
|
287
380
|
|
|
288
381
|
LayoutIntroduction.storyName = "Introduction";
|