@brignano/design 0.7.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.
- package/DECISIONS.md +199 -0
- package/DESIGN.md +337 -13
- package/README.md +5 -1
- package/components.css +2248 -0
- package/icons/LICENSE +43 -0
- package/icons/arrow-down.svg +15 -0
- package/icons/arrow-left.svg +15 -0
- package/icons/arrow-right.svg +15 -0
- package/icons/arrow-up-down.svg +17 -0
- package/icons/arrow-up.svg +15 -0
- package/icons/bell.svg +15 -0
- package/icons/calendar.svg +17 -0
- package/icons/check.svg +14 -0
- package/icons/chevron-down.svg +14 -0
- package/icons/chevron-left.svg +14 -0
- package/icons/chevron-right.svg +14 -0
- package/icons/chevron-up.svg +14 -0
- package/icons/circle-check.svg +15 -0
- package/icons/circle-help.svg +16 -0
- package/icons/circle-x.svg +16 -0
- package/icons/clock.svg +15 -0
- package/icons/copy.svg +15 -0
- package/icons/download.svg +16 -0
- package/icons/ellipsis-vertical.svg +16 -0
- package/icons/ellipsis.svg +16 -0
- package/icons/external-link.svg +16 -0
- package/icons/eye-off.svg +17 -0
- package/icons/eye.svg +15 -0
- package/icons/funnel.svg +14 -0
- package/icons/house.svg +15 -0
- package/icons/info.svg +16 -0
- package/icons/link.svg +15 -0
- package/icons/lock.svg +15 -0
- package/icons/log-out.svg +16 -0
- package/icons/map-pin.svg +15 -0
- package/icons/menu.svg +16 -0
- package/icons/minus.svg +14 -0
- package/icons/monitor.svg +16 -0
- package/icons/moon.svg +14 -0
- package/icons/pencil.svg +15 -0
- package/icons/plus.svg +15 -0
- package/icons/refresh-cw.svg +17 -0
- package/icons/search.svg +15 -0
- package/icons/settings.svg +15 -0
- package/icons/sun.svg +22 -0
- package/icons/trash-2.svg +18 -0
- package/icons/triangle-alert.svg +16 -0
- package/icons/undo-2.svg +15 -0
- package/icons/upload.svg +16 -0
- package/icons/user.svg +15 -0
- package/icons/x.svg +15 -0
- package/package.json +11 -2
- package/product-page.css +31 -28
- package/scripts/colour.mjs +41 -0
- package/scripts/email-tokens.mjs +58 -0
- package/tailwind.css +28 -0
- package/templates/app-shell.css +346 -0
- package/templates/article.css +167 -0
- package/templates/changelog.css +53 -0
- package/templates/email.html +61 -0
- package/templates/email.txt +10 -0
- package/templates/error.css +81 -0
- package/templates/legal.css +65 -0
- package/templates/settings.css +95 -0
- package/tokens.css +140 -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
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* @brignano/design — article and docs page template (#72)
|
|
2
|
+
One template for blog posts and product docs. Needs tokens.css and
|
|
3
|
+
components.css (for .prose and .disclosure).
|
|
4
|
+
|
|
5
|
+
Article:
|
|
6
|
+
<main class="article">
|
|
7
|
+
<header class="article-header">
|
|
8
|
+
<h1>Title</h1>
|
|
9
|
+
<p class="article-meta"><time datetime="2026-11-07">7 Nov 2026</time><span>4 min read</span></p>
|
|
10
|
+
</header>
|
|
11
|
+
<div class="prose">…</div>
|
|
12
|
+
<nav class="article-pager" aria-label="More articles">
|
|
13
|
+
<a rel="prev" href="…"><span class="article-pager-label">Previous</span>Title</a>
|
|
14
|
+
<a rel="next" href="…"><span class="article-pager-label">Next</span>Title</a>
|
|
15
|
+
</nav>
|
|
16
|
+
</main>
|
|
17
|
+
|
|
18
|
+
Docs mode wraps it with a section nav and an "On this page" list. Both are
|
|
19
|
+
<details class="disclosure">, so on a phone they are native disclosures:
|
|
20
|
+
<div class="article-docs"><div class="article-docs-layout">
|
|
21
|
+
<details class="disclosure article-nav"><summary>Docs</summary>
|
|
22
|
+
<nav aria-label="Docs"><ul><li><a href="…" aria-current="page">…</a></li></ul></nav>
|
|
23
|
+
</details>
|
|
24
|
+
<details class="disclosure article-toc"><summary>On this page</summary>
|
|
25
|
+
<nav aria-label="On this page"><ol><li><a href="#…">…</a></li></ol></nav>
|
|
26
|
+
</details>
|
|
27
|
+
<main class="article">…</main>
|
|
28
|
+
</div></div>
|
|
29
|
+
|
|
30
|
+
.article-docs is the container and .article-docs-layout the grid inside it
|
|
31
|
+
(an element can't query its own size). Layout follows the width of
|
|
32
|
+
.article-docs. The nav
|
|
33
|
+
moves to a sticky left column at 48rem and the contents list to a sticky
|
|
34
|
+
right column at 60rem. In a column the disclosure is shown open with its
|
|
35
|
+
summary hidden, via ::details-content; browsers without it keep the
|
|
36
|
+
disclosure. */
|
|
37
|
+
@layer brignano.components {
|
|
38
|
+
.article { container: article / inline-size; width: 100%; max-width: var(--measure); margin-inline: auto; }
|
|
39
|
+
.article-header { margin-bottom: var(--s6); }
|
|
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
|
+
.article-meta {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
gap: var(--s1) var(--s2);
|
|
45
|
+
margin: var(--s2) 0 0;
|
|
46
|
+
font-family: var(--mono);
|
|
47
|
+
font-size: var(--text-sm);
|
|
48
|
+
color: var(--slate);
|
|
49
|
+
}
|
|
50
|
+
.article-meta > * + *::before { content: '·'; content: '·' / ''; margin-right: var(--s2); }
|
|
51
|
+
.article > .prose :is(h2, h3) { scroll-margin-top: var(--s5); }
|
|
52
|
+
|
|
53
|
+
/* Previous / next. State comes from rel, so either link can be left out. */
|
|
54
|
+
.article-pager {
|
|
55
|
+
display: grid;
|
|
56
|
+
grid-template-columns: minmax(0, 1fr);
|
|
57
|
+
gap: var(--s3);
|
|
58
|
+
margin-top: var(--s7);
|
|
59
|
+
padding-top: var(--s5);
|
|
60
|
+
border-top: 1px solid var(--line);
|
|
61
|
+
}
|
|
62
|
+
.article-pager > a {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: var(--s1);
|
|
66
|
+
padding: var(--s3) var(--s4);
|
|
67
|
+
color: var(--ink);
|
|
68
|
+
font-weight: var(--weight-medium);
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
border: 1px solid var(--line);
|
|
71
|
+
border-radius: var(--radius);
|
|
72
|
+
transition: background-color var(--dur-fast) var(--ease);
|
|
73
|
+
}
|
|
74
|
+
.article-pager > a[rel~='next'] { text-align: right; grid-column: -2; }
|
|
75
|
+
.article-pager > a:hover { background: var(--surface-hover); }
|
|
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: var(--weight-regular); color: var(--ink-soft); }
|
|
78
|
+
@container article (min-width: 36rem) {
|
|
79
|
+
.article-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Docs mode */
|
|
83
|
+
.article-docs {
|
|
84
|
+
container: article-docs / inline-size;
|
|
85
|
+
width: 100%;
|
|
86
|
+
max-width: calc(var(--measure) + 28rem);
|
|
87
|
+
margin-inline: auto;
|
|
88
|
+
}
|
|
89
|
+
.article-docs-layout {
|
|
90
|
+
display: grid;
|
|
91
|
+
grid-template-columns: minmax(0, 1fr);
|
|
92
|
+
grid-template-areas: 'nav' 'toc' 'main';
|
|
93
|
+
gap: var(--s4);
|
|
94
|
+
}
|
|
95
|
+
.article-docs-layout > .article-nav { grid-area: nav; }
|
|
96
|
+
.article-docs-layout > .article-toc { grid-area: toc; }
|
|
97
|
+
.article-docs-layout > .article { grid-area: main; margin-top: var(--s4); }
|
|
98
|
+
.article-docs-layout > details { border: 1px solid var(--line); border-radius: var(--radius); }
|
|
99
|
+
|
|
100
|
+
.article-nav ul, .article-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
|
|
101
|
+
.article-nav-heading {
|
|
102
|
+
margin: var(--s3) 0 var(--s1);
|
|
103
|
+
padding-inline: var(--s2);
|
|
104
|
+
font-size: var(--text-xs);
|
|
105
|
+
font-weight: var(--weight-semibold);
|
|
106
|
+
letter-spacing: 0.04em;
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
color: var(--slate);
|
|
109
|
+
}
|
|
110
|
+
.article-nav-heading:first-child { margin-top: 0; }
|
|
111
|
+
.article-nav a, .article-toc a {
|
|
112
|
+
display: block;
|
|
113
|
+
padding: 2px var(--s2);
|
|
114
|
+
color: var(--ink-soft);
|
|
115
|
+
font-size: var(--text-sm);
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
border-radius: var(--radius-sm);
|
|
118
|
+
}
|
|
119
|
+
.article-nav a:hover, .article-toc a:hover { color: var(--ink); background: var(--surface-hover); }
|
|
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: 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
|
+
|
|
124
|
+
@container article-docs (min-width: 48rem) {
|
|
125
|
+
.article-docs-layout {
|
|
126
|
+
grid-template-columns: 13rem minmax(0, 1fr);
|
|
127
|
+
grid-template-areas: 'nav toc' 'nav main';
|
|
128
|
+
column-gap: var(--s7);
|
|
129
|
+
}
|
|
130
|
+
.article-docs-layout > .article { margin-top: 0; }
|
|
131
|
+
@supports selector(::details-content) {
|
|
132
|
+
.article-docs-layout > .article-nav { align-self: start; position: sticky; top: var(--s5); border: 0; }
|
|
133
|
+
.article-docs-layout > .article-nav > summary { display: none; }
|
|
134
|
+
.article-docs-layout > .article-nav::details-content { content-visibility: visible; }
|
|
135
|
+
.article-docs-layout > .article-nav > :not(summary) { padding: 0; }
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
@container article-docs (min-width: 60rem) {
|
|
139
|
+
.article-docs-layout {
|
|
140
|
+
grid-template-columns: 13rem minmax(0, 1fr) 12rem;
|
|
141
|
+
grid-template-areas: 'nav main toc';
|
|
142
|
+
}
|
|
143
|
+
@supports selector(::details-content) {
|
|
144
|
+
.article-docs-layout > .article-toc { align-self: start; position: sticky; top: var(--s5); border: 0; }
|
|
145
|
+
.article-docs-layout > .article-toc > summary { display: none; }
|
|
146
|
+
.article-docs-layout > .article-toc > nav::before {
|
|
147
|
+
content: attr(aria-label);
|
|
148
|
+
content: attr(aria-label) / '';
|
|
149
|
+
display: block;
|
|
150
|
+
padding: 0 var(--s2) var(--s2);
|
|
151
|
+
font-size: var(--text-sm);
|
|
152
|
+
font-weight: var(--weight-semibold);
|
|
153
|
+
color: var(--ink);
|
|
154
|
+
}
|
|
155
|
+
.article-docs-layout > .article-toc::details-content { content-visibility: visible; }
|
|
156
|
+
.article-docs-layout > .article-toc > :not(summary) { padding: 0; }
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (pointer: coarse) {
|
|
161
|
+
.article-nav ul, .article-toc ol { gap: 0; }
|
|
162
|
+
.article-nav a, .article-toc a { display: flex; align-items: center; min-height: 44px; }
|
|
163
|
+
}
|
|
164
|
+
@media (prefers-reduced-motion: reduce) {
|
|
165
|
+
.article-pager > a { transition: none; }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* @brignano/design — changelog page template (#73)
|
|
2
|
+
Releases newest first. Each release is a version and date in mono, an
|
|
3
|
+
anchor to itself, and the hand-written notes in .prose. Needs tokens.css
|
|
4
|
+
and components.css (for .prose).
|
|
5
|
+
|
|
6
|
+
<main class="changelog">
|
|
7
|
+
<header class="changelog-header"><h1>Changelog</h1><p>…</p></header>
|
|
8
|
+
<article class="release" id="v0.7.0" aria-labelledby="v0.7.0-title">
|
|
9
|
+
<header class="release-meta">
|
|
10
|
+
<h2 class="release-version" id="v0.7.0-title"><a href="#v0.7.0">v0.7.0</a></h2>
|
|
11
|
+
<time class="release-date" datetime="2026-11-02">2 Nov 2026</time>
|
|
12
|
+
</header>
|
|
13
|
+
<div class="prose">…notes, headings from h3…</div>
|
|
14
|
+
</article>
|
|
15
|
+
</main>
|
|
16
|
+
|
|
17
|
+
The version and date sit in a left column when the changelog itself is
|
|
18
|
+
wider than 44rem, and above the notes when it isn't (container query, so
|
|
19
|
+
it works in any column). */
|
|
20
|
+
@layer brignano.components {
|
|
21
|
+
.changelog {
|
|
22
|
+
container: changelog / inline-size;
|
|
23
|
+
width: 100%;
|
|
24
|
+
max-width: calc(var(--measure) + 12rem);
|
|
25
|
+
margin-inline: auto;
|
|
26
|
+
}
|
|
27
|
+
.changelog-header { margin-bottom: var(--s7); }
|
|
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
|
+
.changelog-header > p { margin: var(--s2) 0 0; color: var(--ink-soft); }
|
|
30
|
+
|
|
31
|
+
.release {
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-template-columns: minmax(0, 1fr);
|
|
34
|
+
gap: var(--s3);
|
|
35
|
+
padding-block: var(--s6);
|
|
36
|
+
border-top: 1px solid var(--line);
|
|
37
|
+
scroll-margin-top: var(--s5);
|
|
38
|
+
}
|
|
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: var(--weight-semibold); }
|
|
41
|
+
.release-version > a { color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
|
|
42
|
+
.release-version > a:hover { text-decoration: underline; text-underline-offset: 3px; }
|
|
43
|
+
.release-version > a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
|
|
44
|
+
.release-date { font-family: var(--mono); font-size: var(--text-sm); color: var(--slate); }
|
|
45
|
+
|
|
46
|
+
@container changelog (min-width: 44rem) {
|
|
47
|
+
.release { grid-template-columns: 10rem minmax(0, 1fr); gap: var(--s6); }
|
|
48
|
+
.release-meta { flex-direction: column; align-self: start; position: sticky; top: var(--s5); }
|
|
49
|
+
}
|
|
50
|
+
@media (pointer: coarse) {
|
|
51
|
+
.release-version > a { display: inline-flex; align-items: center; min-height: 44px; }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!-- @brignano/design — transactional email
|
|
3
|
+
For notifications and auto-replies. Light only.
|
|
4
|
+
Colours are token names in double braces: run scripts/email-tokens.mjs
|
|
5
|
+
once to fill them from tokens.css. Then, per send, fill the content:
|
|
6
|
+
subject, preheader, product, heading, button_label, footer: plain text,
|
|
7
|
+
HTML-escaped by your app.
|
|
8
|
+
button_url: an absolute https:// URL, attribute-escaped.
|
|
9
|
+
body: HTML your app builds from escaped text, one
|
|
10
|
+
<p style="margin:0 0 12px;"> per paragraph. Never pass a sender's
|
|
11
|
+
raw input through unescaped.
|
|
12
|
+
Send email.txt as the text part, with body_text as plain text. -->
|
|
13
|
+
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
14
|
+
<head>
|
|
15
|
+
<meta charset="utf-8">
|
|
16
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
17
|
+
<meta name="color-scheme" content="light only">
|
|
18
|
+
<meta name="supported-color-schemes" content="light">
|
|
19
|
+
<meta name="x-apple-disable-message-reformatting">
|
|
20
|
+
<title>{{subject}}</title>
|
|
21
|
+
<style>
|
|
22
|
+
:root { color-scheme: light only; supported-color-schemes: light; }
|
|
23
|
+
body { margin: 0; padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; }
|
|
24
|
+
a { color: {{--i-ink}}; }
|
|
25
|
+
@media (max-width: 620px) {
|
|
26
|
+
.email-card { padding: 24px 20px !important; }
|
|
27
|
+
.email-outer { padding: 16px 8px !important; }
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
</head>
|
|
31
|
+
<body style="margin:0;padding:0;background-color:{{--bg}};">
|
|
32
|
+
<div style="display:none;max-height:0;overflow:hidden;mso-hide:all;">{{preheader}}​͏​͏​͏​͏</div>
|
|
33
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="{{--bg}}" style="background-color:{{--bg}};">
|
|
34
|
+
<tr>
|
|
35
|
+
<td class="email-outer" align="center" style="padding:32px 16px;">
|
|
36
|
+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:560px;">
|
|
37
|
+
<tr>
|
|
38
|
+
<td style="padding:0 4px 16px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:15px;font-weight:600;letter-spacing:-0.01em;color:{{--ink}};">{{product}}</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td class="email-card" bgcolor="{{--card}}" style="background-color:{{--card}};border:1px solid {{--line}};border-radius:12px;padding:32px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;color:{{--ink}};">
|
|
42
|
+
<h1 style="margin:0 0 12px;font-size:22px;line-height:1.3;font-weight:600;letter-spacing:-0.015em;color:{{--ink}};">{{heading}}</h1>
|
|
43
|
+
<div style="font-size:16px;line-height:1.6;color:{{--ink-soft}};">{{body}}</div>
|
|
44
|
+
<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:24px 0 0;">
|
|
45
|
+
<tr>
|
|
46
|
+
<td bgcolor="{{--i}}" style="background-color:{{--i}};border-radius:8px;">
|
|
47
|
+
<a href="{{button_url}}" style="display:inline-block;padding:12px 20px;font-size:15px;font-weight:600;line-height:20px;color:{{--on-i}};text-decoration:none;border-radius:8px;">{{button_label}}</a>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</table>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
<tr>
|
|
54
|
+
<td style="padding:16px 4px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;font-size:13px;line-height:1.5;color:{{--slate}};">{{footer}}</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</table>
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
</table>
|
|
60
|
+
</body>
|
|
61
|
+
</html>
|