@brignano/design 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/DECISIONS.md +126 -0
  2. package/DESIGN.md +269 -9
  3. package/README.md +3 -2
  4. package/components.css +175 -61
  5. package/icons/LICENSE +43 -0
  6. package/icons/arrow-down.svg +15 -0
  7. package/icons/arrow-left.svg +15 -0
  8. package/icons/arrow-right.svg +15 -0
  9. package/icons/arrow-up-down.svg +17 -0
  10. package/icons/arrow-up.svg +15 -0
  11. package/icons/bell.svg +15 -0
  12. package/icons/calendar.svg +17 -0
  13. package/icons/check.svg +14 -0
  14. package/icons/chevron-down.svg +14 -0
  15. package/icons/chevron-left.svg +14 -0
  16. package/icons/chevron-right.svg +14 -0
  17. package/icons/chevron-up.svg +14 -0
  18. package/icons/circle-check.svg +15 -0
  19. package/icons/circle-help.svg +16 -0
  20. package/icons/circle-x.svg +16 -0
  21. package/icons/clock.svg +15 -0
  22. package/icons/copy.svg +15 -0
  23. package/icons/download.svg +16 -0
  24. package/icons/ellipsis-vertical.svg +16 -0
  25. package/icons/ellipsis.svg +16 -0
  26. package/icons/external-link.svg +16 -0
  27. package/icons/eye-off.svg +17 -0
  28. package/icons/eye.svg +15 -0
  29. package/icons/funnel.svg +14 -0
  30. package/icons/house.svg +15 -0
  31. package/icons/info.svg +16 -0
  32. package/icons/link.svg +15 -0
  33. package/icons/lock.svg +15 -0
  34. package/icons/log-out.svg +16 -0
  35. package/icons/map-pin.svg +15 -0
  36. package/icons/menu.svg +16 -0
  37. package/icons/minus.svg +14 -0
  38. package/icons/monitor.svg +16 -0
  39. package/icons/moon.svg +14 -0
  40. package/icons/pencil.svg +15 -0
  41. package/icons/plus.svg +15 -0
  42. package/icons/refresh-cw.svg +17 -0
  43. package/icons/search.svg +15 -0
  44. package/icons/settings.svg +15 -0
  45. package/icons/sun.svg +22 -0
  46. package/icons/trash-2.svg +18 -0
  47. package/icons/triangle-alert.svg +16 -0
  48. package/icons/undo-2.svg +15 -0
  49. package/icons/upload.svg +16 -0
  50. package/icons/user.svg +15 -0
  51. package/icons/x.svg +15 -0
  52. package/package.json +3 -1
  53. package/product-page.css +31 -28
  54. package/tailwind.css +21 -0
  55. package/templates/app-shell.css +346 -0
  56. package/templates/article.css +7 -7
  57. package/templates/changelog.css +2 -2
  58. package/templates/error.css +81 -0
  59. package/templates/legal.css +3 -3
  60. package/templates/settings.css +95 -0
  61. package/tokens.css +123 -14
@@ -0,0 +1,346 @@
1
+ /* @brignano/design — app shell template (#68, proposals/app-shell.md)
2
+ The frame a tool app sits in: a header across the top, a sidebar of
3
+ places to go, the main view, and an optional detail panel. Needs
4
+ tokens.css and components.css (.site-header, .btn, .icon, .dialog).
5
+
6
+ <div class="app-shell" data-sidebar="expanded">
7
+ <div class="app-shell-grid">
8
+ <header class="site-header">
9
+ <div class="site-header-inner">
10
+ <button type="button" class="btn btn-ghost btn-icon app-menu-button"
11
+ popovertarget="app-nav" aria-label="Menu">…menu icon…</button>
12
+ <a class="site-brand" href="/">…</a>
13
+ <div class="site-actions">…</div>
14
+ </div>
15
+ </header>
16
+ <nav class="app-sidebar" id="app-nav" popover aria-label="Main">
17
+ <button type="button" class="btn btn-ghost btn-icon app-sidebar-close"
18
+ popovertarget="app-nav" popovertargetaction="hide"
19
+ aria-label="Close menu" autofocus>…x icon…</button>
20
+ <div class="app-sidebar-section">
21
+ <p class="app-sidebar-title" id="nav-infra">Infrastructure</p>
22
+ <ul aria-labelledby="nav-infra">
23
+ <li><a href="/hosts" aria-current="page"><svg class="icon" aria-hidden="true">…</svg><span class="app-sidebar-label">Hosts</span></a></li>
24
+ </ul>
25
+ </div>
26
+ <button type="button" class="btn btn-ghost btn-icon app-sidebar-toggle"
27
+ aria-controls="app-nav" aria-expanded="true"
28
+ aria-label="Collapse sidebar">…chevron-left icon…</button>
29
+ </nav>
30
+ <main class="app-main" id="main">…</main>
31
+ <dialog class="dialog app-detail" id="detail" aria-labelledby="detail-title">…</dialog>
32
+ </div>
33
+ </div>
34
+
35
+ Widths follow the shell's own width (container queries on .app-shell), so
36
+ it behaves the same full screen as inside a preview or an embedded view:
37
+ - Under 48rem (phone): one column. The sidebar is behind the header's menu
38
+ button and opens as a sheet from the inline start, with no script: Esc,
39
+ a tap outside or the close button closes it, and focus goes back to the
40
+ menu button. The detail panel is a sheet from the bottom.
41
+ - 48rem to 75rem: the sidebar is a column. The detail panel is a sheet
42
+ from the inline end, over the main view.
43
+ - 75rem and up: the detail panel is a third column beside the main view.
44
+
45
+ Your script (design ships no JS; previews/app-shell.html has it):
46
+ - Collapse: the toggle flips data-sidebar on .app-shell between expanded
47
+ and collapsed (an icon rail), and its own aria-expanded and aria-label
48
+ with it. Remember the choice if you like (localStorage).
49
+ - Detail: open it with show() where the shell says the detail is a column,
50
+ and showModal() where it's a sheet. Read which from the grid:
51
+ getComputedStyle(grid).getPropertyValue('--app-detail-mode').trim()
52
+ is "column" or "sheet". Close it with close(); a modal one closes on
53
+ Esc by itself, and focus goes back to the row that opened it.
54
+ - Every nav item needs an icon from icons/: the rail shows only icons. The
55
+ label stays in the link, visually hidden, and appears beside the icon on
56
+ hover or keyboard focus.
57
+
58
+ Tokens on .app-shell a product can override: --app-sidebar (15rem),
59
+ --app-rail (3.5rem) and --app-detail-width (22rem, the column; the sheet
60
+ from the end is 26rem). The shell fills the viewport's height (100dvh)
61
+ and only .app-main scrolls; set a height on .app-shell to put it in a
62
+ smaller box. */
63
+ @layer brignano.components {
64
+ .app-shell {
65
+ --app-sidebar: 15rem;
66
+ --app-rail: 3.5rem;
67
+ --app-detail-width: 22rem;
68
+ container: app-shell / inline-size;
69
+ box-sizing: border-box;
70
+ width: 100%;
71
+ height: 100dvh;
72
+ background-color: var(--bg);
73
+ color: var(--ink);
74
+ }
75
+ /* The shell is the page: no body margin to scroll past. */
76
+ body:has(> .app-shell) { margin: 0; }
77
+
78
+ .app-shell-grid {
79
+ --app-detail-mode: sheet;
80
+ position: relative; /* the rail's labels are placed against it */
81
+ display: grid;
82
+ height: 100%;
83
+ grid-template-columns: minmax(0, 1fr);
84
+ grid-template-rows: auto minmax(0, 1fr);
85
+ grid-template-areas: "head" "main";
86
+ }
87
+ .app-shell-grid > .site-header { grid-area: head; position: relative; }
88
+ .app-shell .site-header-inner { padding-inline: var(--s3); }
89
+
90
+ .app-main {
91
+ grid-area: main;
92
+ min-width: 0;
93
+ min-height: 0;
94
+ overflow: auto;
95
+ }
96
+
97
+ /* ── Menu button (phone only) ─────────────────────────────────────────── */
98
+ .app-menu-button { flex: none; }
99
+
100
+ /* ── Sidebar ──────────────────────────────────────────────────────────── */
101
+ .app-sidebar[popover] {
102
+ grid-area: side;
103
+ box-sizing: border-box;
104
+ display: none;
105
+ flex-direction: column;
106
+ gap: var(--s4);
107
+ position: static;
108
+ inset: auto;
109
+ width: auto;
110
+ height: auto;
111
+ margin: 0;
112
+ padding: var(--s4) var(--s2);
113
+ overflow-x: hidden;
114
+ overflow-y: auto;
115
+ border: 0;
116
+ border-inline-end: 1px solid var(--line);
117
+ background-color: var(--bg);
118
+ color: var(--ink);
119
+ }
120
+ .app-sidebar-section { min-width: 0; }
121
+ .app-sidebar-title {
122
+ margin: 0 0 var(--s1);
123
+ padding-inline: var(--s3);
124
+ color: var(--ink-soft);
125
+ font-size: var(--text-xs);
126
+ font-weight: var(--weight-semibold);
127
+ line-height: var(--leading-body);
128
+ }
129
+ .app-sidebar ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
130
+ .app-sidebar a {
131
+ display: flex;
132
+ align-items: center;
133
+ gap: var(--s3);
134
+ min-height: 40px;
135
+ padding: 0 var(--s3);
136
+ border-radius: var(--radius);
137
+ color: var(--ink-soft);
138
+ font-size: var(--text-sm);
139
+ font-weight: var(--weight-medium);
140
+ text-decoration: none;
141
+ }
142
+ .app-sidebar a:hover { background-color: var(--surface-hover); color: var(--ink); }
143
+ .app-sidebar a[aria-current='page'] { background-color: var(--i-surface); color: var(--i-ink); font-weight: var(--weight-semibold); }
144
+ .app-sidebar a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
145
+ .app-sidebar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
146
+
147
+ .app-sidebar-close, .app-sidebar-toggle { display: none; }
148
+ .app-sidebar-toggle { margin-top: auto; align-self: flex-start; }
149
+ .app-sidebar-toggle > svg:dir(rtl) { scale: -1 1; }
150
+
151
+ /* Phone: the open sidebar is a sheet from the inline start. */
152
+ .app-sidebar[popover]:popover-open {
153
+ position: fixed;
154
+ inset: 0 auto 0 0;
155
+ display: flex;
156
+ width: min(85%, 18rem);
157
+ height: 100dvh;
158
+ padding-top: var(--s3);
159
+ border-inline-end: 1px solid var(--line);
160
+ background-color: var(--card);
161
+ box-shadow: var(--shadow-3);
162
+ }
163
+ .app-sidebar[popover]:popover-open:dir(rtl) { inset: 0 0 0 auto; }
164
+ .app-sidebar[popover]::backdrop { background-color: var(--scrim); }
165
+ .app-sidebar:popover-open .app-sidebar-close { display: inline-flex; align-self: flex-end; }
166
+ .app-sidebar:popover-open a { min-height: 44px; font-size: var(--text-base); }
167
+
168
+ /* ── Detail panel ─────────────────────────────────────────────────────── */
169
+ /* A sheet from the bottom on a phone, opened with showModal(). */
170
+ .app-detail {
171
+ width: 100%;
172
+ max-width: none;
173
+ height: fit-content;
174
+ max-height: 85dvh;
175
+ margin: auto 0 0;
176
+ border-width: 1px 0 0;
177
+ border-radius: var(--radius-lg) var(--radius-lg) 0 0;
178
+ transform: translateY(100%);
179
+ }
180
+ .app-detail[open] { transform: none; }
181
+ @starting-style {
182
+ .app-detail:modal { transform: translateY(100%); }
183
+ }
184
+ /* Opened with show() at a width that has since narrowed: it lies over the
185
+ main view's end, without a scrim. */
186
+ .app-detail[open]:not(:modal) {
187
+ grid-area: main;
188
+ position: absolute;
189
+ z-index: 2;
190
+ inset: 0 0 0 auto;
191
+ width: min(100%, var(--app-detail-width));
192
+ height: auto;
193
+ max-height: none;
194
+ margin: 0;
195
+ border-width: 0;
196
+ border-inline-start-width: 1px;
197
+ border-radius: 0;
198
+ }
199
+ .app-detail[open]:not(:modal):dir(rtl) { inset: 0 auto 0 0; }
200
+
201
+ /* ── 48rem and up: sidebar column, detail sheet from the inline end ──── */
202
+ @container app-shell (min-width: 48rem) {
203
+ .app-shell-grid {
204
+ grid-template-columns: var(--app-sidebar) minmax(0, 1fr);
205
+ grid-template-areas: "head head" "side main";
206
+ }
207
+ .app-shell[data-sidebar='collapsed'] .app-shell-grid { grid-template-columns: var(--app-rail) minmax(0, 1fr); }
208
+ .app-menu-button { display: none; }
209
+ .app-sidebar[popover]:not(:popover-open) { display: flex; }
210
+ .app-sidebar:not(:popover-open) .app-sidebar-toggle { display: inline-flex; }
211
+
212
+ /* On the element itself, not on :modal, so it keeps this shape while it
213
+ closes; [open] then puts it in place, at the same specificity as the
214
+ starting style. */
215
+ .app-detail {
216
+ width: min(100%, 26rem);
217
+ height: 100dvh;
218
+ max-height: 100dvh;
219
+ margin: 0;
220
+ margin-inline-start: auto;
221
+ border-width: 0;
222
+ border-inline-start-width: 1px;
223
+ border-radius: 0;
224
+ transform: translateX(100%);
225
+ }
226
+ .app-detail:dir(rtl) { transform: translateX(-100%); }
227
+ .app-detail[open] { transform: none; }
228
+ @starting-style {
229
+ .app-detail:modal { transform: translateX(100%); }
230
+ .app-detail:modal:dir(rtl) { transform: translateX(-100%); }
231
+ }
232
+ }
233
+
234
+ /* ── The rail: icons only, labels on hover and focus ─────────────────── */
235
+ @container app-shell (min-width: 48rem) {
236
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) {
237
+ padding-inline: calc((var(--app-rail) - 44px) / 2);
238
+ }
239
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) :is(.app-sidebar-title, .app-sidebar-label) {
240
+ position: absolute;
241
+ width: 1px;
242
+ height: 1px;
243
+ overflow: hidden;
244
+ clip-path: inset(50%);
245
+ white-space: nowrap;
246
+ }
247
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) .app-sidebar-section + .app-sidebar-section {
248
+ padding-top: var(--s4);
249
+ border-top: 1px solid var(--line-soft);
250
+ }
251
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) a {
252
+ justify-content: center;
253
+ width: 44px;
254
+ min-height: 44px;
255
+ padding: 0;
256
+ }
257
+ .app-shell[data-sidebar='collapsed'] .app-sidebar-toggle { align-self: center; }
258
+ .app-shell[data-sidebar='collapsed'] .app-sidebar-toggle > svg { scale: -1 1; }
259
+ .app-shell[data-sidebar='collapsed'] .app-sidebar-toggle > svg:dir(rtl) { scale: 1 1; }
260
+
261
+ /* The hovered or focused item's label, shown as a tooltip beside it. */
262
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) a:is(:hover, :focus-visible) > .app-sidebar-label {
263
+ z-index: var(--z-float);
264
+ width: max-content;
265
+ max-width: 16rem;
266
+ height: auto;
267
+ padding: 4px var(--s2);
268
+ overflow: visible;
269
+ clip-path: none;
270
+ border: 1px solid transparent;
271
+ border-radius: var(--radius-sm);
272
+ background-color: var(--ink);
273
+ color: var(--card);
274
+ font-size: var(--text-xs);
275
+ font-weight: var(--weight-medium);
276
+ line-height: var(--leading-ui);
277
+ pointer-events: none;
278
+ }
279
+ }
280
+ /* Placed with anchor positioning against the grid, so the sidebar's own
281
+ scrolling doesn't clip it. */
282
+ @supports (anchor-name: --a) {
283
+ @container app-shell (min-width: 48rem) {
284
+ /* Scoped per item, so a hovered item and a focused one each get their own. */
285
+ .app-shell[data-sidebar='collapsed'] .app-sidebar li { anchor-scope: --app-rail-item; }
286
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) a:is(:hover, :focus-visible) {
287
+ anchor-name: --app-rail-item;
288
+ }
289
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) a:is(:hover, :focus-visible) > .app-sidebar-label {
290
+ position-anchor: --app-rail-item;
291
+ position-area: inline-end;
292
+ margin-inline-start: var(--s2);
293
+ }
294
+ }
295
+ }
296
+ /* Without it: placed against the link, and the rail doesn't scroll. */
297
+ @supports not (anchor-name: --a) {
298
+ @container app-shell (min-width: 48rem) {
299
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) { overflow: visible; }
300
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) a { position: relative; }
301
+ .app-shell[data-sidebar='collapsed'] .app-sidebar:not(:popover-open) a:is(:hover, :focus-visible) > .app-sidebar-label {
302
+ inset-block: 50% auto;
303
+ inset-inline: calc(100% + var(--s2)) auto;
304
+ translate: 0 -50%;
305
+ }
306
+ }
307
+ }
308
+
309
+ /* ── 75rem and up: the detail is a third column ───────────────────────── */
310
+ @container app-shell (min-width: 75rem) {
311
+ .app-shell-grid { --app-detail-mode: column; }
312
+ /* A column closes at once: the grid drops its column the moment the
313
+ panel closes, so a fade-out would play over the sidebar and main. */
314
+ .app-detail:not([open]) { transition: none; }
315
+ .app-shell-grid:has(> .app-detail[open]:not(:modal)) {
316
+ grid-template-columns: var(--app-sidebar) minmax(0, 1fr) var(--app-detail-width);
317
+ grid-template-areas: "head head head" "side main detail";
318
+ }
319
+ .app-shell[data-sidebar='collapsed'] .app-shell-grid:has(> .app-detail[open]:not(:modal)) {
320
+ grid-template-columns: var(--app-rail) minmax(0, 1fr) var(--app-detail-width);
321
+ }
322
+ .app-detail[open]:not(:modal) {
323
+ grid-area: detail;
324
+ position: static;
325
+ z-index: auto;
326
+ width: auto;
327
+ min-width: 0;
328
+ box-shadow: none;
329
+ opacity: 1;
330
+ transform: none;
331
+ transition: none;
332
+ }
333
+ }
334
+
335
+ @media (pointer: coarse) {
336
+ .app-sidebar a { min-height: 44px; }
337
+ }
338
+ @media (forced-colors: active) {
339
+ .app-sidebar[popover] { border-inline-end-color: CanvasText; }
340
+ .app-sidebar a[aria-current='page'] { outline: 2px solid CanvasText; outline-offset: -2px; }
341
+ .app-shell[data-sidebar='collapsed'] .app-sidebar a:is(:hover, :focus-visible) > .app-sidebar-label { border-color: CanvasText; }
342
+ }
343
+ @media (prefers-reduced-motion: reduce) {
344
+ .app-detail { transform: none; }
345
+ }
346
+ }
@@ -37,7 +37,7 @@
37
37
  @layer brignano.components {
38
38
  .article { container: article / inline-size; width: 100%; max-width: var(--measure); margin-inline: auto; }
39
39
  .article-header { margin-bottom: var(--s6); }
40
- .article-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
40
+ .article-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; line-height: var(--leading-display); text-wrap: balance; }
41
41
  .article-meta {
42
42
  display: flex;
43
43
  flex-wrap: wrap;
@@ -65,7 +65,7 @@
65
65
  gap: var(--s1);
66
66
  padding: var(--s3) var(--s4);
67
67
  color: var(--ink);
68
- font-weight: 500;
68
+ font-weight: var(--weight-medium);
69
69
  text-decoration: none;
70
70
  border: 1px solid var(--line);
71
71
  border-radius: var(--radius);
@@ -74,7 +74,7 @@
74
74
  .article-pager > a[rel~='next'] { text-align: right; grid-column: -2; }
75
75
  .article-pager > a:hover { background: var(--surface-hover); }
76
76
  .article-pager > a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
77
- .article-pager-label { font-size: var(--text-sm); font-weight: 400; color: var(--ink-soft); }
77
+ .article-pager-label { font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--ink-soft); }
78
78
  @container article (min-width: 36rem) {
79
79
  .article-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
80
80
  }
@@ -102,7 +102,7 @@
102
102
  margin: var(--s3) 0 var(--s1);
103
103
  padding-inline: var(--s2);
104
104
  font-size: var(--text-xs);
105
- font-weight: 600;
105
+ font-weight: var(--weight-semibold);
106
106
  letter-spacing: 0.04em;
107
107
  text-transform: uppercase;
108
108
  color: var(--slate);
@@ -118,8 +118,8 @@
118
118
  }
119
119
  .article-nav a:hover, .article-toc a:hover { color: var(--ink); background: var(--surface-hover); }
120
120
  .article-nav a:focus-visible, .article-toc a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: -2px; }
121
- .article-nav a[aria-current='page'] { color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--i-ink); }
122
- .article-toc a[aria-current] { color: var(--ink); font-weight: 600; }
121
+ .article-nav a[aria-current='page'] { color: var(--ink); font-weight: var(--weight-semibold); box-shadow: inset 2px 0 0 var(--i-ink); }
122
+ .article-toc a[aria-current] { color: var(--ink); font-weight: var(--weight-semibold); }
123
123
 
124
124
  @container article-docs (min-width: 48rem) {
125
125
  .article-docs-layout {
@@ -149,7 +149,7 @@
149
149
  display: block;
150
150
  padding: 0 var(--s2) var(--s2);
151
151
  font-size: var(--text-sm);
152
- font-weight: 600;
152
+ font-weight: var(--weight-semibold);
153
153
  color: var(--ink);
154
154
  }
155
155
  .article-docs-layout > .article-toc::details-content { content-visibility: visible; }
@@ -25,7 +25,7 @@
25
25
  margin-inline: auto;
26
26
  }
27
27
  .changelog-header { margin-bottom: var(--s7); }
28
- .changelog-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
28
+ .changelog-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; line-height: var(--leading-display); text-wrap: balance; }
29
29
  .changelog-header > p { margin: var(--s2) 0 0; color: var(--ink-soft); }
30
30
 
31
31
  .release {
@@ -37,7 +37,7 @@
37
37
  scroll-margin-top: var(--s5);
38
38
  }
39
39
  .release-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); }
40
- .release-version { margin: 0; font-family: var(--mono); font-size: var(--text-lg); font-weight: 600; }
40
+ .release-version { margin: 0; font-family: var(--mono); font-size: var(--text-lg); font-weight: var(--weight-semibold); }
41
41
  .release-version > a { color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
42
42
  .release-version > a:hover { text-decoration: underline; text-underline-offset: 3px; }
43
43
  .release-version > a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
@@ -0,0 +1,81 @@
1
+ /* @brignano/design — error page template (#71)
2
+ 404, 500 and offline: the product mark, the code in mono, one line of what
3
+ happened and one way forward. Calm, no jokes or illustrations (DESIGN.md §1);
4
+ the wording follows DESIGN.md §15 and belongs to each product.
5
+ Needs tokens.css and components.css (for .btn).
6
+
7
+ <main class="error-page">
8
+ <div class="error-page-block">
9
+ <a class="error-page-mark" href="/"><svg aria-hidden="true" …></svg>Product</a>
10
+ <p class="error-page-code">404</p>
11
+ <h1 class="error-page-title">This page doesn't exist</h1>
12
+ <p class="error-page-body">It may have moved, or the link has a typo.</p>
13
+ <a class="btn btn-primary" href="/">Go to the home page</a>
14
+ </div>
15
+ </main>
16
+
17
+ The code above the title is the page's label (404, 500, Offline), not a
18
+ message code. A request ID that support will ask for goes after the words,
19
+ as DESIGN.md §15 says: <p class="error-page-ref">Request ID req_…</p>.
20
+
21
+ The page fills the screen and centres the block; the body's margin goes
22
+ so it doesn't scroll. Wiring it into a host's 404 handling is each site's
23
+ job. */
24
+ @layer brignano.components {
25
+ body:has(> .error-page) { margin: 0; }
26
+ .error-page {
27
+ display: grid;
28
+ place-items: center;
29
+ box-sizing: border-box;
30
+ min-height: 100svh;
31
+ padding: var(--s7) var(--s5);
32
+ background: var(--bg);
33
+ color: var(--ink);
34
+ }
35
+ .error-page-block {
36
+ display: flex;
37
+ flex-direction: column;
38
+ align-items: center;
39
+ gap: var(--s3);
40
+ min-width: 0;
41
+ max-width: min(28rem, 100%);
42
+ text-align: center;
43
+ }
44
+ .error-page-mark {
45
+ display: inline-flex;
46
+ align-items: center;
47
+ gap: var(--s2);
48
+ margin-bottom: var(--s5);
49
+ font-weight: var(--weight-semibold);
50
+ color: var(--ink);
51
+ text-decoration: none;
52
+ }
53
+ .error-page-mark:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; border-radius: var(--radius); }
54
+ .error-page-mark > svg { width: 1.5em; height: 1.5em; flex: none; color: var(--mark-current); }
55
+ .error-page-code {
56
+ margin: 0;
57
+ font-family: var(--mono);
58
+ font-size: var(--text-sm);
59
+ letter-spacing: var(--tracking-caps);
60
+ color: var(--slate);
61
+ overflow-wrap: anywhere;
62
+ }
63
+ .error-page-title {
64
+ margin: 0;
65
+ font-size: var(--text-2xl);
66
+ font-weight: var(--weight-semibold);
67
+ letter-spacing: -0.02em;
68
+ line-height: 1.2;
69
+ text-wrap: balance;
70
+ overflow-wrap: anywhere;
71
+ }
72
+ .error-page-body { margin: 0 0 var(--s3); color: var(--ink-soft); text-wrap: pretty; overflow-wrap: anywhere; }
73
+ .error-page-ref {
74
+ margin: var(--s3) 0 0;
75
+ font-family: var(--mono);
76
+ font-size: var(--text-xs);
77
+ color: var(--slate);
78
+ overflow-wrap: anywhere;
79
+ }
80
+ @media (pointer: coarse) { .error-page-mark { min-height: 44px; } }
81
+ }
@@ -27,7 +27,7 @@
27
27
  margin-inline: auto;
28
28
  }
29
29
  .legal-header { margin-bottom: var(--s6); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
30
- .legal-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
30
+ .legal-header > h1 { margin: 0; font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; line-height: var(--leading-display); text-wrap: balance; }
31
31
  .legal-updated { margin: var(--s2) 0 0; font-family: var(--mono); font-size: var(--text-sm); color: var(--slate); }
32
32
 
33
33
  .legal-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
@@ -39,11 +39,11 @@
39
39
  border: 1px solid var(--line);
40
40
  border-radius: var(--radius);
41
41
  }
42
- .legal-toc-title { margin: 0 0 var(--s2); font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
42
+ .legal-toc-title { margin: 0 0 var(--s2); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ink); }
43
43
  .legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
44
44
  .legal-toc a { color: var(--ink-soft); font-size: var(--text-sm); text-decoration: none; border-radius: var(--radius-sm); }
45
45
  .legal-toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
46
- .legal-toc a[aria-current] { color: var(--ink); font-weight: 600; }
46
+ .legal-toc a[aria-current] { color: var(--ink); font-weight: var(--weight-semibold); }
47
47
  .legal-toc a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
48
48
 
49
49
  @container legal (min-width: 52rem) {
@@ -0,0 +1,95 @@
1
+ /* @brignano/design — settings page template (#69)
2
+ A tool app's settings: one section per topic, each with its heading and a
3
+ line of description on the left and its controls on the right. Needs
4
+ tokens.css and components.css (.field, .choice, .switch, .btn, .dialog).
5
+
6
+ <main class="settings">
7
+ <h1 class="settings-title">Settings</h1>
8
+ <form class="settings-section" aria-labelledby="profile-h">
9
+ <div class="settings-intro">
10
+ <h2 id="profile-h">Profile</h2>
11
+ <p>How other people see you.</p>
12
+ </div>
13
+ <div class="settings-fields">
14
+ <div class="field">…</div>
15
+ </div>
16
+ <div class="settings-save">
17
+ <p class="settings-save-note" role="status"></p>
18
+ <div class="settings-save-actions" hidden>
19
+ <button type="reset" class="btn">Discard</button>
20
+ <button class="btn btn-primary">Save profile</button>
21
+ </div>
22
+ </div>
23
+ </form>
24
+ <section class="settings-section settings-danger" aria-labelledby="danger-h">…</section>
25
+ </main>
26
+
27
+ - Save per section. A section of fields is a <form> with its own save
28
+ bar. Its buttons are `hidden` until something in the form changes, and
29
+ its note is an always-rendered, empty role="status". Your script (design
30
+ ships no JS) does the rest, as previews/settings.html shows: on the
31
+ first `input`, write "Unsaved changes" and unhide the buttons; after a
32
+ save, copy each value into its default (defaultValue, defaultChecked,
33
+ defaultSelected) so Discard can't undo the save; before hiding the
34
+ buttons again, move focus to the section's heading (tabindex="-1").
35
+ - Settings that apply the moment they change are switches, in a
36
+ <section> with no save bar (DESIGN.md §14, "Switch or checkbox").
37
+ - .settings-danger holds what can't be undone. Each action is a
38
+ .btn-danger that opens a .dialog-confirm.
39
+ - The two columns need the page itself to be 48rem wide (a container
40
+ query), so the layout follows its column, not the screen. Give its
41
+ wrapper a definite width: inside a box that sizes to its content, a
42
+ container collapses. */
43
+ @layer brignano.components {
44
+ .settings {
45
+ container: settings / inline-size;
46
+ width: 100%;
47
+ max-width: 64rem;
48
+ margin-inline: auto;
49
+ }
50
+ .settings-title { margin: 0 0 var(--s6); font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; line-height: var(--leading-display); text-wrap: balance; }
51
+
52
+ .settings-section {
53
+ display: grid;
54
+ grid-template-columns: minmax(0, 1fr);
55
+ gap: var(--s4) var(--s7);
56
+ margin: 0;
57
+ padding: var(--s6) 0;
58
+ border-top: 1px solid var(--line);
59
+ }
60
+ .settings-intro { min-width: 0; overflow-wrap: anywhere; }
61
+ .settings-intro > h2 { margin: 0; text-wrap: balance; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-title); }
62
+ .settings-intro > p { margin: var(--s1) 0 0; font-size: var(--text-sm); color: var(--ink-soft); max-width: 40ch; }
63
+ .settings-fields { display: grid; gap: var(--s5); min-width: 0; max-width: 32rem; }
64
+
65
+ .settings-save {
66
+ display: flex;
67
+ flex-wrap: wrap;
68
+ align-items: center;
69
+ justify-content: flex-end;
70
+ gap: var(--s3);
71
+ max-width: 32rem;
72
+ padding: var(--s3) 0 0;
73
+ border-top: 1px solid var(--line);
74
+ }
75
+ .settings-save:has(> .settings-save-actions[hidden]) { padding-top: 0; border-top: 0; }
76
+ .settings-save-note { margin: 0 auto 0 0; font-size: var(--text-sm); color: var(--ink-soft); }
77
+ .settings-save-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
78
+ .settings-save-actions[hidden] { display: none; }
79
+
80
+ .settings-danger .settings-intro > h2 { color: var(--danger-ink); }
81
+ .settings-danger-row {
82
+ display: flex;
83
+ flex-wrap: wrap;
84
+ align-items: center;
85
+ justify-content: space-between;
86
+ gap: var(--s3) var(--s5);
87
+ }
88
+ .settings-danger-row > p { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); max-width: 40ch; }
89
+
90
+ @container settings (min-width: 48rem) {
91
+ .settings-section { grid-template-columns: 16rem minmax(0, 1fr); }
92
+ .settings-intro { grid-row: 1 / span 2; }
93
+ .settings-fields, .settings-save { grid-column: 2; }
94
+ }
95
+ }