Adopt the new palette; square corners, superellipse buttons
The theme defaults (light and dark) come from the 16-color grid, kept as PALETTE in src/lib/color.ts; every text pair passes the admin's 4.5:1 check. Nothing is rounded any more except buttons, which share one btn utility (Poppins Bold, a superellipse corner where the browser has corner-shape) and true dots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ecdcd4ec37
commit
d81f7bd856
62 changed files with 416 additions and 384 deletions
|
|
@ -32,23 +32,44 @@ export function readableOn(color: string): string {
|
|||
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4
|
||||
}
|
||||
const lum = 0.2126 * channel(0) + 0.7152 * channel(2) + 0.0722 * channel(4)
|
||||
const INK_LUM = 0.0161 // #04262e
|
||||
const INK_LUM = 0.0041 // #001011
|
||||
const onWhite = 1.05 / (lum + 0.05)
|
||||
const onInk = (lum + 0.05) / (INK_LUM + 0.05)
|
||||
return onWhite >= onInk ? '#ffffff' : '#04262e'
|
||||
return onWhite >= onInk ? '#ffffff' : '#001011'
|
||||
}
|
||||
|
||||
/* ── The site's accents ──────────────────────────────────────────
|
||||
BRAND is the teal every page uses as its accent; it's the button
|
||||
token, so the admin's palette (Site settings → Colors) reaches it.
|
||||
ACCENTS are the other section colors a page may give a band, all
|
||||
from the same family and all readable as text on white and on the
|
||||
tints (5:1 or better). Use these rather than a new hex. */
|
||||
ACCENTS are the other section colors a page may give a band: the
|
||||
palette's dark shades, all readable as text on its light ones
|
||||
(7:1 or better). Use these rather than a new hex. */
|
||||
export const BRAND = 'var(--color-action)'
|
||||
|
||||
export const ACCENTS = {
|
||||
teal: BRAND,
|
||||
deep: '#004c52',
|
||||
green: '#56733f',
|
||||
mint: '#1b6f5e',
|
||||
green: '#00521b',
|
||||
olive: '#27371b',
|
||||
}
|
||||
|
||||
/* ── The palette ─────────────────────────────────────────────────
|
||||
The site's 16 colors: four families, each a column of the grid
|
||||
(its primary first). The theme tokens above are chosen from these;
|
||||
so is anything drawn from the palette as data (a person's initials
|
||||
tile, the page background, the admin home's sections). Light
|
||||
shades are for fills behind text, dark shades for text and fills
|
||||
under white text; the primaries are for decoration only (#008fa8
|
||||
is 3.8:1 on the page, #88b668 2.3:1). */
|
||||
export const PALETTE = {
|
||||
teal: ['#008fa8', '#004552', '#5ce7ff', '#c2f6ff'],
|
||||
green: ['#88b668', '#dfebd6', '#aac992', '#27371b'],
|
||||
mint: ['#fcfffd', '#c2ffd6', '#00b83d', '#00521b'],
|
||||
ink: ['#001011', '#004c52', '#5cf4ff', '#c2fbff'],
|
||||
} as const
|
||||
|
||||
/* Fills that take the page's ink text (#001011, 15:1 or better) and
|
||||
fills that take white text (9:1 or better), for things colored
|
||||
from the palette by data, like an initials tile. */
|
||||
export const PALETTE_LIGHT = ['#c2f6ff', '#dfebd6', '#c2ffd6', '#c2fbff', '#aac992', '#5ce7ff'] as const
|
||||
export const PALETTE_DARK = ['#004552', '#27371b', '#00521b', '#004c52'] as const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue