-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
517 lines (461 loc) · 20.6 KB
/
Copy pathindex.html
File metadata and controls
517 lines (461 loc) · 20.6 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Components | brutalist-web-theme</title>
<meta
name="description"
content="The six core components of brutalist-web-theme plus the exposure layer, rendered live with the markup to copy."
/>
<!-- The real token file, the real component file, the real exposure
layer, in that order. This page holds no copy of any of them. -->
<link rel="stylesheet" href="../tokens/tokens.css" />
<link rel="stylesheet" href="./components.css" />
<link rel="stylesheet" href="./structure.css" />
<style>
/* Page chrome for this gallery only. Tokens throughout, no literals. */
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
background: var(--bw-ground);
color: var(--bw-ink);
font-family: var(--bw-font-text);
font-size: var(--bw-text-body);
line-height: var(--bw-leading-text);
}
.wrap {
max-width: var(--bw-container);
margin: 0 auto;
padding: var(--bw-space-12) var(--bw-space-4) var(--bw-space-24);
}
@media (min-width: 768px) {
.wrap {
padding-left: var(--bw-space-6);
padding-right: var(--bw-space-6);
}
}
.page-lead {
max-width: var(--bw-measure);
margin: var(--bw-space-4) 0 0;
}
section {
margin-top: var(--bw-space-16);
padding-top: var(--bw-space-8);
border-top: var(--bw-rule-heavy) solid var(--bw-rule-color);
}
.note {
max-width: var(--bw-measure);
margin: var(--bw-space-3) 0 var(--bw-space-6);
}
.row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--bw-space-4);
margin-bottom: var(--bw-space-6);
}
.cards {
display: grid;
gap: var(--bw-space-6);
margin-bottom: var(--bw-space-6);
grid-template-columns: 1fr;
}
@media (min-width: 768px) {
.cards {
grid-template-columns: repeat(3, 1fr);
}
}
.stack {
display: grid;
gap: var(--bw-space-6);
max-width: 440px;
margin-bottom: var(--bw-space-6);
}
.demo-box {
margin-bottom: var(--bw-space-6);
}
footer {
margin-top: var(--bw-space-24);
padding-top: var(--bw-space-6);
border-top: var(--bw-rule) solid var(--bw-rule-color);
font-size: var(--bw-text-sm);
}
</style>
</head>
<body class="bw-doc">
<div class="wrap">
<h1 class="bw-display">Components</h1>
<p class="page-lead">
Six components and the exposure layer, rendered by the real
stylesheets. Copy the markup, copy <code>tokens/tokens.css</code>,
<code>components/components.css</code> and
<code>components/structure.css</code>, and you have the register.
Every value resolves back to a token, so retheming is one file. See
<a href="../README.md">the README</a> for the position map and
<a href="../CUSTOMIZE.md">CUSTOMIZE.md</a> for moving it.
</p>
<!-- ================= LINK ================= -->
<section aria-labelledby="link-heading">
<h2 class="bw-h2" id="link-heading">Link</h2>
<p class="note">
A link is blue, or purple once visited, and underlined at the same
weight as the rules the page is built from. Hovering inverts the
word into a solid block. Inside <code>.bw-doc</code>, any anchor
with no class of its own gets this treatment, so ordinary prose
needs no classes at all.
</p>
<p class="note">
Here is <a class="bw-link" href="#link-heading">a link with the
class</a>, here is <a href="#link-heading">an unclassed link inside
the document scope</a>, and here is
<a class="bw-link bw-link-plain" href="#link-heading">the plain
variant</a> that skips the block hover for use in running text.
</p>
<pre class="bw-code"><code><a class="bw-link" href="/incidents">Incident history</a>
<a class="bw-link bw-link-plain" href="/incidents">In running text</a>
<!-- Inside .bw-doc, this needs no class -->
<a href="/incidents">Incident history</a></code></pre>
</section>
<!-- ================= BUTTON ================= -->
<section aria-labelledby="button-heading">
<h2 class="bw-h2" id="button-heading">Button</h2>
<p class="note">
Four variants and three sizes. Hover inverts the button with no
travel and no easing, because the duration token is zero. The
disabled state is struck through rather than faded: a half-opacity
control is a control the register would have to admit is decorative.
</p>
<div class="row">
<button class="bw-btn bw-btn-solid" type="button">Get alerts</button>
<button class="bw-btn bw-btn-default" type="button">History</button>
<button class="bw-btn bw-btn-plain" type="button">Dismiss</button>
<button class="bw-btn bw-btn-alarm" type="button">Declare incident</button>
<button class="bw-btn bw-btn-default" type="button" disabled>Disabled</button>
</div>
<div class="row">
<button class="bw-btn bw-btn-sm bw-btn-default" type="button">Small</button>
<button class="bw-btn bw-btn-default" type="button">Base</button>
<button class="bw-btn bw-btn-lg bw-btn-solid" type="button">Large</button>
</div>
<pre class="bw-code"><code><button class="bw-btn bw-btn-solid" type="button">Get alerts</button>
<button class="bw-btn bw-btn-default" type="button">History</button>
<button class="bw-btn bw-btn-plain" type="button">Dismiss</button>
<button class="bw-btn bw-btn-alarm" type="button">Declare incident</button>
<button class="bw-btn bw-btn-lg bw-btn-solid" type="button">Large</button></code></pre>
</section>
<!-- ================= CARD ================= -->
<section aria-labelledby="card-heading">
<h2 class="bw-h2" id="card-heading">Card</h2>
<p class="note">
A framed block. There is no shadow to raise one card above another,
so a card claims priority with a heavier frame instead. Hold the
heavy variant to one per screen. The third card is a link and
inverts whole on hover, which is the same gesture the buttons make.
</p>
<div class="cards">
<div class="bw-card">
<div class="bw-card-header">
<h3 class="bw-card-title">Base</h3>
<span class="bw-badge bw-badge-default">Default</span>
</div>
<p class="bw-card-body">
Two pixel frame, a rule under the header, no elevation. This is
the surface most of a page is built from.
</p>
</div>
<div class="bw-card bw-card-heavy">
<div class="bw-card-header">
<h3 class="bw-card-title">Heavy</h3>
<span class="bw-badge bw-badge-alarm">Priority</span>
</div>
<p class="bw-card-body">
Six pixel frame. This is the whole mechanism for saying one
block matters more than the blocks next to it.
</p>
<div class="bw-card-footer">
<button class="bw-btn bw-btn-sm bw-btn-solid" type="button">Open</button>
</div>
</div>
<a class="bw-card bw-card-link bw-card-shade" href="#card-heading">
<div class="bw-card-header">
<h3 class="bw-card-title">Link card</h3>
<span class="bw-badge bw-badge-shade">Shade</span>
</div>
<p class="bw-card-body">
A whole card as one target. Hovering inverts it.
</p>
</a>
</div>
<pre class="bw-code"><code><div class="bw-card bw-card-heavy">
<div class="bw-card-header">
<h3 class="bw-card-title">Heavy</h3>
<span class="bw-badge bw-badge-alarm">Priority</span>
</div>
<p class="bw-card-body">Body copy.</p>
<div class="bw-card-footer">
<button class="bw-btn bw-btn-sm bw-btn-solid" type="button">Open</button>
</div>
</div></code></pre>
</section>
<!-- ================= INPUT ================= -->
<section aria-labelledby="input-heading">
<h2 class="bw-h2" id="input-heading">Input</h2>
<p class="note">
Four states: default, focus, invalid, disabled. Field text is set in
mono, because what goes into a field is data. Invalid thickens the
frame to the heavy weight and turns it red, so the state survives
for a reader who cannot separate the red from the black. Body text
holds at 17px, above the 16px floor that stops iOS Safari zooming
the page on focus.
</p>
<div class="stack">
<div class="bw-field">
<label class="bw-label" for="f-service">Service</label>
<input class="bw-input" id="f-service" type="text" placeholder="ingest-api" />
<span class="bw-hint">Lowercase, dashes, no spaces.</span>
</div>
<div class="bw-field">
<label class="bw-label" for="f-window">Window</label>
<input
class="bw-input"
id="f-window"
type="text"
value="30 dayz"
aria-invalid="true"
aria-describedby="f-window-error"
/>
<span class="bw-error" id="f-window-error">
Window must be a number followed by d, h or m.
</span>
</div>
<div class="bw-field">
<label class="bw-label" for="f-region">Region</label>
<input class="bw-input" id="f-region" type="text" value="eu-west-1" disabled />
<span class="bw-hint">Set once, at account creation.</span>
</div>
</div>
<pre class="bw-code"><code><div class="bw-field">
<label class="bw-label" for="f-window">Window</label>
<input class="bw-input" id="f-window" type="text"
aria-invalid="true" aria-describedby="f-window-error" />
<span class="bw-error" id="f-window-error">Window must be a number.</span>
</div></code></pre>
</section>
<!-- ================= BADGE ================= -->
<section aria-labelledby="badge-heading">
<h2 class="bw-h2" id="badge-heading">Badge</h2>
<p class="note">
Mono, uppercase, hairline frame, square corners. Four variants, and
only one of them is colored. A register with a fill for every state
has spent the alarm before anything went wrong.
</p>
<div class="row">
<span class="bw-badge bw-badge-default">Unknown</span>
<span class="bw-badge bw-badge-shade">Queued</span>
<span class="bw-badge bw-badge-solid">Normal</span>
<span class="bw-badge bw-badge-alarm">Erroring</span>
</div>
<pre class="bw-code"><code><span class="bw-badge bw-badge-solid">Normal</span>
<span class="bw-badge bw-badge-alarm">Erroring</span></code></pre>
</section>
<!-- ================= NAV ================= -->
<section aria-labelledby="nav-heading">
<h2 class="bw-h2" id="nav-heading">Nav</h2>
<p class="note">
One bar with a brand mark, inline links above 768px, and a
disclosure panel below it. Links are divided by rules rather than by
gaps, so the bar reads as a row of cells. The panel is a
<code><details></code> element, so the pattern ships without a
line of JavaScript and keeps working when scripts fail. Narrow the
window to watch it swap.
</p>
<div class="demo-box">
<nav class="bw-nav" aria-label="Component example">
<div class="bw-nav-inner">
<a class="bw-nav-brand" href="#nav-heading">
<span class="bw-nav-mark" aria-hidden="true">P</span>
Plainstate
</a>
<ul class="bw-nav-links">
<li><a class="bw-nav-link" href="#nav-heading" aria-current="page">Status</a></li>
<li><a class="bw-nav-link" href="#nav-heading">History</a></li>
<li><a class="bw-nav-link" href="#nav-heading">Wording</a></li>
</ul>
<a class="bw-btn bw-btn-sm bw-btn-solid bw-nav-cta" href="#nav-heading">
Get alerts
</a>
<details class="bw-nav-disclosure">
<summary aria-label="Open menu">Menu</summary>
<ul class="bw-nav-panel">
<li><a class="bw-nav-link" href="#nav-heading" aria-current="page">Status</a></li>
<li><a class="bw-nav-link" href="#nav-heading">History</a></li>
<li><a class="bw-nav-link" href="#nav-heading">Wording</a></li>
</ul>
</details>
</div>
</nav>
</div>
<pre class="bw-code"><code><nav class="bw-nav" aria-label="Main">
<div class="bw-nav-inner">
<a class="bw-nav-brand" href="/">
<span class="bw-nav-mark" aria-hidden="true">P</span>
Plainstate
</a>
<ul class="bw-nav-links">
<li><a class="bw-nav-link" href="/" aria-current="page">Status</a></li>
<li><a class="bw-nav-link" href="/history">History</a></li>
</ul>
<a class="bw-btn bw-btn-sm bw-btn-solid bw-nav-cta" href="/alerts">Get alerts</a>
<details class="bw-nav-disclosure">
<summary aria-label="Open menu">Menu</summary>
<ul class="bw-nav-panel">
<li><a class="bw-nav-link" href="/">Status</a></li>
</ul>
</details>
</div>
</nav></code></pre>
</section>
<!-- ================= EXPOSURE LAYER ================= -->
<section aria-labelledby="exposure-heading">
<h2 class="bw-h2" id="exposure-heading">The exposure layer</h2>
<p class="note">
Four treatments that tokens cannot carry: the drawn grid, the raw
table, the ticker, and type at a size that stops being typography.
These live in <code>components/structure.css</code>, which also
states the anti-polish rules as rules.
</p>
<h3 class="bw-card-title">Drawn grid</h3>
<p class="note">
The column lines are painted across the container from the same
token the track list uses. Cells are opaque, so the ruler shows in
the tracks nothing occupies and never runs behind text: the grid is
visible exactly where it has room left. The first row below fills
all twelve columns and the second leaves five empty. Below 768px
every span collapses to full width and the painted lines retire
with them.
</p>
<div class="bw-grid bw-grid-exposed demo-box">
<div class="bw-span-4"><strong>span 4</strong></div>
<div class="bw-span-4"><strong>span 4</strong></div>
<div class="bw-span-4"><strong>span 4</strong></div>
<div class="bw-span-4"><strong>span 4</strong></div>
<div class="bw-span-3"><strong>span 3</strong></div>
</div>
<h3 class="bw-card-title">Raw table</h3>
<p class="note">
Every cell edge drawn, header inverted, figures tabular so a column
of numbers lines up. It scrolls inside its own frame on a narrow
screen rather than making the page scroll sideways.
</p>
<div class="bw-table-scroll demo-box">
<table class="bw-table">
<caption>Example rows</caption>
<thead>
<tr>
<th scope="col">Service</th>
<th scope="col">State</th>
<th scope="col" class="bw-num">30d uptime</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Ingest API</th>
<td><span class="bw-badge bw-badge-alarm">Erroring</span></td>
<td class="bw-num">97.412%</td>
</tr>
<tr>
<th scope="row">Query API</th>
<td><span class="bw-badge bw-badge-solid">Normal</span></td>
<td class="bw-num">99.987%</td>
</tr>
<tr>
<th scope="row">Billing</th>
<td><span class="bw-badge bw-badge-solid">Normal</span></td>
<td class="bw-num">100.000%</td>
</tr>
</tbody>
</table>
</div>
<h3 class="bw-card-title">Ticker</h3>
<p class="note">
The one piece of motion the register owns. The second track is a
copy hidden from assistive technology, which is what makes the loop
continuous without the sentence being announced twice. Under
<code>prefers-reduced-motion</code> the animation stops, the
duplicate is removed, and the strip becomes a scrollable row so the
content survives the motion being switched off.
</p>
<div class="bw-marquee demo-box">
<div class="bw-marquee-track">
<span>Ingest API erroring since 09:14 UTC</span>
<span>Webhook delivery paused</span>
<span>7 of 9 services normal</span>
</div>
<div class="bw-marquee-track" aria-hidden="true">
<span>Ingest API erroring since 09:14 UTC</span>
<span>Webhook delivery paused</span>
<span>7 of 9 services normal</span>
</div>
</div>
<pre class="bw-code"><code><div class="bw-marquee">
<div class="bw-marquee-track">
<span>Ingest API erroring since 09:14 UTC</span>
</div>
<div class="bw-marquee-track" aria-hidden="true">
<span>Ingest API erroring since 09:14 UTC</span>
</div>
</div></code></pre>
<h3 class="bw-card-title">Type at scale</h3>
<p class="note">
The three largest steps are fluid, so a headline is a statement on a
desktop and still inside the viewport on a phone.
</p>
<p class="bw-mega demo-box">Two things are broken</p>
<pre class="bw-code"><code><h1 class="bw-mega">Two things are broken</h1>
<h2 class="bw-h2">Every service, right now</h2>
<p class="bw-label-line">Updated 10:52 UTC</p></code></pre>
</section>
<!-- ================= INVERTED ================= -->
<section aria-labelledby="invert-heading">
<h2 class="bw-h2" id="invert-heading">Inverted band</h2>
<p class="note">
A black band reuses the same two colors rather than adding a dark
palette. Three tokens are swapped inside it: the rule color, so
frames do not disappear into the ink; the muted ink, which is 2.37:1
on black and fails; and the focus color, since the link blue is
2.23:1 there. Links inside a band take the ground color and keep
their underline.
</p>
<div class="bw-invert demo-box" style="padding: var(--bw-space-8)">
<p class="bw-label-line">Muted text on an inverted band</p>
<h3 class="bw-card-title" style="margin-top: var(--bw-space-3)">
Ingest API
</h3>
<p class="bw-card-body" style="margin-top: var(--bw-space-3)">
Erroring since 09:14 UTC. See the
<a class="bw-link" href="#invert-heading">incident history</a> for
what happened last time.
</p>
<div class="row" style="margin-top: var(--bw-space-6); margin-bottom: 0">
<span class="bw-badge bw-badge-alarm">Erroring</span>
<span class="bw-badge bw-badge-solid">Solid</span>
<button class="bw-btn bw-btn-sm bw-btn-solid" type="button">Subscribe</button>
<button class="bw-btn bw-btn-sm" type="button">Dismiss</button>
</div>
</div>
</section>
<footer>
<p>
brutalist-web-theme. MIT. Questions go to
<a href="https://github.com/rampstackco/claude-skills/discussions">
the claude-skills discussions</a>.
</p>
</footer>
</div>
</body>
</html>