build: updated compiled CSS + palette-test.html demo page

This commit is contained in:
Vigilio Desto 2026-04-10 19:44:11 +02:00
parent ea51dbd7cf
commit d9641b0485
Signed by: vigilio
GPG key ID: 159D6AD58C8E55E9
2 changed files with 234 additions and 1 deletions

File diff suppressed because one or more lines are too long

233
static/palette-test.html Normal file
View file

@ -0,0 +1,233 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ASW Palette Explorer</title>
<link rel="stylesheet" href="https://unpkg.com/open-props/open-props.min.css">
<style>
* { box-sizing: border-box; margin: 0; }
body {
font-family: system-ui, sans-serif;
background: oklch(12% 0.01 250);
color: oklch(85% 0.02 250);
padding: 2rem;
max-width: 900px;
margin: 0 auto;
}
h1 { font-size: 1.5rem; font-weight: 400; margin-bottom: 0.5rem; }
h2 { font-size: 1.1rem; font-weight: 400; margin: 2rem 0 1rem; color: oklch(70% 0.02 250); }
p { line-height: 1.6; margin-bottom: 1rem; color: oklch(75% 0.02 250); }
code { font-family: monospace; background: oklch(18% 0.01 250); padding: 0.15em 0.4em; border-radius: 3px; }
/* ── Controls ─────────────────────────── */
.controls {
display: flex; gap: 1.5rem; flex-wrap: wrap;
padding: 1.5rem; margin: 1.5rem 0;
background: oklch(16% 0.01 250);
border-radius: 8px;
}
.controls label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.controls input[type="range"] { width: 200px; }
.controls .val { font-family: monospace; font-size: 0.8rem; color: oklch(65% 0.02 250); }
/* ── Palette strip ────────────────────── */
.palette {
display: grid;
grid-template-columns: repeat(16, 1fr);
gap: 2px;
margin: 1rem 0;
}
.swatch {
aspect-ratio: 1;
border-radius: 4px;
display: flex;
align-items: end;
justify-content: center;
font-size: 0.65rem;
font-family: monospace;
padding: 0.2rem;
}
.swatch.light-text { color: oklch(95% 0.01 0); }
.swatch.dark-text { color: oklch(15% 0.01 0); }
/* ── Live demo ────────────────────────── */
.demo {
padding: 2rem;
border-radius: 8px;
margin: 1.5rem 0;
}
.demo h3 { font-size: 1.2rem; font-weight: 400; margin-bottom: 0.75rem; }
.demo p { margin-bottom: 0.75rem; }
.demo a { text-decoration: underline; text-underline-offset: 2px; }
.demo .muted { opacity: 0.7; font-size: 0.9rem; }
.demo .accent-pill {
display: inline-block;
padding: 0.3em 0.8em;
border-radius: 100px;
font-size: 0.85rem;
margin: 0.25rem;
}
/* ── Ludo's dark mode spec ─────────────── */
.ludo-spec {
margin: 2rem 0;
padding: 1.5rem;
border: 1px solid oklch(25% 0.02 250);
border-radius: 8px;
}
.ludo-spec dt { font-weight: 500; margin-top: 0.75rem; }
.ludo-spec dd { margin-left: 0; color: oklch(70% 0.02 250); }
</style>
</head>
<body>
<h1>ASW Palette Explorer</h1>
<p>Open Props gives you 16 oklch steps from one <code>--palette-hue</code> value. Drag the slider — the whole palette shifts.</p>
<div class="controls">
<label>
Hue <span class="val" id="hue-val">250</span>
<input type="range" id="hue" min="0" max="360" value="250">
</label>
<label>
Chroma <span class="val" id="chroma-val">0.15</span>
<input type="range" id="chroma" min="0" max="40" value="15">
</label>
<label>
Hue rotate <span class="val" id="rotate-val">0</span>
<input type="range" id="rotate" min="0" max="30" value="0">
</label>
</div>
<h2>The 16 steps — <code>--color-1</code> to <code>--color-16</code></h2>
<div class="palette" id="palette"></div>
<h2>Your dark mode mapped to this palette</h2>
<div class="demo" id="demo">
<h3>On the Craft of Invisible Systems</h3>
<p>There is a particular quality to systems that work well. They recede. The thermostat that holds a room at precisely the right temperature.</p>
<p><a href="#" id="demo-link">A link in blue — the OG HTML blue</a></p>
<p class="muted">Muted secondary text for metadata and captions.</p>
<div style="margin-top: 1rem;">
<span class="accent-pill" id="pill-ok">OK</span>
<span class="accent-pill" id="pill-warn">Warn</span>
<span class="accent-pill" id="pill-error">Error</span>
<span class="accent-pill" id="pill-info">Info</span>
</div>
</div>
<h2>What this means for ASW</h2>
<dl class="ludo-spec">
<dt><code>--surface</code> = <code>--color-16</code></dt>
<dd>10% lightness — body background. Currently <code>--gray-12</code> (#030507)</dd>
<dt><code>--surface-1</code> = <code>--color-15</code></dt>
<dd>16% lightness — cards, sidebars</dd>
<dt><code>--text</code> = <code>--color-3</code></dt>
<dd>93% lightness — primary text, easy on the eyes (not pure white)</dd>
<dt><code>--text-2</code> = <code>--color-5</code></dt>
<dd>80% lightness — secondary text</dd>
<dt><code>--text-3</code> = <code>--color-7</code></dt>
<dd>66% lightness — muted text</dd>
<dt><code>--link</code> = blue at hue 250, chroma pushed</dt>
<dd>Links stay blue regardless of palette hue — the OG HTML convention</dd>
<dt><code>--accent</code> = <code>--color-8</code></dt>
<dd>58% lightness, peak chroma — the most vivid step in the palette</dd>
</dl>
<p>Change the hue above: 250 = indigo (current), 220 = blue, 145 = green, 45 = amber, 0 = red, 330 = pink. The whole surface/text system shifts. Links stay blue.</p>
<script>
// oklch palette definition (matching Open Props)
const steps = [
{ l: 98, cm: 0.03 }, // 1
{ l: 97, cm: 0.06 }, // 2
{ l: 93, cm: 0.10 }, // 3
{ l: 93, cm: 0.12 }, // 4 (corrected: OP uses 84 but let's be accurate)
{ l: 80, cm: 0.16 }, // 5
{ l: 71, cm: 0.19 }, // 6
{ l: 66, cm: 0.20 }, // 7
{ l: 58, cm: 0.21 }, // 8 ← peak chroma
{ l: 53, cm: 0.20 }, // 9
{ l: 49, cm: 0.19 }, // 10
{ l: 42, cm: 0.17 }, // 11
{ l: 35, cm: 0.15 }, // 12
{ l: 27, cm: 0.12 }, // 13
{ l: 20, cm: 0.09 }, // 14
{ l: 16, cm: 0.07 }, // 15
{ l: 10, cm: 0.05 }, // 16
];
// Fix step 4 to match actual OP
steps[3].l = 84;
function color(step, hue, chroma, rotate) {
const h = hue + rotate * (step - 1);
const c = chroma * steps[step - 1].cm;
const l = steps[step - 1].l;
return `oklch(${l}% ${c.toFixed(4)} ${h})`;
}
function update() {
const hue = +document.getElementById('hue').value;
const chroma = +document.getElementById('chroma').value / 100;
const rotate = +document.getElementById('rotate').value;
document.getElementById('hue-val').textContent = hue;
document.getElementById('chroma-val').textContent = chroma.toFixed(2);
document.getElementById('rotate-val').textContent = rotate;
// Palette strip
const pal = document.getElementById('palette');
pal.innerHTML = '';
for (let i = 1; i <= 16; i++) {
const c = color(i, hue, chroma, rotate);
const div = document.createElement('div');
div.className = 'swatch ' + (i <= 8 ? 'dark-text' : 'light-text');
div.style.background = c;
div.textContent = i;
pal.appendChild(div);
}
// Demo: Ludo's dark mode
const demo = document.getElementById('demo');
const surface = color(16, hue, chroma, rotate);
const text = color(3, hue, chroma, rotate);
const textMuted = color(7, hue, chroma, rotate);
// Links stay blue — fixed hue 250
const link = `oklch(65% 0.15 250)`;
demo.style.background = surface;
demo.style.color = text;
demo.querySelector('h3').style.color = color(2, hue, chroma, rotate);
demo.querySelector('.muted').style.color = textMuted;
demo.querySelector('a').style.color = link;
// State pills — these use FIXED hues, not the palette hue
const pill = (id, h) => {
const el = document.getElementById(id);
el.style.background = `oklch(25% 0.04 ${h})`;
el.style.color = `oklch(75% 0.15 ${h})`;
};
pill('pill-ok', 145);
pill('pill-warn', 80);
pill('pill-error', 25);
pill('pill-info', 250);
}
document.getElementById('hue').addEventListener('input', update);
document.getElementById('chroma').addEventListener('input', update);
document.getElementById('rotate').addEventListener('input', update);
update();
</script>
</body>
</html>