Inputs (deploy_test, deploy_production, deploy_asf_test) en config-outputs ongewijzigd. Branch protection: vereiste check publish-test (pull_request) moet publish-sls-test (pull_request) worden. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
41 lines
2.8 KiB
Markdown
41 lines
2.8 KiB
Markdown
# 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-sls-test en publish-sls-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.
|