/* NiLa — Tweaks app. Drives CSS variables on :root; site itself is plain HTML. */
const { useEffect } = React;
const NILA_TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"headingScale": 1,
"headingWeight": "Regular",
"bodySize": 18,
"sectionRhythm": 1,
"accent": "#5F7A6B",
"italicEmphasis": true
}/*EDITMODE-END*/;
const WEIGHT_MAP = { "Light": 400, "Regular": 500, "Medium": 600 };
function NilaTweaks() {
const [t, setTweak] = useTweaks(NILA_TWEAK_DEFAULTS);
useEffect(() => {
const r = document.documentElement;
r.style.setProperty("--display-scale", String(t.headingScale));
r.style.setProperty("--heading-weight", String(WEIGHT_MAP[t.headingWeight] || 500));
r.style.setProperty("--body-size", t.bodySize + "px");
r.style.setProperty("--section-rhythm", String(t.sectionRhythm));
r.style.setProperty("--accent", t.accent);
document.body.classList.toggle("no-emph", !t.italicEmphasis);
}, [t]);
return (
setTweak('headingScale', v)} />
setTweak('headingWeight', v)} />
setTweak('bodySize', v)} />
setTweak('sectionRhythm', v)} />
setTweak('accent', v)} />
setTweak('italicEmphasis', v)} />
);
}
ReactDOM.createRoot(document.getElementById("tweaks-root")).render();