← ClaudeAtlas

ground-inversion-guardlisted

Keep colour contrast and hierarchy intact when a page flips between light ("paper") and dark ("obsidian") grounds — dark hero on a light site, inverted footer, dark-mode toggle, alternating sections, cards on a dark band. Accent tokens are re-mapped per ground (a deep green *fill* on paper becomes a bright mint *text* colour on dark) instead of being reused as-is, and every text/background pair is checked against WCAG AAA. Use this whenever generating or reviewing CSS/Tailwind/design tokens that involve a dark section, `.dark`/`.inverted` modifier, `prefers- color-scheme`, theme variables, badges/links/buttons on coloured backgrounds, or when the user says "dark mode", "invert this section", "the green looks muddy on dark", "make sure it's accessible", or "contrast".
fernandokylas/editorial-web-craft · ★ 2 · Web & Frontend · score 73
Install: claude install-skill fernandokylas/editorial-web-craft
# Ground Inversion Guard Colour tokens aren't ground-independent. A deep emerald that reads as authoritative on cream turns into unreadable mud on near-black; a soft grey that's fine as muted text on white vanishes on obsidian. The amateur move is to define `--accent: #0e6245` once and use it everywhere. The professional move is to treat each ground as its own contrast system and *mutate* the tokens when the ground flips — same hue family, different job and luminance. Two rules carry most of the weight: 1. **On light grounds, accents are fills; on dark grounds, accents are text.** A saturated dark colour makes a great background box on paper but a poor text colour on obsidian. Flip its role: keep a *deep* version for background boxes and introduce a *bright* version for typography. 2. **Every pair is measured, not eyeballed.** Ship nothing below 7:1 for body text (AAA), 4.5:1 for large text (≥24px, or ≥19px bold), 3:1 for icons, borders, and UI components. The bundled script does the arithmetic. ## The token contract Each ground defines the *same set* of variables so components never change; only the values move. Use these as the starting palette: ```css /* --- Paper ground (root) --- */ :root { --bg-main: #fcfbf9; /* soft warm white; #ffffff is fine for product UI */ --text-main: #1a1a1a; /* 16.8:1 — off-black, no glare */ --text-muted: #555555; /* 7.2:1 — AAA; #666 only reaches AA on paper */ --accent-solid: #0e6245; /* deep green: B