From 089ddc5642a2fa18e9875dadef0fa8d9473ec6fb Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Wed, 25 Nov 2026 14:23:24 +0100 Subject: [PATCH] feat(options): Default fonts and colors tab with Default font/colors sections (Prompt Y) - Tab renamed to "Default fonts and colors" with full-width h2+p intro ("Default font"), 3-col row font/fontcolor/fontsize, hr, "Default colors" h2+p, 3-col row primarycolor ("Color 1 (primary)")/secondarycolor/new tertiarycolor ("Color 3", #dddddd) - headerfont moved to Top of page Header section col 2 above navbarfontcolor; progressbarfont to Progress bar first row col 3 (col 2 stays empty) - headertextcolor(+custom)/progressbartextcolor(+custom) removed from config.xml (covered by navbarfontcolor/progressbarfontcolor; views fall back to fontcolor via |default) - 21 per-element font/color/size options moved Fonts -> Questions, rendered full width below the 3 question columns - variants rebuilt (defensie/erasmus/respondage); example variant config synced Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- config.xml | 69 +++++------- options/options.twig | 104 +++++++++++------- .../example/respondage_respondage/config.xml | 61 +++++----- 3 files changed, 121 insertions(+), 113 deletions(-) diff --git a/config.xml b/config.xml index 074e381..906ea39 100644 --- a/config.xml +++ b/config.xml @@ -287,9 +287,10 @@ size/weight options below. HOUSE-STYLE: fontcolor, primarycolor and secondarycolor are set per variant via variants/.json. --> #444444 - 16px - #5e1c64 - #888888 + 16px + #5e1c64 + #888888 + #dddddd - base - default - - - - - - - #444444 - base - default - - - - - - - #444444 - base - default + base + base + base + default - #444444 - base - default + #444444 + base + default - #444444 - base - default + #444444 + base + default - #444444 - base - default + #444444 + base + default - #444444 - base - default + #444444 + base + default - #444444 - 1.2rem - 700 - 2.0rem - 700 - 1.2rem - 400 + #444444 + 1.2rem + 700 + 2.0rem + 700 + 1.2rem + 400 diff --git a/options/options.twig b/options/options.twig index f8ec5ab..523ab3a 100644 --- a/options/options.twig +++ b/options/options.twig @@ -142,13 +142,16 @@ Values are stored per option key, so moving them here does not change any stored value. The order of this list is the order shown in the tab. #} {% set aTopOfPageKeys = [ - 'headerbackgroundcolor', 'navbarfontcolor', + 'headerbackgroundcolor', 'headerfont', 'navbarfontcolor', 'headersticky', 'headerstickycomputer', 'headerstickytablet', 'headerstickymobile', 'brandlogofile', 'brandlogotopmargin', 'brandshowoncomputer', 'brandshowontablet', 'brandshowonmobile', 'centerlogofile', 'centerlogotopmargin', 'centershowoncomputer', 'centershowontablet', 'centershowonmobile', 'rightlogofile', 'rightlogotopmargin', 'rightshowoncomputer', 'rightshowontablet', 'rightshowonmobile', - 'progressbarposition', 'progressbarbackgroundcolor', 'progressbarcolor', 'progressbarfontcolor' + 'progressbarposition', 'progressbarfont', 'progressbarbackgroundcolor', 'progressbarcolor', 'progressbarfontcolor' ] %} +{# Prompt Y: 'headerfont' sits in column 2 of the Header section, ABOVE navbarfontcolor + (the menu-item color); 'progressbarfont' sits in column 3 of the first Progress bar + row (column 1 = progressbarposition, column 2 stays empty). #} {# Prompt M: the logo keys are rendered as ONE dedicated 3-column block (triggered at the first logo key, 'brandlogofile') and skipped in the generic per-key loop. #} @@ -172,7 +175,12 @@ colors" pane. Per element the keys are font (fontselect), textcolor (dropdown default|primary|secondary|other) and textcolorcustom (colorpicker, visible only when textcolor = "other"). #} -{% set aFontElements = ['header', 'progressbar', 'questiontitle', 'answers', 'grouptitle', 'groupdescription', 'buttons'] %} +{% set aFontElements = ['questiontitle', 'answers', 'grouptitle', 'groupdescription', 'buttons'] %} +{# Prompt Y: only these five elements still have a textcolor dropdown (parent of + textcolorcustom, show-value "other" via aShowIfValues below). The header and + progressbar textcolor keys were removed from config.xml — their colors are set in + the Top of the page tab (navbarfontcolor / progressbarfontcolor) — so header and + progressbar are no longer in aFontElements. #} {# Prompt R: multi-value show lists per parent key, rendered as data-show-if-value (e.g. "box|top" for questionborder). Core passes only the @@ -183,16 +191,14 @@ {% set aShowIfValues = { 'questionborder': 'box|top' } %} {% for el in aFontElements %}{% set aShowIfValues = aShowIfValues|merge({ (el ~ 'textcolor'): 'other' }) %}{% endfor %} -{# Prompt U: the Fonts pane is rendered as "Fonts and colors" with a special - layout: a TOP ROW (col 1: font/fontcolor/fontsize; col 2: primarycolor/ - secondarycolor; col 3 empty), an hr, then one combo row per element in - aFontElements (col 1: font, col 2: textcolor, col 3: - textcolorcustom), then the remaining Fonts options (sizes/weights) - stacked as usual ("rest"). config.xml lists the Fonts options in exactly - this order, so the generic loop meets them slot by slot and opens/closes - the containers on slot change (fLastSlot). #} -{% set aFontsTop1 = ['font', 'fontcolor', 'fontsize'] %} -{% set aFontsTop2 = ['primarycolor', 'secondarycolor'] %} +{# Prompt Y: the Fonts pane ("Default fonts and colors") has exactly six options in + two 3-column rows: row 1 = font | fontcolor | fontsize (one per column), then a + full-width hr + "Default colors" intro (h2+p), then row 2 = primarycolor | + secondarycolor | tertiarycolor (one per column). The per-element combos and the + size/weight options moved to the Questions tab; headerfont/progressbarfont moved + to Top of the page. Slots f1-f3 (row 1) and c1-c3 (row 2). #} +{% set aFontsRow1 = ['font', 'fontcolor', 'fontsize'] %} +{% set aFontsRow2 = ['primarycolor', 'secondarycolor', 'tertiarycolor'] %} {# Prompt R: the Questions pane renders as THREE columns (col-md-4, border-start between them) with explicit key lists. config.xml lists the Questions options @@ -211,7 +217,7 @@ stay stable regardless of the tab order. #} {% set aTabs = [] %} {% if 'Fonts' in aOptionAttributes.categories %} - {% set aTabs = [{ 'id': 'category-fonts', 'label': 'Fonts and colors', 'category': 'Fonts', 'keys': null }] %} + {% set aTabs = [{ 'id': 'category-fonts', 'label': 'Default fonts and colors', 'category': 'Fonts', 'keys': null }] %} {% endif %} {% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Top of the page', 'category': 'Top of the page', 'keys': aTopOfPageKeys }]) %} {% for category in aOptionAttributes.categories %} @@ -276,6 +282,15 @@

{{ gT("The header is the top part of the page, possibly containing the name of the survey, logo's and a menu. In this part of the options you can make this header more or less distinguishable from the rest of the page and you can choose if the logo should stay on top of the page after scrolling (sticky) or not.") }}

{% endif %} + {% if tab.id == 'category-fonts' %} + {# Prompt Y: intro of the "Default fonts and colors" pane — full-width h2 + p, + translatable via gT(). (Typo in the owner's source fixed: "you version" -> + "your version".) #} +
+

{{ gT("Default font") }}

+

{{ gT("Here you choose the default font, the font that is used on most places in your version of the theme.") }}

+
+ {% endif %}
{# Prompt P: in the Images pane use the three-column grid like the logo block (Prompt M), but fill ONLY column 1 — all Images options stack @@ -297,26 +312,29 @@ {% set bTopPane = tab.id == 'top-of-page' %} {% set fSlot = 'rest' %} {% if bFontsPane %} - {% if key in aFontsTop1 %}{% set fSlot = 'top1' %} - {% elseif key in aFontsTop2 %}{% set fSlot = 'top2' %} - {% else %} - {% for el in aFontElements %} - {% if key == el ~ 'font' %}{% set fSlot = 'combo1' %} - {% elseif key == el ~ 'textcolor' %}{% set fSlot = 'combo2' %} - {% elseif key == el ~ 'textcolorcustom' %}{% set fSlot = 'combo3' %}{% endif %} - {% endfor %} + {# Prompt Y: two 3-column rows — f1/f2/f3 = font/fontcolor/fontsize, + c1/c2/c3 = primary/secondary/tertiary color. #} + {% if key == 'font' %}{% set fSlot = 'f1' %} + {% elseif key == 'fontcolor' %}{% set fSlot = 'f2' %} + {% elseif key == 'fontsize' %}{% set fSlot = 'f3' %} + {% elseif key == 'primarycolor' %}{% set fSlot = 'c1' %} + {% elseif key == 'secondarycolor' %}{% set fSlot = 'c2' %} + {% elseif key == 'tertiarycolor' %}{% set fSlot = 'c3' %} {% endif %} {% elseif bTopPane %} - {# Prompt X: Top-of-page sections — Header (3 cols: - headerbackgroundcolor | navbarfontcolor | sticky group), hr, - Logos (h2+p, then the logo block, then its hr), Progress bar - (h2+p, position in col 1 with empty cols 2-3, then a colors row - with one colorpicker per column, in current order). #} + {# Prompt X/Y: Top-of-page sections — Header (3 cols: + headerbackgroundcolor | headerfont above navbarfontcolor | + sticky group), hr, Logos (h2+p, then the logo block, then its + hr), Progress bar (h2+p, first row: position in col 1, col 2 + empty, progressbarfont in col 3; then a colors row with one + colorpicker per column, in current order). #} {% if key in aLogoKeys %}{% set fSlot = 'logo' %} {% elseif key == 'headerbackgroundcolor' %}{% set fSlot = 'h1' %} + {% elseif key == 'headerfont' %}{% set fSlot = 'hf' %} {% elseif key == 'navbarfontcolor' %}{% set fSlot = 'h2' %} {% elseif key in aTopStickyKeys %}{% set fSlot = 'h3' %} {% elseif key == 'progressbarposition' %}{% set fSlot = 'ppos' %} + {% elseif key == 'progressbarfont' %}{% set fSlot = 'pfont' %} {% elseif key == 'progressbarbackgroundcolor' %}{% set fSlot = 'pcol1' %} {% elseif key == 'progressbarcolor' %}{% set fSlot = 'pcol2' %} {% elseif key == 'progressbarfontcolor' %}{% set fSlot = 'pcol3' %} @@ -324,20 +342,25 @@ {% endif %} {% if fSlot != fLastSlot and (bFontsPane or bTopPane) %} {% if bFontsPane %} - {% if fLastSlot == 'top2' %}

{% endif %} - {% if fLastSlot == 'combo3' %}{% endif %} - {% if fSlot == 'top1' %}
- {% elseif fSlot == 'top2' %}
- {% elseif fSlot == 'combo1' %}
- {% elseif fSlot == 'combo2' %}
- {% elseif fSlot == 'combo3' %}
+ {# Prompt Y: row 1 (f1/f2/f3) is opened at f1; at f3 the row is + closed and row 2 (c1/c2/c3) opens after hr + "Default colors" + intro; within a row each new slot just moves to the next + col-md-4. #} + {% if fLastSlot == 'f3' %}

{{ gT("Default colors") }}

{{ gT("The default colors are your most used colors.") }}

+ {% elseif fLastSlot == 'f1' or fLastSlot == 'f2' or fLastSlot == 'c1' or fLastSlot == 'c2' %}
+ {% endif %} + {% if fSlot == 'f1' %}
{% endif %} {% else %} - {# top-of-page transitions: close previous slot, open new slot #} + {# top-of-page transitions: close previous slot, open new slot. + Header: col 1 = h1, col 2 = hf stacked above h2, col 3 = h3. + Progress bar: first row = ppos in col 1, empty col 2, pfont in + col 3; then the colors row (pcol1/pcol2/pcol3). #} {% if fLastSlot == 'h1' or fLastSlot == 'h2' %}
{% elseif fLastSlot == 'h3' %}

{{ gT("Logos") }}

{{ gT("In this theme there are three positions for separate logos, but it is up to you which positions you want to fill.") }}

{% elseif fLastSlot == 'logo' %}

{{ gT("Progress bar") }}

{{ gT("The progress bar can be switched on/off per survey in the survey settings. Here in this section you can choose how the progress bar looks when displayed.") }}

- {% elseif fLastSlot == 'ppos' %}
+ {% elseif fLastSlot == 'ppos' %}
+ {% elseif fLastSlot == 'pfont' %}
{% elseif fLastSlot == 'pcol1' or fLastSlot == 'pcol2' %}
{% endif %} {% if fSlot == 'h1' %}
@@ -414,13 +437,18 @@ {% elseif key not in aLogoKeys %} {# Prompt R: Questions pane — three columns; open a col-md-4 at the first key and switch column (border-start) whenever the key's - column changes. All options in this pane stack as col-12. #} + column changes. All options in the columns stack as col-12. + Prompt Y: keys in none of the three column lists (the per-element + font/color/size options moved here) get qCol 0 = "rest": the open + column is closed and they render full width below the columns. #} {% set bQuestionsPane = tab.category == 'Questions' %} {% if bQuestionsPane %} - {% set qCol = key in aQuestionsCol1 ? 1 : (key in aQuestionsCol2 ? 2 : 3) %} + {% set qCol = key in aQuestionsCol1 ? 1 : (key in aQuestionsCol2 ? 2 : (key in aQuestionsCol3 ? 3 : 0)) %} {% if qCol != qLastCol %} {% if qLastCol > 0 %}
{% endif %} + {% if qCol > 0 %}
+ {% endif %} {% set qLastCol = qCol %} {% endif %} {% endif %} diff --git a/variants/example/respondage_respondage/config.xml b/variants/example/respondage_respondage/config.xml index 37fb543..fbd4b14 100644 --- a/variants/example/respondage_respondage/config.xml +++ b/variants/example/respondage_respondage/config.xml @@ -31,7 +31,7 @@ 3.3.0 3 Example variant of vanilla_respondage, generated by variants/build.php — demonstrates the output of the build process. Not a real client. - 2026-11-25 10:51:33 + 2026-11-25 13:22:35 vanilla_respondage @@ -252,9 +252,10 @@ size/weight options below. HOUSE-STYLE: fontcolor, primarycolor and secondarycolor are set per variant via variants/.json. --> #444444 - 16px - #5e1c64 - #888888 + 16px + #5e1c64 + #888888 + #dddddd - base - default - - #444444 - base - default - - #444444 - base - default + base + base + base + default - #444444 - base - default + #444444 + base + default - #444444 - base - default + #444444 + base + default - #444444 - base - default + #444444 + base + default - #444444 - base - default + #444444 + base + default - #444444 - 1.2rem - 700 - 2.0rem - 700 - 1.2rem - 400 + #444444 + 1.2rem + 700 + 2.0rem + 700 + 1.2rem + 400