feat(options): Fonts tab becomes 'Fonts and colors' with per-element font+color combos (Prompt U)

Tab 'Fonts' is renamed to 'Fonts and colors' and gets a dedicated layout:
top row (col 1: font, fontcolor, fontsize; col 2: primarycolor +
new secondarycolor; col 3 empty), an hr, then one combo row per element
(header, progressbar, questiontitle, answers, grouptitle,
groupdescription, buttons) with col 1 = existing <el>font fontselect,
col 2 = new <el>textcolor dropdown (default|primary|secondary|other),
col 3 = new <el>textcolorcustom colorpicker, visible only when mode is
'other' (parent show-value via aShowIfValues, server-side initial d-none,
options.js updateVisibilityByParent/updateChild now handle select parents,
multi-value aware; font's self-parent removed from config.xml).
config.xml: fontcolor/primarycolor moved from Colors to Fonts (retitled
'Default font color (body text)' / 'Primary color'), secondarycolor added
(default #888888), 14 per-element color keys added with dropdownoptions.
Views emit the per-element color as inline style (default->fontcolor,
primary->primarycolor, secondary->secondarycolor, other->custom picker).
Colors tab now only holds sliderhandlecolor + privacybackgroundcolor
(final Colors layout = Prompt T, still open).
Variants rebuilt (defensie, erasmus, example respondage_respondage) —
no unknown-key failures; theme reset in LS-admin still owner action.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-25 11:51:57 +01:00
commit 9716aac4ee

View file

@ -194,13 +194,17 @@
<!-- Various colors
HOUSE-STYLE: ALL colorpickers in this section (header, navbar menu,
primary, font, slider, progressbar, privacy) are house-style colors
and are set per variant via variants/<client>.json -->
slider, progressbar, privacy) are house-style colors and are set per
variant via variants/<client>.json.
NOTE (Prompt U): primarycolor, fontcolor and the new secondarycolor
moved to the "Fonts" category (they live in the "Fonts and colors"
tab now); header/navbar/progressbar colors are pulled into the
"Top of the page" tab by options.twig. What remains here in the
Colors pane: sliderhandlecolor + privacybackgroundcolor (final
Colors layout = Prompt T, still open). -->
<!-- Various colors -->
<headerbackgroundcolor type="colorpicker" category="Colors" width="12" title="Header background color" options="on|off" optionlabels="Yes|No">#eeeeee</headerbackgroundcolor>
<navbarfontcolor type="colorpicker" category="Colors" width="12" title="Menu item text color in the top bar (should contrast with the header background color)" options="on|off" optionlabels="Yes|No">#444444</navbarfontcolor>
<primarycolor type="colorpicker" category="Colors" width="12" title="Primary color (for buttons)" options="on|off" optionlabels="Yes|No">#5e1c64</primarycolor>
<fontcolor type="colorpicker" category="Colors" width="12" title="Base font color" options="on|off" optionlabels="Yes|No">#444444</fontcolor>
<sliderhandlecolor type="colorpicker" category="Colors" width="12" title="Slider handle color" options="on|off" optionlabels="Yes|No">#5e1c64</sliderhandlecolor>
<progressbarbackgroundcolor type="colorpicker" category="Colors" width="12" title="Progress bar background color" options="on|off" optionlabels="Yes|No">#eeeeee</progressbarbackgroundcolor>
<progressbarcolor type="colorpicker" category="Colors" width="12" title="Progress bar color" options="on|off" optionlabels="Yes|No">#5e1c64</progressbarcolor>
@ -245,7 +249,7 @@
+ the "Bundled open source fonts" optgroup below). -->
<!-- fonts -->
<!-- When adding new items, please keep fonts ordered alphabetically -->
<font type="dropdown" category="Fonts" width="4" title="Default font (body text)" parent="font">noto_sans
<font type="dropdown" category="Fonts" width="4" title="Default font (body text)">noto_sans
<dropdownoptions>
<!-- Open source fonts bundled with this theme itself: font files in files/fonts/, @font-face + generic .font-<value> rules in css/fonts.css. See files/fonts/README.md (English) for how to add your own font here. -->
<optgroup label="Bundled open source fonts">
@ -275,22 +279,92 @@
</optgroup>
</dropdownoptions>
</font>
<!-- Per-element font overrides (type "fontselect", rendered by options/options.twig):
each dropdown offers the SAME choices as the base "font" dropdown above
(bundled + variant-custom + browser fonts), plus a first option
"Same as base font" (value "base" = no extra class, the element simply
inherits the body font). The chosen value is applied as the class
font-<value> on the element in the views (nav_bar, progress_bar,
question_text_container, answers, help, group_name, group_desc,
navigator). Default "base" for all of them. -->
<headerfont type="fontselect" category="Fonts" width="4" title="Font for the header / top menu">base</headerfont>
<progressbarfont type="fontselect" category="Fonts" width="4" title="Font for the progress bar">base</progressbarfont>
<questiontitlefont type="fontselect" category="Fonts" width="4" title="Font for question titles">base</questiontitlefont>
<answersfont type="fontselect" category="Fonts" width="4" title="Font for answers and help texts">base</answersfont>
<grouptitlefont type="fontselect" category="Fonts" width="4" title="Font for group titles">base</grouptitlefont>
<groupdescriptionfont type="fontselect" category="Fonts" width="4" title="Font for group descriptions">base</groupdescriptionfont>
<buttonsfont type="fontselect" category="Fonts" width="4" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
<!-- Prompt U: the "Fonts" tab is rendered as "Fonts and colors" with a special
layout (options.twig): TOP ROW column 1 = font, fontcolor, fontsize;
column 2 = primarycolor, secondarycolor (both moved here from the Colors
category); then an <hr>; then per-element combo rows (fontselect +
textcolor dropdown + conditional textcolorcustom picker); then the
size/weight options below. HOUSE-STYLE: fontcolor, primarycolor and
secondarycolor are set per variant via variants/<client>.json. -->
<fontcolor type="colorpicker" category="Fonts" width="12" title="Default font color (body text)" options="on|off" optionlabels="Yes|No">#444444</fontcolor>
<fontsize type="buttons" category="Fonts" width="12" title="Base font size" options="14px|16px|18px|20px" optionlabels="Small (14px)|Normal (16px)|Large (18px)|Extra large (20 px)">16px</fontsize>
<primarycolor type="colorpicker" category="Fonts" width="12" title="Primary color" options="on|off" optionlabels="Yes|No">#5e1c64</primarycolor>
<secondarycolor type="colorpicker" category="Fonts" width="12" title="Secondary color" options="on|off" optionlabels="Yes|No">#888888</secondarycolor>
<!-- Per-element font+color combos (Prompt U). Each element gets:
- <el>font (type "fontselect"): the SAME choices as the base "font"
dropdown above (bundled + variant-custom + browser fonts), plus a
first option "Same as base font" (value "base" = no extra class, the
element inherits the body font). Applied as class font-<value> on the
element in the views (nav_bar, progress_bar, question_text_container,
answers, help, group_name, group_desc, navigator). Default "base".
- <el>textcolor (dropdown): text color mode for that element —
default|primary|secondary|other (default "default" = the body font
color fontcolor). Resolved to an inline style="color: …" in the views.
- <el>textcolorcustom (colorpicker): only visible when <el>textcolor
= "other" (parent show-value "other"). -->
<headerfont type="fontselect" category="Fonts" width="4" title="Font for the header / top menu">base</headerfont>
<headertextcolor type="dropdown" category="Fonts" width="12" title="Text color for the header / top menu" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></headertextcolor>
<headertextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for the header / top menu" parent="headertextcolor">#444444</headertextcolorcustom>
<progressbarfont type="fontselect" category="Fonts" width="4" title="Font for the progress bar">base</progressbarfont>
<progressbartextcolor type="dropdown" category="Fonts" width="12" title="Text color for the progress bar" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></progressbartextcolor>
<progressbartextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for the progress bar" parent="progressbartextcolor">#444444</progressbartextcolorcustom>
<questiontitlefont type="fontselect" category="Fonts" width="4" title="Font for question titles">base</questiontitlefont>
<questiontitletextcolor type="dropdown" category="Fonts" width="12" title="Text color for question titles" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></questiontitletextcolor>
<questiontitletextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for question titles" parent="questiontitletextcolor">#444444</questiontitletextcolorcustom>
<answersfont type="fontselect" category="Fonts" width="4" title="Font for answers and help texts">base</answersfont>
<answerstextcolor type="dropdown" category="Fonts" width="12" title="Text color for answers and help texts" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></answerstextcolor>
<answerstextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for answers and help texts" parent="answerstextcolor">#444444</answerstextcolorcustom>
<grouptitlefont type="fontselect" category="Fonts" width="4" title="Font for group titles">base</grouptitlefont>
<grouptitletextcolor type="dropdown" category="Fonts" width="12" title="Text color for group titles" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></grouptitletextcolor>
<grouptitletextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for group titles" parent="grouptitletextcolor">#444444</grouptitletextcolorcustom>
<groupdescriptionfont type="fontselect" category="Fonts" width="4" title="Font for group descriptions">base</groupdescriptionfont>
<groupdescriptiontextcolor type="dropdown" category="Fonts" width="12" title="Text color for group descriptions" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></groupdescriptiontextcolor>
<groupdescriptiontextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for group descriptions" parent="groupdescriptiontextcolor">#444444</groupdescriptiontextcolorcustom>
<buttonsfont type="fontselect" category="Fonts" width="4" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
<buttonstextcolor type="dropdown" category="Fonts" width="12" title="Text color for the buttons (Previous/Next/Submit)" options="default|primary|secondary|other" optionlabels="Default font color|Primary color|Secondary color|Other…">default
<dropdownoptions>
<option value="default">Default font color</option>
<option value="primary">Primary color</option>
<option value="secondary">Secondary color</option>
<option value="other">Other…</option>
</dropdownoptions></buttonstextcolor>
<buttonstextcolorcustom type="colorpicker" category="Fonts" width="12" title="Custom text color for the buttons (Previous/Next/Submit)" parent="buttonstextcolor">#444444</buttonstextcolorcustom>
<questiontitlefontsize type="buttons" category="Fonts" width="6" title="Question title font size" options="1.0rem|1.2rem|1.5rem|2.0rem|20px|24px" optionlabels="Same as Base Font Size(BFS)|1.2 BFS|1.5 BFS|2.0 BFS|20px|24px">1.2rem</questiontitlefontsize>
<questiontitlefontweight type="buttons" category="Fonts" width="6" title="Question title font weight" options="400|700" optionlabels="Normal|Bold">700</questiontitlefontweight>
<grouptitlefontsize type="buttons" category="Fonts" width="6" title="Group title font size" options="1.0rem|1.2rem|1.5rem|2.0rem|20px|24px" optionlabels="Same as Base Font Size(BFS)|1.2 BFS|1.5 BFS|2.0 BFS|20px|24px">2.0rem</grouptitlefontsize>