commit c1b1c7f4e416ac665e8180da5149cb542ac4ff62
parent 9dbe4f87695e2d364daf7a236633690f4bb74823
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 25 Sep 2026 21:46:49 -0400
common: siteAccentVars is gone — the accent is data-accent plus customAccentVars (brand S2)
The pre-base×accent override painted one colour on every ground as an inline
--brand; nothing calls it now that the export layout renders data-accent and,
for a custom hex, customAccentVars' fitted --accent-custom-light|sepia|dark.
Its test goes with it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 3 insertions(+), 43 deletions(-)
diff --git a/common/lib/accent.test.ts b/common/lib/accent.test.ts
@@ -6,7 +6,6 @@ import {
parseAccent,
parseAccentSetting,
resolveAccent,
- siteAccentVars,
} from "./accent";
import {
ACCENTS,
@@ -115,18 +114,3 @@ test("customAccentVars: only a custom hex carries inline vars", () => {
"--accent-custom-dark": r.dark,
});
});
-
-test("siteAccentVars (legacy, until S2): a hex as before, an id through its published hex", () => {
- assert.deepEqual(siteAccentVars("#cc3366"), {
- "--brand": "#cc3366",
- "--brand-strong": "#cc3366",
- "--brand-soft": "rgba(204, 51, 102, 0.16)",
- });
- assert.deepEqual(siteAccentVars("brass"), {
- "--brand": "#e3b15c",
- "--brand-strong": "#e3b15c",
- "--brand-soft": "rgba(227, 177, 92, 0.16)",
- });
- assert.equal(siteAccentVars(undefined), null);
- assert.equal(siteAccentVars("gold"), null);
-});
diff --git a/common/lib/accent.ts b/common/lib/accent.ts
@@ -109,8 +109,9 @@ export function accentHex(input: unknown): string | undefined {
}
// The inline `<html style>` a CUSTOM-hex site needs: its fitted value per base,
-// which the token sheet's `--swatch-custom` reads. Null for a named accent or
-// no accent — those are pure CSS (`data-accent`).
+// which the token sheet's `--swatch-custom` reads (export/app/layout.tsx puts it
+// on <html> beside `data-accent="custom"`). Null for a named accent or no
+// accent — those are pure CSS (`data-accent`).
export function customAccentVars(input: unknown): Record<string, string> | null {
const r = resolveAccent(input);
if (r.id !== "custom") return null;
@@ -118,28 +119,3 @@ export function customAccentVars(input: unknown): Record<string, string> | null
for (const base of BASE_GROUND_IDS) vars[`--accent-custom-${base}`] = r[base];
return vars;
}
-
-// LEGACY (deleted by the themes slice, S2): the pre-base×accent override — one
-// colour for both modes as an inline `--brand*` on <html>, applied by
-// export/app/layout.tsx. Takes an id OR a hex: an id paints with its published
-// hex (accentHex), so a site switched to a named accent keeps rendering until
-// the token sheet learns `data-accent`. Null when there is no accent.
-// --brand the color itself (used as the main accent)
-// --brand-strong same color (hover emphasis; a single override can't go both
-// lighter-on-dark AND darker-on-light, so keep it stable)
-// --brand-soft a translucent wash for soft backgrounds (mode-agnostic)
-export function siteAccentVars(
- accent: string | undefined,
-): Record<string, string> | null {
- const hex = accentHex(accent);
- if (!hex) return null;
- const n = parseInt(hex.slice(1), 16);
- const r = (n >> 16) & 255;
- const g = (n >> 8) & 255;
- const b = n & 255;
- return {
- "--brand": hex,
- "--brand-strong": hex,
- "--brand-soft": `rgba(${r}, ${g}, ${b}, 0.16)`,
- };
-}