diff --git a/brand/scripts/generate.mjs b/brand/scripts/generate.mjs index 19cb8fb..dfdbfd6 100644 --- a/brand/scripts/generate.mjs +++ b/brand/scripts/generate.mjs @@ -35,7 +35,8 @@ const paint = (t) => ({ paper: hex(t['mark-paper']), line: hex(t['mark-line']), brand: hex(t.brand), - cut: hex(t.surface), + on: hex(t['on-brand']), + cut: hex(t['mark-cut']), }); const ink = (t) => ({ word: hex(t.ink), beam: hex(t['brand-ink']) }); @@ -62,7 +63,7 @@ function lockup(id, t) { // One file that follows the browser's colour scheme, for the tab icon. function adaptiveFavicon(id) { - const roles = ['paper', 'line', 'brand', 'cut']; + const roles = ['paper', 'line', 'brand', 'on', 'cut']; const vars = Object.fromEntries(roles.map((r) => [r, `var(--${r})`])); const decl = (t) => roles.map((r) => `--${r}:${paint(t)[r]}`).join(';'); return `${marks[id].draw(vars)}`; @@ -70,7 +71,7 @@ function adaptiveFavicon(id) { function card(label, width = 1200, height = 630) { const w = wordmark(300, 262, 108, { word: hex(light['band-dark-ink']), beam: hex(light['band-dark-brand']) }); - const mark = `${marks[PRIMARY].draw(paint(light))}`; + const mark = `${marks[PRIMARY].draw({ ...paint(dark), cut: hex(light['band-dark']) })}`; return ` diff --git a/brand/src/marks.mjs b/brand/src/marks.mjs index c7dc9b1..617ba55 100644 --- a/brand/src/marks.mjs +++ b/brand/src/marks.mjs @@ -4,14 +4,16 @@ * with literal colours in exported files. * * Roles: paper (the page), line (text lines), brand (margin bar, beam, rays), - * cut (the ground behind the mark, used to separate the beam from the page). + * on (the line the beam lights), cut (the ground behind the mark, used to + * separate the beam from the page). */ export const cssPaint = { paper: 'var(--mark-paper)', line: 'var(--mark-line)', brand: 'var(--brand)', - cut: 'var(--surface)', + on: 'var(--on-brand)', + cut: 'var(--mark-cut)', }; // B9: the margin bar is 12 tall on y 22..34; the beam is 80% of it, centred @@ -21,7 +23,6 @@ const BEAM_H = BAR.h * 0.8; const BEAM_Y = BAR.y + (BAR.h - BEAM_H) / 2; const BEAM_END = 62; const BEAM_R = 1.5; -const BEAM_OPACITY = 0.28; function beamPath() { const x0 = BAR.x + BAR.w; @@ -31,15 +32,19 @@ function beamPath() { return `M${x0} ${f(BEAM_Y)} H${BEAM_END - r} A${r} ${r} 0 0 1 ${BEAM_END} ${f(BEAM_Y + r)} V${f(y1 - r)} A${r} ${r} 0 0 1 ${BEAM_END - r} ${f(y1)} H${x0} Z`; } +// The page is solid and every line is fully opaque, so the mark stays sharp at +// favicon size. The beam is outlined in the ground colour where it crosses the +// page, which separates the two whatever their contrast, and the line it lights +// is drawn over it. const b9 = (p) => [ ``, - ``, - ``, - ``, - ``, + ``, + ``, + ``, ``, - ``, + ``, + ``, ].join(''); const c2 = (p) => diff --git a/brand/src/pairs.mjs b/brand/src/pairs.mjs index e9a3385..ed3649a 100644 --- a/brand/src/pairs.mjs +++ b/brand/src/pairs.mjs @@ -38,4 +38,7 @@ export const markPairs = [ ['brand', 'ground'], ['brand', 'band-dark'], ['mark-line', 'mark-paper'], + ['mark-paper', 'ground'], + ['mark-paper', 'surface'], + ['on-brand', 'brand'], ]; diff --git a/brand/tokens.css b/brand/tokens.css index 724a6cf..7063e31 100644 --- a/brand/tokens.css +++ b/brand/tokens.css @@ -6,12 +6,12 @@ :root { color-scheme: light; - --ground: oklch(98.5% 0.003 265); - --surface: oklch(100% 0 0); - --surface-sunken: oklch(96.2% 0.006 265); - --line: oklch(90% 0.008 265); - --ink: oklch(23% 0.017 265); - --ink-muted: oklch(47% 0.017 265); + --ground: oklch(96.4% 0.008 265); + --surface: oklch(98.4% 0.005 265); + --surface-sunken: oklch(94.4% 0.009 265); + --line: oklch(87.5% 0.01 265); + --ink: oklch(20.5% 0.018 265); + --ink-muted: oklch(43% 0.018 265); --brand: oklch(55.5% 0.215 345); --on-brand: oklch(100% 0 0); @@ -24,15 +24,16 @@ --band-dark-line: oklch(32% 0.018 265); --band-dark-raised: oklch(26.5% 0.02 265); --band-dark-brand: oklch(78% 0.14 345); - --band-mist: oklch(94.5% 0.006 265); + --band-mist: oklch(92.8% 0.01 265); --hero-from: oklch(24% 0.02 265); --hero-to: oklch(50% 0.2 348); --on-hero: oklch(100% 0 0); --hero-well: oklch(0% 0 0 / 0.24); - --mark-paper: oklch(93% 0.008 265); - --mark-line: oklch(28% 0.025 265); + --mark-paper: oklch(25% 0.022 265); + --mark-line: oklch(97% 0.005 265); + --mark-cut: oklch(96.4% 0.008 265); --proven-ink: oklch(50% 0.19 27); --proven-soft: oklch(95.5% 0.028 27); @@ -65,7 +66,7 @@ --term-blue: oklch(76% 0.11 250); --term-green: oklch(80% 0.15 150); - --glass: oklch(100% 0 0 / 0.8); + --glass: oklch(96.4% 0.008 265 / 0.86); --elevation-1: 0 1px 2px 0 rgb(0 0 0 / 0.03), 0 1px 3px 1px rgb(0 0 0 / 0.04); --elevation-2: 0 1px 2px 0 rgb(0 0 0 / 0.03), 0 2px 6px 2px rgb(0 0 0 / 0.06); @@ -121,8 +122,9 @@ --band-dark-brand: oklch(78% 0.14 345); --band-mist: oklch(26% 0.014 265); - --mark-paper: oklch(32% 0.02 265); - --mark-line: oklch(93% 0.01 265); + --mark-paper: oklch(95% 0.008 265); + --mark-line: oklch(24% 0.02 265); + --mark-cut: oklch(20.5% 0.013 265); --proven-ink: oklch(80% 0.12 27); --proven-soft: oklch(30% 0.075 27); diff --git a/wrangler.jsonc b/wrangler.jsonc index 67cf0f6..2462639 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -6,4 +6,5 @@ "not_found_handling": "404-page", }, "routes": [{ "pattern": "docs.pagebeam.dev", "custom_domain": true }], + "previews": {}, }