CMS: één bannerlijst met Locatie, SLP-thema, thema-schakelaar, documentatie

- Banner-admin: één lijst met Locatie-badge (Boven/Onder), Locatie-keuzeveld in het formulier, "Live" en "Wordt niet getoond" per locatie, aan/uit per rij
- Thema slpsoftware: Archivo, bordeaux #7A1414 (WCAG AA licht en donker), <SLP/>-logo, favicon, mail-logo; VITE_THEME in de SLP-builds (test en productie-config)
- Thema-schakelaar: eerste klik wisselt altijd het getoonde thema (klasse op <html> als bron van waarheid, gedeelde status, startscript valideert opslag) + tests
- Docs: README, docs/cms-themas.md, docs/deploy-en-testomgevingen.md, docs/privacy-gegevens-contactformulier.md, aidlc-docs (offering-banners, bug theme-toggle-first-click)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 00:14:10 +01:00
co-authored by Claude Sonnet 5.5
parent 4b09089ffb
commit 321234dfa6
28 changed files with 1081 additions and 242 deletions
+33 -1
View File
@@ -50,7 +50,7 @@ describe('resolveTheme', () => {
});
it('lists the available themes', () => {
expect(availableThemes()).toContain('asf');
expect(availableThemes()).toEqual(expect.arrayContaining(['asf', 'slpsoftware']));
});
it.each(['nope', '../asf', 'asf/../asf', '..', 'ASF', 'asf asf'])('rejects %j loudly, naming the real themes', (name) => {
@@ -99,3 +99,35 @@ describe('asf theme tokens', () => {
expect(theme).toContain('@fontsource/marcellus');
});
});
describe('slpsoftware theme', () => {
it('resolves stylesheet, favicon, logo pair and e-mail logo', () => {
const theme = resolveTheme('slpsoftware');
expect(theme.css.replaceAll('\\', '/')).toMatch(/themes\/slpsoftware\/theme\.css$/);
expect(fs.existsSync(theme.css)).toBe(true);
expect(theme.favicon !== null && fs.existsSync(theme.favicon)).toBe(true);
expect(theme.logo).not.toBeNull();
for (const f of [theme.logo!.onLight, theme.logo!.onDark, theme.logo!.mail!]) {
expect(fs.readFileSync(f).subarray(1, 4).toString()).toBe('PNG');
}
});
it('self-hosts Archivo and invents no structural token', () => {
const css = fs.readFileSync(path.resolve(__dirname, 'slpsoftware/theme.css'), 'utf-8');
const base = fs.readFileSync(path.resolve(__dirname, '../src/index.css'), 'utf-8');
const names = (src: string, block: string) => {
const m = src.match(new RegExp(`${block}\\s*\\{([^}]*)\\}`));
return new Set([...(m?.[1] ?? '').matchAll(/(--[a-z-]+)\s*:/g)].map((x) => x[1]));
};
expect(css).not.toMatch(/https?:\/\//);
expect(css).toContain('@fontsource/archivo');
for (const block of ['\\:root', '\\.dark']) {
const existing = names(base, block);
const themed = names(css, block);
for (const t of existing) expect(themed, `${block} ${t}`).toContain(t);
for (const t of themed) if (!existing.has(t)) expect(t).toMatch(/^--(slp-|font-sans$)/);
}
});
});