feat(options): Questions tab 'Answer options and subquestions' section; answerstextcolor becomes a 6-way color chooser (row 178 plan P3)

New section in the Questions pane (h3 + first col-md-4 of a 3-column grid,
only it used): answersfont + answerstextcolor + answerstextcolorcustom,
moved up in config.xml between the title block and the help options,
width 12 -> 4. answerstextcolor upgraded to the chooser scheme
(default|defaultbackgroundcolor|color1|color2|color3|other, default stays
'default'), added to aColorChooserKeys in options.twig/options.js
(OPTIONS_JS_TOKEN 20261129.2) and to the build.php chooser migration.
Views (answers, survey_question_help, valid_message_and_help): 6-way
mapping with legacy primary/secondary + raw hex passthrough.
All 3 variants rebuilt, example config synced.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 15:08:49 +01:00
commit e061f7c0f3
2 changed files with 77 additions and 40 deletions

View file

@ -272,13 +272,14 @@ foreach ($logoPositions as $pos) {
// headerbackgroundcolor, progressbarcolor, progressbarbackgroundcolor,
// progressbarfontcolor, bodybackgroundcolor, grouptitletextcolor,
// groupdescriptiontextcolor; row 180 plan P2 adds questiontitletextcolor,
// questiontitlebackgroundcolor, questionbackgroundcolor) became mode dropdowns
// questiontitlebackgroundcolor, questionbackgroundcolor; row 184 plan P3 adds
// answerstextcolor) became mode dropdowns
// (default|defaultbackgroundcolor|color1|color2|color3|other) with a <key>custom
// colorpicker child. A legacy HEX value in the json means "custom color": map it
// to mode "other" and move the hex into the <key>custom child, so the variant
// default stays valid for the dropdown. A legacy mode "primary"/"secondary"
// (old 4-way textcolor dropdown) maps to "color1"/"color2".
$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor'];
$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor'];
$colorChooserLegacyModes = ['primary' => 'color1', 'secondary' => 'color2'];
foreach ($colorChooserKeys as $ck) {
if (isset($definition['options'][$ck])

View file

@ -31,7 +31,7 @@
<version>3.3.0</version>
<apiVersion>3</apiVersion>
<description>&lt;strong&gt;Example variant of Respondage Vanilla&lt;/strong&gt;&lt;br&gt;Public example of a build output: only a few house-style option values differ, all views, CSS and JS are inherited from the mother theme via extends.</description>
<lastUpdate>2026-11-29 13:59:51</lastUpdate>
<lastUpdate>2026-11-29 14:06:42</lastUpdate>
<extends>vanilla_respondage</extends>
</metadata>
<compatibility>
@ -343,18 +343,31 @@
<questionbackgroundcolor type="dropdown" category="Questions" width="4" title="Question body background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<dropdownoptions><option value="default">Default font color</option><option value="defaultbackgroundcolor" data-default="1">[Default background color]</option><option value="color1">Color 1</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other">Other ...</option></dropdownoptions></questionbackgroundcolor>
<questionbackgroundcolorcustom type="colorpicker" category="Questions" width="4" title="Custom question body background color (for 'Other ...')" parent="questionbackgroundcolor">#ffffff</questionbackgroundcolorcustom>
<!-- Row 178 plan P3 (row 184): section "Answer options and subquestions"
(options.twig) — a three-column grid (col-md-4, width 4) of which only the
first column is used: font chooser + 6-way color chooser + custom for the
answers AND subquestions (both are rendered by answers.twig with these
options). answerstextcolor uses the color-chooser scheme like the P2 title
colors; default mode stays "default" (Default font color). -->
<answersfont type="fontselect" category="Questions" width="4" title="Font for answers and subquestions">base</answersfont>
<answerstextcolor type="dropdown" category="Questions" width="4" title="Text color for answers and subquestions" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
<dropdownoptions><option value="default" data-default="1">[Default font color]</option><option value="defaultbackgroundcolor">Default background color</option><option value="color1">Color 1</option><option value="color2">Color 2</option><option value="color3">Color 3</option><option value="other">Other ...</option></dropdownoptions></answerstextcolor>
<answerstextcolorcustom type="colorpicker" category="Questions" width="4" title="Custom text color for answers and subquestions (for 'Other ...')" parent="answerstextcolor">#444444</answerstextcolorcustom>
<!-- Questions
HOUSE-STYLE: the colorpicker options in this section (question
title/background/help/help-font/border/checkbox colors) are house-style
colors. NOT house-style (structural, same for all variants):
questionborder, questionborderstyle, the borderradius values,
questiondropdown and questionhelptextposition.
Row 178/179 plan: order = the sections of the Questions tab as rendered by
Row 178 plan: order = the sections of the Questions tab as rendered by
options.twig (aQSections/aQSlots): first the "Overall question" section
(width 6 = the single col-md-6), then the "Question title and body"
section (three col-md-4 columns, width 4): col1 title font chooser/color
chooser + legacy picker, col2 title background chooser, col3 body
background chooser; then the remaining legacy columns (help, border,
(width 4 = the first col-md-4 of a three-column grid, row 183), then the
"Question title and body" section (three col-md-4 columns, width 4):
col1 title font chooser/color chooser + legacy picker, col2 title
background chooser, col3 body background chooser; then (P3/row 184) the
"Answer options and subquestions" section (width 4, first col-md-4 of a
three-column grid, only it used): answers font + 6-way color chooser +
custom; then the remaining legacy columns (help, border,
checkbox color), then the rest full-width (width 12). Inside a pane
column each option stacks as col-12. The border children
carry parent="questionborder"; the show-values "box|top" cannot be an
@ -375,8 +388,9 @@
<questionborderradiusBL type="duration" category="Questions" width="4" title="Border radius bottom left" parent="questionborder">5px</questionborderradiusBL>
<questionborderradiusBR type="duration" category="Questions" width="4" title="Border radius bottom right" parent="questionborder">5px</questionborderradiusBR>
<checkboxcolor type="colorpicker" category="Questions" width="4" title="Checkbox/radiobutton color (when checked)" options="on|off" optionlabels="Yes|No">#ff005f</checkboxcolor>
<!-- Per-element font+color combos (Prompt U; row 178 plan P3/P6 move the
answers/buttons ones into their own sections/tab). Each element gets:
<!-- Per-element font+color combos (Prompt U; row 178 plan P6 moves the
buttons ones into their own tab; the answers ones moved to the
"Answer options and subquestions" section above in P3). 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
@ -388,10 +402,6 @@
color fontcolor). Resolved to an inline style="color: …" in the views.
- <el>textcolorcustom (colorpicker): only visible when <el>textcolor
= "other" (parent show-value "other"). -->
<answersfont type="fontselect" category="Questions" width="12" title="Font for answers and help texts">base</answersfont>
<answerstextcolor type="dropdown" category="Questions" 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" data-default="1">[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="Questions" width="12" title="Custom text color for answers and help texts" parent="answerstextcolor">#444444</answerstextcolorcustom>
<buttonsfont type="fontselect" category="Questions" width="12" title="Font for the buttons (Previous/Next/Submit)">base</buttonsfont>
<buttonstextcolor type="dropdown" category="Questions" 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" data-default="1">[Default font color]</option><option value="primary">Primary color</option><option value="secondary">Secondary color</option><option value="other">Other…</option></dropdownoptions></buttonstextcolor>