@brignano/design 0.6.0 → 0.8.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.
@@ -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: 600; letter-spacing: -0.02em; line-height: 1.15; }
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: 500;
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: 400; 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: 600;
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: 600; box-shadow: inset 2px 0 0 var(--i-ink); }
122
+ .article-toc a[aria-current] { color: var(--ink); font-weight: 600; }
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: 600;
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: 600; letter-spacing: -0.02em; line-height: 1.15; }
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: 600; }
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}}&#8203;&#847;&#8203;&#847;&#8203;&#847;&#8203;&#847;</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>
@@ -0,0 +1,10 @@
1
+ {{product}}
2
+
3
+ {{heading}}
4
+
5
+ {{body_text}}
6
+
7
+ {{button_label}}: {{button_url}}
8
+
9
+ --
10
+ {{footer}}
@@ -0,0 +1,65 @@
1
+ /* @brignano/design — legal page template (#70)
2
+ Privacy policy, terms and the like. Layout only: the wording belongs to
3
+ each product. Needs tokens.css and components.css (for .prose).
4
+
5
+ <main class="legal">
6
+ <header class="legal-header">
7
+ <h1>Privacy policy</h1>
8
+ <p class="legal-updated">Last updated <time datetime="2026-11-07">7 Nov 2026</time></p>
9
+ </header>
10
+ <div class="legal-body">
11
+ <nav class="legal-toc" aria-labelledby="toc-title">
12
+ <h2 class="legal-toc-title" id="toc-title">On this page</h2>
13
+ <ol><li><a href="#what-we-collect">What we collect</a></li>…</ol>
14
+ </nav>
15
+ <div class="prose"><h2 id="what-we-collect">What we collect</h2>…</div>
16
+ </div>
17
+ </main>
18
+
19
+ The contents list sits above the text until the page itself is 52rem wide,
20
+ then becomes a sticky left column (container query, so it follows the
21
+ column, not the screen). Leave the nav out on short pages. */
22
+ @layer brignano.components {
23
+ .legal {
24
+ container: legal / inline-size;
25
+ width: 100%;
26
+ max-width: calc(var(--measure) + 16rem);
27
+ margin-inline: auto;
28
+ }
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; }
31
+ .legal-updated { margin: var(--s2) 0 0; font-family: var(--mono); font-size: var(--text-sm); color: var(--slate); }
32
+
33
+ .legal-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
34
+ .legal-body > .prose :is(h2, h3) { scroll-margin-top: var(--s5); }
35
+
36
+ .legal-toc {
37
+ padding: var(--s4) var(--s5);
38
+ background: var(--card);
39
+ border: 1px solid var(--line);
40
+ border-radius: var(--radius);
41
+ }
42
+ .legal-toc-title { margin: 0 0 var(--s2); font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
43
+ .legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
44
+ .legal-toc a { color: var(--ink-soft); font-size: var(--text-sm); text-decoration: none; border-radius: var(--radius-sm); }
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; }
47
+ .legal-toc a:focus-visible { outline: 2px solid var(--i-ink); outline-offset: 2px; }
48
+
49
+ @container legal (min-width: 52rem) {
50
+ .legal-body { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--s7); }
51
+ .legal-toc {
52
+ align-self: start;
53
+ position: sticky;
54
+ top: var(--s5);
55
+ padding: 0;
56
+ background: none;
57
+ border: 0;
58
+ border-radius: 0;
59
+ }
60
+ }
61
+ @media (pointer: coarse) {
62
+ .legal-toc ol { gap: 0; }
63
+ .legal-toc a { display: flex; align-items: center; min-height: 44px; }
64
+ }
65
+ }
package/tokens.css CHANGED
@@ -226,6 +226,23 @@
226
226
  --diff-removed-ink: var(--danger-ink);
227
227
  --diff-removed-surface: var(--danger-surface);
228
228
 
229
+ /* ── Code ─────────────────────────────────────────────────────────────
230
+ Syntax colour without a rainbow (DESIGN.md §3): keywords take the
231
+ interactive cobalt ink, everything else is a step of the neutral ramp,
232
+ and weight and italics do the rest. All aliases, so code adds no hue.
233
+
234
+ --code-surface the block, inset one step below the card
235
+ --code-keyword if, return, const — cobalt ink
236
+ --code-string literals — secondary ink
237
+ --code-comment comments — slate, set in italics
238
+ --code-highlight a highlighted line — the cobalt wash */
239
+ --code-surface: var(--bg);
240
+ --code-ink: var(--ink);
241
+ --code-keyword: var(--i-ink);
242
+ --code-string: var(--ink-soft);
243
+ --code-comment: var(--slate);
244
+ --code-highlight: var(--i-surface);
245
+
229
246
  /* ── Mark — identity ──────────────────────────────────────────────────
230
247
  Inks a GRAPHIC: the trail line, the A|B monogram, a hero rule. That is
231
248
  the entire permitted use.
@@ -241,6 +258,19 @@
241
258
  --mark: light-dark(#b4741f, #e0a44f);
242
259
  --mark-ink: light-dark(#8a5714, #e0a44f); /* when the mark carries a label, 6.08:1 / 8.17:1 */
243
260
 
261
+ /* ── Product marks — one per product page ─────────────────────────────
262
+ Each product's marketing page picks one, so Driftwood, Guidebook and
263
+ Sites don't read as the same page with the words swapped (ADR-0011).
264
+ Same contract as --mark: it inks the product's graphics (its glyph,
265
+ the hero rule, the proof's stage, step numerals), never a button,
266
+ link, text or state. Hues sit away from cobalt (act), forest
267
+ (success), amber (attention) and rust (danger). All ≥ 3:1 on --bg and
268
+ --card in both themes. product-page.css maps one onto --pp-mark via
269
+ data-mark on .pp. */
270
+ --mark-teal: light-dark(#0e7c86, #4cc0cb);
271
+ --mark-violet: light-dark(#7148c9, #a990f2);
272
+ --mark-magenta: light-dark(#b1366f, #ea7fb0);
273
+
244
274
  /* ── Legacy aliases ───────────────────────────────────────────────────
245
275
  Kept so existing `life` components keep compiling. Do not use in new
246
276
  work — reach for the semantic tokens above.