| Filename | Latest commit message | Latest commit date |
|---|---|---|
"CSS radius in px or rem, e.g. 5px" instead of the longer wording. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> |
||
| .. | ||
| example/respondage_respondage | ||
| build.php | ||
| build_all.sh | ||
| document_options.php | ||
| export_options.php | ||
| export_public.sh | ||
| option_formats.php | ||
| README.md | ||
variants/ — client variant tooling
This folder holds the GENERIC, public tooling for building thin client
variants of this theme (see the main README.md, section "Client variants
(house styles) without code duplication" for the full concepts). Only the
confidential parts are gitignored and stay in the private variants repo:
variants/*.json (client definitions), variants/leak-patterns.txt,
variants/tests/.
Files
build.php— build ONE variant:php variants/build.php <client> <definitions-dir>. Generates../<client>/config.xmlfrom the motherconfig.xml+ the client json (see the header comment ofbuild.phpfor all rules: unknown option keys fail loudly,files/preview.svgis added only at first creation and never overwritten, warning when preview.png equals the mother's, NEW mother option keys are auto-added to the json as""with a_formatshint).build_all.sh— build/rebuild ALL variants in one go:bash variants/build_all.sh <definitions-dir>builds only jsons with NO variant folder yet;bash variants/build_all.sh --rebuild <definitions-dir>rebuilds only existing ones; skipped jsons are listed at the end.export_options.php— generate a client json from the CURRENTLY SAVED theme options in the LimeSurvey UI (global or per survey):php variants/export_options.php <client> --global|--sid <id> [--title ...] [--definitions-dir ...] [--force].document_options.php— refresh the_formatshints in every json after a mother config.xml change:php variants/document_options.php <definitions-dir> [--check].option_formats.php— shared helper (option key → value-format hint), used bybuild.phpanddocument_options.php.export_public.sh— build the checked public zip (leak check + external-host check + stale-css check); aborts on any violation.example/— public example output of a variant build (respondage_respondage).
The variant definition json (<client>.json)
Reference structure (all 109 option keys of the mother config.xml are listed, so it is visible what CAN be set per variant):
{
"name": "respondage_client",
"title": "Client LimeSurvey theme",
"description": "<strong>Client theme, based on Vanilla Respondage</strong><br>Thin variant of vanilla_respondage: only the house-style option values (colors, fonts, font sizes/weights/colors, logo files) differ. All views, CSS and JS are inherited from the mother theme.",
"_note": "All option keys of the mother config.xml are listed. An empty value (\"\") means: inherit the default from vanilla_respondage (build.php skips empty values). Keys marked HOUSE-STYLE in config.xml are the per-client house-style values; the rest are structural and normally left empty.",
"options": {
"font": "my_custom_font",
"fontsize": "18px",
"primarycolor": "#123456",
"navbarfontcolor": "other",
"navbarfontcolorcustom": "#123456",
"brandlogofile": "./files/client-logo.png",
"...": ""
},
"_formats": {
"font": "font value slug, e.g. \"inter\"",
"primarycolor": "hex color, e.g. #123456",
"navbarfontcolor": "chooser mode: one of default|defaultbackgroundcolor|color1|color2|color3|other — when 'other', put the hex in navbarfontcolorcustom",
"...": ""
},
"files_add": { "css": ["css/variant.css"], "js": [] },
"fontOptions": [ { "value": "my_custom_font", "label": "My Custom Font" } ]
}
namemust equal the file name and the generated folder (respondage_<client>).options: an empty value ("") means "inherit the mother default" and is skipped by the build. Fill in the house-style values you know; leave the rest empty. Legacy keys (e.g.logotopmargin,<pos>logo, raw hex in a chooser option,400|700font weights) are still accepted and migrated bybuild.php. Value formats per key are documented in_formats(regenerate withdocument_options.php)._formats: documentation only — never read by the build or the drift check.files_add: extra files the variant ships (appended to the<files>list).fontOptions: custom fonts appended to the "Custom (this theme)" optgroup; the font files +@font-face+ generic.font-<value>rule live in the<client>/asset folder (files/fonts/,css/variant.css).- The whole
<definitions-dir>/<client>/asset folder (logos, fonts, css,files/preview.svg) is copied into the generated theme bybuild.php.
Workflow
- Create/edit
<client>.json+<client>/assets (or generate the json from saved UI options withexport_options.php). - Build:
php variants/build.php <client> <definitions-dir>(orbash variants/build_all.sh ...for all). - Deploy
../<client>/toupload/themes/survey/and reset the theme in the LimeSurvey admin (Theme options → Reset), thenflushassets+ Ctrl+F5. - Rebuild after every json/config.xml change (
build_all.sh --rebuild); a stale variant folder does not match its definitions.