feat(variants): json definitions may list ALL option keys — empty value means inherit the mother default

- build.php: an option value of "" or null in the variant json is skipped, so
  it inherits the default from vanilla_respondage's config.xml (previously an
  empty value would have been written as-is). The legacy logotopmargin
  migration now also ignores an empty value, and the fontOptions default-font
  rule treats "font": "" as unset. Header comment documents the convention.
- Regenerated the three local variant definitions (variants/respondage_defensie,
  respondage_erasmus, respondage_respondage — gitignored) with all 109 option
  keys: known values filled in (legacy keys modernized: logotopmargin ->
  per-logo keys, brandlogo off -> brandlogofile off, hex chooser values ->
  mode "other" + *custom), everything else "". respondage_respondage's known
  values were derived from the tracked example output config.xml.
- README build process documents the all-keys/empty-inherits convention.

Verified in a /tmp sandbox: all three jsons build cleanly (4 built, 0 failed);
defensie/erasmus/respondage configs carry the known values and inherit the
mother defaults for empty keys (e.g. erasmus centerlogofile stays
./files/logo.png, centerlogotopmargin 30); php -l clean; export exit 0.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-30 12:47:35 +01:00
commit 28f6b0f9c1

View file

@ -381,9 +381,18 @@ the variant's `preview.png` is identical to the mother's.
never hardcode house-style values in shared files (`views/`, `css/`,
`scripts/`), because those are inherited by all variants.
2. In the private variants repo, create `variants/<client>.json` with the
variant name/title/description and only the house-style option keys with the
client values, plus a `<client>/` asset folder (logos, `files/fonts/`,
`css/variant.css`, `files/preview.svg`/`preview.png`).
variant name/title/description and the option values, plus a `<client>/`
asset folder (logos, `files/fonts/`, `css/variant.css`,
`files/preview.svg`/`preview.png`). The json may list **ALL option keys**
of the mother `config.xml` (109 at the time of writing) so it is visible what
CAN be set per variant: an **empty value (`""`) means "inherit the default
from vanilla_respondage"** — `build.php` skips empty values, so only the
filled-in keys are written into the variant config. Fill in the house-style
values you know (keys marked `HOUSE-STYLE` in `config.xml`: colors, fonts,
font sizes/colors/weights, logo files/margins, background image/color);
leave the rest empty. Legacy keys (e.g. `logotopmargin`, `<pos>logo`,
hex values in chooser options) are still accepted and migrated by
`build.php`, but writing the new-model keys directly is recommended.
Naming convention: folder/json `respondage_<client>`, metadata `name`
`respondage_<client>` (must equal the file name), `title`
`"<Client> LimeSurvey theme"` (e.g. `respondage_acme` →