feat(variants): copy per-client assets (fonts/css/images) automatically in build.php

The definitions dir (private variants repo) now has a standard layout per
client: <client>.json + <client>/files/... + <client>/css/variant.css.
build.php copies <client>/ into the generated theme folder, so a
client-specific font or css is part of the variant by default.
README updated accordingly.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-16 21:09:02 +01:00
commit dd8714b6a0

View file

@ -48,9 +48,13 @@ LimeSurvey only knows its core font packages (`application/config/fonts.php`),
so a theme cannot register a `font-*` package itself. Instead a variant ships
its own font files and css:
1. Put the font files in the variant's `files/fonts/` (e.g. `my-custom-font.woff2`).
2. Create `css/variant.css` in the variant with the `@font-face` and the body
class rule (the selected font is applied as `font-<value>` on `<body>`):
1. Put the font files in the client folder of the PRIVATE variants repo:
`<client>_vanilla/files/fonts/` (e.g. `my-custom-font.woff2`). This folder
is standard per client and is copied into the generated theme automatically
by `build.php` (together with e.g. `files/*.png` logos and `css/variant.css`).
2. Create `css/variant.css` in that same client folder with the `@font-face`
and the body class rule (the selected font is applied as `font-<value>` on
`<body>`):
```css
@font-face {
font-family: 'My Custom Font';
@ -73,7 +77,9 @@ its own font files and css:
"Custom (this theme)" optgroup of the font dropdown (`data-font-package`
stays `websafe`, so no nonexistent package is requested — the real font is
loaded by the variant's own css).
4. Run `php variants/build.php <client>` and upload/reset as usual.
4. Run `php variants/build.php <client> <definitions-dir>` (or set
RESPONDAGE_VARIANTS_DIR) and upload/reset as usual. The `<client>/` assets
folder from the definitions dir is copied into `../<client>/` automatically.
## Client variants (house styles) without code duplication