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:
@@ -0,0 +1,40 @@
|
||||
# CMS-thema's per site
|
||||
|
||||
De admin (frontend) kan bij het bouwen een eigen uiterlijk krijgen. De standaardadmin blijft ongewijzigd als er geen thema is gekozen.
|
||||
|
||||
## Hoe het werkt
|
||||
|
||||
| Onderdeel | Waar | Gedrag |
|
||||
|---|---|---|
|
||||
| Keuze | omgevingsvariabele `VITE_THEME` bij `pnpm build` | Leeg of afwezig = standaardadmin. Een onbekende naam laat de build falen (geen stille terugval). |
|
||||
| Beschikbare thema's | mappen in `frontend/themes/` met een `theme.css` | `asf`, `slpsoftware` |
|
||||
| Kleuren, radius, lettertype | `themes/<naam>/theme.css` | Alleen design-tokens (CSS-variabelen), geen layout- of componentwijzigingen. Lettertypen zelf gehost via `@fontsource` (de admin-CSP staat alleen `font-src 'self'` toe). |
|
||||
| Favicon | `themes/<naam>/favicon.png` | Wordt als `favicon-theme.png` uitgeleverd en in de pagina gelinkt. |
|
||||
| Logo | `themes/<naam>/logo-on-light.png` en `logo-on-dark.png` | Beide of geen. Getoond via `BrandLogo` (licht/donker). Zonder logo valt de admin terug op de applicatienaam. |
|
||||
| Mail-logo | `themes/<naam>/logo-mail.png` (optioneel) | Logo op een witte afgeronde badge voor e-mailkoppen. |
|
||||
| Titel | `VITE_APP_TITLE` | Zet alleen `document.title`. |
|
||||
| Taal | `VITE_DEFAULT_LANGUAGE` (`nl`/`en`) | Standaardtaal zolang de gebruiker nog niets koos. |
|
||||
|
||||
Code: `frontend/themes/resolveTheme.ts` (met tests), `frontend/vite.config.ts`, `frontend/src/lib/brand.ts`, `frontend/src/components/layout/BrandLogo.tsx`.
|
||||
|
||||
## Welke site gebruikt welk thema (CI)
|
||||
|
||||
| Site | Build | Thema |
|
||||
|---|---|---|
|
||||
| SLP Software | publish-test en publish-production in `.gitea/workflows/continuous_integration.yaml` | `slpsoftware`, titel `SLP Software` |
|
||||
| Andrea Slop Fotografie | stap "Build admin frontend (ASF theme)" | `asf`, taal `nl` |
|
||||
| Andere hosts | geen `VITE_THEME` | standaardadmin |
|
||||
|
||||
## Thema `slpsoftware`
|
||||
|
||||
- **Merk:** tekst `<SLP/>` in Archivo, bordeaux `#7A1414` (website-variant B).
|
||||
- **Bestanden:** `theme.css` (tokens licht en donker), `logo-on-light.png`, `logo-on-dark.png`, `logo-mail.png`, `logo.svg` (alleen bron/archief), `favicon.png` (kopie van `icon-192.png` van de SLP-website; dat toont "/S" op bordeaux, niet `<SLP/>`).
|
||||
- **Contrast (WCAG AA):** alle paren in `theme.css` halen AA in licht en donker; de uitkomsten staan in het commentaarblok bovenin het bestand en zijn te herberekenen met `contrast.py`. Laagste waarde: primary op card in donker, 4,93.
|
||||
- **Logo opnieuw maken:** `python make-logo.py` in `frontend/themes/slpsoftware/` (Pillow en fonttools; lettertype uit `node_modules/@fontsource/archivo`, gewicht 800).
|
||||
- **Donker:** lichter bordeaux als primary (`#e0646c`) zodat tekst en randen AA houden.
|
||||
|
||||
## Nieuw thema toevoegen
|
||||
|
||||
1. Map `frontend/themes/<naam>/` met minstens `theme.css`; optioneel favicon en logo-paar.
|
||||
2. Tests in `frontend/themes/resolveTheme.test.ts` uitbreiden.
|
||||
3. `VITE_THEME: <naam>` zetten in de build-stap van de betreffende site in de CI.
|
||||
Reference in New Issue
Block a user