~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The console has five palettes over one ladder of lightness

Merged chadtmiller.com asked to merge into feature/branding from chadtmiller.com/group-host:branding/palettes
.changeset/host-colours.md+2−2
@@ -2,6 +2,6 @@
default: minor
---
# A host's operator sets the colour that acts, and a cooler palette
# A host's operator sets the colour that acts, and the console's palette
`PRIMARY_COLOR` and `PRIMARY_COLOR_DARK`, each `#rgb` or `#rrggbb`, make the console's buttons, links and marks the operator's colour, with their hover, wash and link line mixed from it and the text on a button whichever of white or the page's ink reads better. Without a dark one, the light one is lifted lighter. `PALETTE=slate` sets the rest of the console, its paper, cards, lines and ink, cool rather than warm. `getBrand` answers them as `colors` and `palette`; the host refuses to start on any other colour or palette.
`PRIMARY_COLOR` and `PRIMARY_COLOR_DARK`, each `#rgb` or `#rrggbb`, make the console's buttons, links and marks the operator's colour, with their hover, wash and link line mixed from it and the text on a button whichever of white or the page's ink reads better. Without a dark one, the light one is lifted lighter. `PALETTE` sets the rest of the console, its paper, cards, lines and ink: `paper`, its own warm one, or a gray faintly tinted to go with a primary colour, `slate` (blue), `neutral` (none), `sage` (green) or `mauve` (purple). `getBrand` answers them as `colors` and `palette`; the host refuses to start on any other colour or palette. In dark, the quietest text reads more clearly on the console's wells.
crates/group-host/src/config.rs+1−1
@@ -127,7 +127,7 @@ pub struct Brand {
pub const NAME_AT_MOST: usize = 40;
/// The console's palettes, its own first.
pub const PALETTES: [&str; 2] = ["paper", "slate"];
pub const PALETTES: [&str; 5] = ["paper", "slate", "neutral", "sage", "mauve"];
impl Brand {
/// The brand `var` names, each variable left empty as unset.
crates/group-host/tests/config.rs+1−1
@@ -254,7 +254,7 @@ fn the_host_shows_itself_as_its_operator_names_it() {
}
assert_eq!(
err(&[("PALETTE", "neon")]),
"PALETTE is one of paper, slate, not neon"
"PALETTE is one of paper, slate, neutral, sage, mauve, not neon"
);
// The console's own palette is no palette at all.
assert_eq!(config(&[("PALETTE", "paper")]).unwrap().brand.palette, None);
docs/reference/config.md+1−1
@@ -74,7 +74,7 @@ the host (`getBrand`), so they are set on the host alone.
| `BACKGROUND_LIGHT_URL`, `BACKGROUND_DARK_URL` | `http` or `https` URLs of the pictures behind the card an app's request is approved on, by the reader's colour scheme, either standing in for the other when one is unset. Each is a PNG, JPEG, GIF or WebP image of at most 2 MiB, read as the logo is and served at `/img/background-light` and `/img/background-dark`. It's drawn to cover the screen, cut at its edges, under an opaque card: one about 2000 pixels wide, with nothing that matters at its edges, reads at any size |
| `PRIMARY_COLOR` | the colour of what acts on the console's pages, its buttons, links and marks, as `#rgb` or `#rrggbb`. Their hover, the soft wash behind what they mark and the line under links are mixed from it, and the text on a button is white or the page's ink, whichever reads better on it |
| `PRIMARY_COLOR_DARK` | the same in a dark colour scheme. Unset, it's `PRIMARY_COLOR` lifted to a lightness dark ink reads on |
| `PALETTE` | the console's colours for everything else, its paper, cards, lines and ink: `paper`, its own warm palette, or `slate`, a cool one |
| `PALETTE` | the console's colours for everything else, its paper, cards, lines and ink: `paper`, its own warm palette, or a gray faintly tinted toward a hue, to go with a `PRIMARY_COLOR` near it: `slate` (blue, indigo, cyan), `neutral` (no tint, any colour), `sage` (green, teal) or `mauve` (purple, violet, pink). Every palette has the same contrast between its text and its surfaces |
Whether a page is light or dark is the reader's, not the operator's: as
their device has it, or as they choose under Appearance in the menu under
lexicons/org/atgrp/internal/getBrand.json+1−1
@@ -28,7 +28,7 @@
},
"palette": {
"type": "string",
"knownValues": ["paper", "slate"],
"knownValues": ["paper", "slate", "neutral", "sage", "mauve"],
"maxLength": 64,
"description": "Which of the console's palettes its pages are in (PALETTE): its paper, cards, lines and ink; absent for the console's own, paper."
},
web/src/lib/brand.ts+9−2
@@ -26,10 +26,17 @@ export const siteLinks = (brand?: Brand): { href: string; text: string }[] =>
/** A colour as the host gives one, and as nothing else is let into a style: #rgb or #rrggbb. */
const HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
/** The ink of each palette, light then dark: the text on what acts, where white would read worse. */
/**
* The ink of each palette, light then dark: the text on what acts, where
* white would read worse. The light one is the palette's `--fg`; the dark
* one is its `--bg`, but paper's, a deeper brown.
*/
const INKS: Record<string, [string, string]> = {
paper: ['#2a2119', '#23120a'],
slate: ['#0d1424', '#080b12']
slate: ['#212327', '#121315'],
neutral: ['#232323', '#131313'],
sage: ['#212422', '#121412'],
mauve: ['#242226', '#141314']
};
/**
web/src/tokens.css+62−85
@@ -6,7 +6,34 @@
The look: warm paper rather than a white sheet, cards lifted softly off
it, and one colour that acts, terracotta, so what to press is never in
doubt. Headings take the system's rounded face where it has one: the
console loads no fonts of its own. */
console loads no fonts of its own.
The paper, cards, lines and ink are the palette's: a hue and a chroma
(`--palette-h`, `--palette-c`) over one ladder of lightness, so every
palette reads with the same contrast. Paper, the console's own, is warm
and strong; a host's other palettes (PALETTE, chosen by the page's
`<html data-palette>`) are fainter, as tinted grays are. */
:root {
--palette-h: 70;
--palette-c: 0.028;
}
[data-palette='slate'] {
--palette-h: 260;
--palette-c: 0.01;
}
[data-palette='neutral'] {
--palette-h: 0;
--palette-c: 0;
}
[data-palette='sage'] {
--palette-h: 155;
--palette-c: 0.009;
}
[data-palette='mauve'] {
--palette-h: 310;
--palette-c: 0.01;
}
:root,
[data-theme='light'] {
@@ -17,19 +44,19 @@
--red: #b9382c;
--purple: #6a4bb0;
--yellow: #94620a;
--gray: #6f6458;
--gray: oklch(0.51 calc(var(--palette-c) * 0.83) var(--palette-h));
/* Surfaces, from the page up: the paper, a card on it, a well in a card, its edges. */
--bg: #f6f1ea;
--panel: #fffdfa;
--soft: #f1e9df;
--line: #e7ddd0;
--line-strong: #d6c8b7;
--bg: oklch(0.96 calc(var(--palette-c) * 0.4) var(--palette-h));
--panel: oklch(0.995 calc(var(--palette-c) * 0.16) var(--palette-h));
--soft: oklch(0.938 calc(var(--palette-c) * 0.57) var(--palette-h));
--line: oklch(0.902 calc(var(--palette-c) * 0.74) var(--palette-h));
--line-strong: oklch(0.84 var(--palette-c) var(--palette-h));
/* Text: the body, then quieter for what is said about it, then quieter still. */
--fg: #2a2119;
--mute: #5c5045;
--faint: #6f6153;
--fg: oklch(0.256 calc(var(--palette-c) * 0.72) var(--palette-h));
--mute: oklch(0.44 calc(var(--palette-c) * 0.85) var(--palette-h));
--faint: oklch(0.502 var(--palette-c) var(--palette-h));
/* What acts: a button's fill and the text on it, its hover, a soft
wash of it behind what it marks, and the edge of what has focus. */
@@ -40,10 +67,14 @@
--link-line: #d9a593;
/* A card lifted off the paper, and a dialog lifted off the page. */
--shadow: 0 1px 2px rgb(72 48 24 / 6%), 0 6px 20px rgb(72 48 24 / 6%);
--shadow-pop: 0 2px 6px rgb(72 48 24 / 10%), 0 24px 64px rgb(72 48 24 / 22%);
--shadow:
0 1px 2px oklch(0.33 calc(var(--palette-c) * 1.8) var(--palette-h) / 6%),
0 6px 20px oklch(0.33 calc(var(--palette-c) * 1.8) var(--palette-h) / 6%);
--shadow-pop:
0 2px 6px oklch(0.33 calc(var(--palette-c) * 1.8) var(--palette-h) / 10%),
0 24px 64px oklch(0.33 calc(var(--palette-c) * 1.8) var(--palette-h) / 22%);
/* What dims the page behind a dialog. */
--scrim: rgb(42 33 25 / 35%);
--scrim: oklch(0.256 calc(var(--palette-c) * 0.72) var(--palette-h) / 35%);
/* A picture's stand-in, where there is none: its initial, on a wash of
a hue of its own (a lightness and chroma, the hue its name's). */
@@ -67,15 +98,15 @@
--red: #ff7b6b;
--purple: #b39dff;
--yellow: #e0a83a;
--gray: #a59886;
--bg: #17120e;
--panel: #201a15;
--soft: #2a221b;
--line: #362c23;
--line-strong: #4a3d31;
--fg: #f4ece2;
--mute: #b7a796;
--faint: #918271;
--gray: oklch(0.686 calc(var(--palette-c) * 1.07) var(--palette-h));
--bg: oklch(0.187 calc(var(--palette-c) * 0.41) var(--palette-h));
--panel: oklch(0.223 calc(var(--palette-c) * 0.48) var(--palette-h));
--soft: oklch(0.259 calc(var(--palette-c) * 0.63) var(--palette-h));
--line: oklch(0.301 calc(var(--palette-c) * 0.77) var(--palette-h));
--line-strong: oklch(0.37 calc(var(--palette-c) * 0.96) var(--palette-h));
--fg: oklch(0.947 calc(var(--palette-c) * 0.57) var(--palette-h));
--mute: oklch(0.737 calc(var(--palette-c) * 1.08) var(--palette-h));
--faint: oklch(0.64 calc(var(--palette-c) * 1.1) var(--palette-h));
--primary: #f08a63;
--primary-hover: #ffa07c;
--on-primary: #23120a;
@@ -97,15 +128,15 @@
--red: #ff7b6b;
--purple: #b39dff;
--yellow: #e0a83a;
--gray: #a59886;
--bg: #17120e;
--panel: #201a15;
--soft: #2a221b;
--line: #362c23;
--line-strong: #4a3d31;
--fg: #f4ece2;
--mute: #b7a796;
--faint: #918271;
--gray: oklch(0.686 calc(var(--palette-c) * 1.07) var(--palette-h));
--bg: oklch(0.187 calc(var(--palette-c) * 0.41) var(--palette-h));
--panel: oklch(0.223 calc(var(--palette-c) * 0.48) var(--palette-h));
--soft: oklch(0.259 calc(var(--palette-c) * 0.63) var(--palette-h));
--line: oklch(0.301 calc(var(--palette-c) * 0.77) var(--palette-h));
--line-strong: oklch(0.37 calc(var(--palette-c) * 0.96) var(--palette-h));
--fg: oklch(0.947 calc(var(--palette-c) * 0.57) var(--palette-h));
--mute: oklch(0.737 calc(var(--palette-c) * 1.08) var(--palette-h));
--faint: oklch(0.64 calc(var(--palette-c) * 1.1) var(--palette-h));
--primary: #f08a63;
--primary-hover: #ffa07c;
--on-primary: #23120a;
@@ -120,60 +151,6 @@
--initial-ink: 86% 0.07;
}
/* Slate, a host's other palette (PALETTE=slate): cool paper and ink in
place of warm, the same roles. Only the surfaces, text and shadows
change; what acts is the operator's colour, or terracotta. Chosen by
the page's `<html data-palette="slate">`. */
:root[data-palette='slate'] {
--gray: #64748b;
--bg: #f6f7fa;
--panel: #ffffff;
--soft: #f0f2f7;
--line: #e2e6ef;
--line-strong: #ccd3e0;
--fg: #0d1424;
--mute: #4a5568;
--faint: #5f6a79;
--danger-soft: #fef2f2;
--shadow: 0 1px 2px rgb(13 20 36 / 6%), 0 6px 20px rgb(13 20 36 / 6%);
--shadow-pop: 0 2px 6px rgb(13 20 36 / 10%), 0 24px 64px rgb(13 20 36 / 22%);
--scrim: rgb(13 20 36 / 35%);
}
@media (prefers-color-scheme: dark) {
:root[data-palette='slate']:not([data-theme='light']) {
--gray: #94a3b8;
--bg: #080b12;
--panel: #0f1419;
--soft: #161d27;
--line: #1e293b;
--line-strong: #2a3a4e;
--fg: #e2e8f0;
--mute: #94a3b8;
--faint: #7c8ba1;
--danger-soft: #1c1117;
--shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 20px rgb(0 0 0 / 30%);
--shadow-pop: 0 2px 6px rgb(0 0 0 / 45%), 0 24px 64px rgb(0 0 0 / 60%);
--scrim: rgb(0 0 0 / 60%);
}
}
:root[data-palette='slate'][data-theme='dark'] {
--gray: #94a3b8;
--bg: #080b12;
--panel: #0f1419;
--soft: #161d27;
--line: #1e293b;
--line-strong: #2a3a4e;
--fg: #e2e8f0;
--mute: #94a3b8;
--faint: #7c8ba1;
--danger-soft: #1c1117;
--shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 20px rgb(0 0 0 / 30%);
--shadow-pop: 0 2px 6px rgb(0 0 0 / 45%), 0 24px 64px rgb(0 0 0 / 60%);
--scrim: rgb(0 0 0 / 60%);
}
:root {
--border: 1px solid var(--line);