-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.html
More file actions
542 lines (503 loc) · 20.9 KB
/
Copy pathexamples.html
File metadata and controls
542 lines (503 loc) · 20.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS Box - Examples</title>
<script>
(function () {
var savedTheme = null;
try {
savedTheme = localStorage.getItem("css-box-theme");
} catch (error) {
savedTheme = null;
}
if (savedTheme === "light" || savedTheme === "dark") {
document.documentElement.setAttribute("data-theme", savedTheme);
}
}());
</script>
<link rel="stylesheet" href="css-box.css">
</head>
<body>
<main class="container-lg stack gap5 p2">
<header class="stack gap2 brdb pb2">
<nav class="section-head">
<a class="txtn txtbold" href="index.html">
<i class="fa-solid fa-cube blu" aria-hidden="true"></i>
CSS Box
</a>
<ul class="nav nav-fill">
<li><a href="#grid" aria-current="page">Grid</a></li>
<li><a href="#forms">Forms</a></li>
<li><a href="#components">Components</a></li>
<li><a href="#patterns">Patterns</a></li>
<li><a href="#utilities">Utilities</a></li>
</ul>
</nav>
<section class="section-head">
<div>
<h1 class="m0">CSS Box Examples</h1>
<p class="muted">A reference page for quickly testing the toolbox.</p>
</div>
<div class="cluster stack-phone">
<button class="btn btn-outline theme-toggle full-phone" type="button" data-theme-toggle aria-pressed="false">
<i class="fa-solid fa-moon" aria-hidden="true"></i>
<span>Dark mode</span>
</button>
<a class="btn full-phone" href="css-box.css">
<i class="fa-solid fa-file-code" aria-hidden="true"></i>
css-box.css
</a>
</div>
</section>
</header>
<section id="grid" class="stack">
<div class="section-head">
<h2 class="m0">Grid and Layout</h2>
<span class="badge badge-muted">.grid .row .stack .cluster</span>
</div>
<div class="grid grid-4 gap3">
<article class="card">
<div class="card-body">
<span class="badge">1 col</span>
<h3 class="mt2 mb1">Compact Card</h3>
<p class="muted">A standard card with border, radius, and a subtle shadow.</p>
</div>
</article>
<article class="card">
<div class="card-body">
<span class="badge badge-gre">Auto</span>
<h3 class="mt2 mb1">Responsive Grid</h3>
<p class="muted">Columns collapse cleanly on smaller screens.</p>
</div>
</article>
<article class="card">
<div class="card-body">
<span class="badge badge-ora">Flex</span>
<h3 class="mt2 mb1">Cluster</h3>
<p class="muted">Useful for actions, filters, menus, and tags.</p>
</div>
</article>
<article class="card">
<div class="card-body">
<span class="badge badge-red">Stack</span>
<h3 class="mt2 mb1">Spacing</h3>
<p class="muted">Gaps use the toolbox fluid spacing tokens.</p>
</div>
</article>
</div>
<div class="row">
<div class="box u50">
<div class="card m1">
<div class="card-body p3">
<strong>.u50</strong>
<p class="muted mt2">Legacy width utility preserved.</p>
</div>
</div>
</div>
<div class="box u25">
<div class="card m1">
<div class="card-body p3">
<strong>.u25</strong>
<p class="muted mt2">Quarter-width column.</p>
</div>
</div>
</div>
<div class="box u25">
<div class="card m1">
<div class="card-body p3">
<strong>.u25</strong>
<p class="muted mt2">Quarter-width column.</p>
</div>
</div>
</div>
</div>
</section>
<section id="forms" class="stack">
<div class="section-head">
<h2 class="m0">Forms</h2>
<span class="badge badge-muted">inputs, selects, checks, input groups</span>
</div>
<form class="card form" action="#" method="get">
<div class="card-head section-head">
<strong>User Profile</strong>
<span class="badge badge-gre">Active</span>
</div>
<div class="card-body form">
<div class="form-row">
<div class="form-field">
<label for="firstname">First Name</label>
<input id="firstname" name="firstname" type="text" placeholder="Camille">
</div>
<div class="form-field">
<label for="email">Email</label>
<input id="email" name="email" type="email" placeholder="camille@example.com">
</div>
</div>
<div class="form-row">
<div class="form-field">
<label for="role">Role</label>
<select id="role" name="role">
<option>Administrator</option>
<option>Editor</option>
<option>Reader</option>
</select>
</div>
<div class="form-field">
<label for="budget">Budget</label>
<div class="input-group">
<span class="input-addon">USD</span>
<input id="budget" name="budget" type="number" value="1200">
<span class="input-addon">/ month</span>
</div>
</div>
</div>
<div class="form-field">
<label for="message">Message</label>
<textarea id="message" name="message" placeholder="Internal notes"></textarea>
<span class="form-help">Discreet helper text, like the patterns found in common CSS frameworks.</span>
</div>
<div class="cluster stack-phone">
<label class="check"><input type="checkbox" checked> Receive notifications</label>
<label class="radio"><input type="radio" name="plan" checked> Standard</label>
<label class="radio"><input type="radio" name="plan"> Premium</label>
</div>
</div>
<div class="card-foot form-actions">
<button class="btn btn-muted" type="reset">Cancel</button>
<button class="btn" type="submit">
<i class="fa-solid fa-floppy-disk" aria-hidden="true"></i>
Save
</button>
</div>
</form>
</section>
<section id="components" class="stack">
<div class="section-head">
<h2 class="m0">Components</h2>
<span class="badge badge-muted">buttons, alerts, tables, pagination</span>
</div>
<div class="grid grid-2 gap3">
<section class="stack">
<div class="btn-row">
<button class="btn" type="button">Primary</button>
<button class="btn btn-outline" type="button">Outline</button>
<button class="btn btn-gre" type="button">Success</button>
<button class="btn btn-red" type="button">Danger</button>
<button class="btn btn-mini" type="button">Mini</button>
</div>
<div class="alert info">
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
Neutral information to guide the user.
</div>
<div class="alert success">
<i class="fa-solid fa-circle-check" aria-hidden="true"></i>
The operation completed successfully.
</div>
<div class="alert warning">
<i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
Check this before continuing.
</div>
<div class="alert error">
<i class="fa-solid fa-circle-xmark" aria-hidden="true"></i>
An error needs to be fixed.
</div>
</section>
<section class="stack">
<div class="callout">
<strong>Callout</strong>
<p class="m0 mt1">A highlighted block for contextual help, product notes, or important messages.</p>
</div>
<div>
<p class="mb1 txtbold">Progress</p>
<div class="progress" aria-label="72 percent progress">
<span class="progress-bar" style="--kiss-progress: 72%"></span>
</div>
</div>
<div class="cluster stack-phone inline-phone">
<span class="badge">New</span>
<span class="badge badge-gre">Valid</span>
<span class="badge badge-ora">Pending</span>
<span class="badge badge-red">Blocked</span>
<span class="badge badge-muted">Archived</span>
</div>
<ul class="pagination" aria-label="Pagination">
<li><a href="#" aria-label="Previous page"><i class="fa-solid fa-angle-left" aria-hidden="true"></i></a></li>
<li><a href="#">1</a></li>
<li><span aria-current="page">2</span></li>
<li><a href="#">3</a></li>
<li><a href="#" aria-label="Next page"><i class="fa-solid fa-angle-right" aria-hidden="true"></i></a></li>
</ul>
</section>
</div>
<div class="table-wrap table-stack">
<table class="table table-striped">
<caption>Responsive table with statuses</caption>
<thead>
<tr>
<th>Project</th>
<th>Owner</th>
<th>Status</th>
<th class="txtr">Budget</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Project">UI refresh</td>
<td data-label="Owner">Nadia</td>
<td data-label="Status"><span class="badge badge-gre">Shipped</span></td>
<td class="txtr" data-label="Budget">$8,400</td>
</tr>
<tr>
<td data-label="Project">Design system</td>
<td data-label="Owner">Alex</td>
<td data-label="Status"><span class="badge">In progress</span></td>
<td class="txtr" data-label="Budget">$12,000</td>
</tr>
<tr>
<td data-label="Project">Accessibility audit</td>
<td data-label="Owner">Sam</td>
<td data-label="Status"><span class="badge badge-ora">Review</span></td>
<td class="txtr" data-label="Budget">$3,200</td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="patterns" class="stack">
<div class="section-head">
<h2 class="m0">Advanced Patterns</h2>
<span class="badge badge-muted">dashboard, pricing, tabs, timeline, modal</span>
</div>
<nav aria-label="Breadcrumb">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li>CSS Toolbox</li>
</ol>
</nav>
<div class="tabs" role="tablist" aria-label="Views">
<a href="#" aria-current="page">Overview</a>
<a href="#">Activity</a>
<a href="#">Billing</a>
<a href="#">Settings</a>
</div>
<div class="grid grid-4 gap3">
<article class="stat">
<span class="stat-label">Visits</span>
<strong class="stat-value">24k</strong>
<span class="gre small"><i class="fa-solid fa-arrow-trend-up" aria-hidden="true"></i> +18%</span>
</article>
<article class="stat">
<span class="stat-label">Conversion</span>
<strong class="stat-value">7.2%</strong>
<span class="ora small"><i class="fa-solid fa-minus" aria-hidden="true"></i> stable</span>
</article>
<article class="stat">
<span class="stat-label">Tickets</span>
<strong class="stat-value">38</strong>
<span class="red small"><i class="fa-solid fa-arrow-trend-down" aria-hidden="true"></i> +5 open</span>
</article>
<article class="stat">
<span class="stat-label">Satisfaction</span>
<strong class="stat-value">96</strong>
<span class="blu small"><i class="fa-solid fa-star" aria-hidden="true"></i> score</span>
</article>
</div>
<div class="sidebar-layout">
<aside class="card">
<div class="card-head">
<strong>Side Menu</strong>
</div>
<div class="card-body">
<ul class="nav stack-phone">
<li><a href="#" aria-current="page"><i class="fa-solid fa-chart-line" aria-hidden="true"></i> Dashboard</a></li>
<li><a href="#"><i class="fa-solid fa-users" aria-hidden="true"></i> Customers</a></li>
<li><a href="#"><i class="fa-solid fa-gear" aria-hidden="true"></i> Settings</a></li>
</ul>
</div>
</aside>
<section class="grid grid-2 gap3">
<article class="card">
<div class="card-body media">
<span class="avatar">NB</span>
<div class="media-body">
<h3 class="m0">Media Object</h3>
<p class="muted m0 mt1">An avatar, content, and a layout that stacks on mobile.</p>
<div class="cluster mt2">
<span class="chip"><i class="fa-solid fa-tag" aria-hidden="true"></i> UI</span>
<span class="chip"><i class="fa-solid fa-clock" aria-hidden="true"></i> 12 min</span>
</div>
</div>
</div>
</article>
<article class="card">
<div class="card-body stack">
<h3 class="m0">Compact List</h3>
<ul class="list">
<li class="section-head"><span>CSS audit</span><span class="badge badge-gre">OK</span></li>
<li class="section-head"><span>Responsive</span><span class="badge">In progress</span></li>
<li class="section-head"><span>Documentation</span><span class="badge badge-ora">Todo</span></li>
</ul>
</div>
</article>
</section>
</div>
<div class="grid grid-3 gap3">
<article class="pricing">
<div>
<span class="badge badge-muted">Starter</span>
<h3>Simple</h3>
<p class="muted">For a small interface or prototype.</p>
</div>
<div class="price">0<small>USD</small></div>
<ul class="stack gap1 m0 p0">
<li>Essential CSS helpers</li>
<li>Simple forms</li>
<li>Responsive grid</li>
</ul>
<a class="btn btn-outline full-phone" href="#">Choose</a>
</article>
<article class="pricing pricing-featured">
<div>
<span class="badge">Popular</span>
<h3>Pro</h3>
<p class="muted">For a complete app with reusable components.</p>
</div>
<div class="price">19<small>USD/mo</small></div>
<ul class="stack gap1 m0 p0">
<li>Cards, tables, alerts</li>
<li>Dashboard patterns</li>
<li>CSS-variable theming</li>
</ul>
<a class="btn full-phone" href="#">Start</a>
</article>
<article class="pricing">
<div>
<span class="badge badge-muted">Team</span>
<h3>Team</h3>
<p class="muted">For a shared UI system across several pages.</p>
</div>
<div class="price">49<small>USD/mo</small></div>
<ul class="stack gap1 m0 p0">
<li>Complex layouts</li>
<li>Internal guidelines</li>
<li>Product components</li>
</ul>
<a class="btn btn-outline full-phone" href="#">Contact</a>
</article>
</div>
<div class="grid grid-2 gap3">
<section class="card">
<div class="card-body">
<h3 class="m0 mb2">Timeline</h3>
<ol class="timeline">
<li class="timeline-item">
<strong>Brief</strong>
<p class="muted m0">The need is defined and constraints are listed.</p>
</li>
<li class="timeline-item">
<strong>Prototype</strong>
<p class="muted m0">Components are assembled on a test page.</p>
</li>
<li class="timeline-item">
<strong>Delivery</strong>
<p class="muted m0">Helpers are documented and verified.</p>
</li>
</ol>
</div>
</section>
<section class="stack">
<div class="modal-demo">
<div class="modal-head section-head">
<strong>Static Modal</strong>
<span class="badge badge-muted">CSS only</span>
</div>
<div class="modal-body">
<p class="m0">Without JavaScript, the toolbox can provide the visual surface. Open and close behavior would come from the app.</p>
</div>
<div class="modal-foot form-actions">
<button class="btn btn-muted" type="button">Close</button>
<button class="btn" type="button">Confirm</button>
</div>
</div>
<div class="card">
<div class="card-body stack gap2">
<span class="skeleton" style="width: 42%"></span>
<span class="skeleton"></span>
<span class="skeleton" style="width: 76%"></span>
<span class="skeleton" style="width: 58%"></span>
</div>
</div>
</section>
</div>
</section>
<section id="utilities" class="stack">
<div class="section-head">
<h2 class="m0">Utilities</h2>
<span class="badge badge-muted">colors, borders, text, spacing</span>
</div>
<div class="grid grid-4 gap2">
<div class="p3 radius bg-red whi txtc">.bg-red</div>
<div class="p3 radius bg-ora whi txtc">.bg-ora</div>
<div class="p3 radius bg-gre bla txtc">.bg-gre</div>
<div class="p3 radius bg-blu whi txtc">.bg-blu</div>
</div>
<div class="grid grid-3 gap3">
<div class="brd brd-blu radius p3">
<strong class="blu">Borders</strong>
<p class="muted m0 mt1">Classes `.brd`, `.brdt`, `.brdb`, `.brd-blu`.</p>
</div>
<div class="shadow radius p3">
<strong>Shadows</strong>
<p class="muted m0 mt1">`.shadow` and `.shadow-sm` for UI surfaces.</p>
</div>
<div class="radius-lg bg-surface p3">
<strong>Radii</strong>
<p class="muted m0 mt1">`.radius`, `.radius-sm`, `.radius-lg`.</p>
</div>
</div>
</section>
</main>
<script>
(function () {
var toggle = document.querySelector("[data-theme-toggle]");
if (!toggle) return;
var icon = toggle.querySelector("i");
var label = toggle.querySelector("span");
var media = window.matchMedia("(prefers-color-scheme: dark)");
function currentTheme() {
return document.documentElement.getAttribute("data-theme") || (media.matches ? "dark" : "light");
}
function render(theme) {
var isDark = theme === "dark";
toggle.setAttribute("aria-pressed", String(isDark));
icon.className = isDark ? "fa-solid fa-sun" : "fa-solid fa-moon";
label.textContent = isDark ? "Light mode" : "Dark mode";
}
toggle.addEventListener("click", function () {
var nextTheme = currentTheme() === "dark" ? "light" : "dark";
document.documentElement.setAttribute("data-theme", nextTheme);
try {
localStorage.setItem("css-box-theme", nextTheme);
} catch (error) {
// Theme still changes for the current page view.
}
render(nextTheme);
});
function handleSystemThemeChange() {
if (!document.documentElement.hasAttribute("data-theme")) {
render(currentTheme());
}
}
if (media.addEventListener) {
media.addEventListener("change", handleSystemThemeChange);
} else if (media.addListener) {
media.addListener(handleSystemThemeChange);
}
render(currentTheme());
}());
</script>
</body>
</html>