From 44cef7d530edee375b756bbf12282580c1a5aa26 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Sun, 29 Nov 2026 11:56:04 +0100 Subject: [PATCH] refactor(options): 'Default fonts and colors' tab becomes 'Default font and colors' in one three-column row Tab title and pane heading now 'Default font and colors' (description unchanged); the pane is a single row with three col-md-4 columns: col 1 = Default font (body text), Base font size (body text), Default font color (body text); col 2 = Default background color; col 3 = Color 1 (primary), Color 2, Color 3. The old hr + 'Default colors' section between the two rows is removed. config.xml mirrors this per the row 160 rule: category renamed to the tab label, option order within the category = the pane render order (fontsize moved before fontcolor), all seven options width=4. Tab id stays 'category-fonts' so stored tab preferences survive. All variants rebuilt (defensie/erasmus from the private defs, respondage_respondage from /tmp/example_defs) and the tracked example config synced from the built theme dir (it was stale from the deferred rebuilds). options.js untouched, no OPTIONS_JS_TOKEN bump. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- config.xml | 36 +- options/options.twig | 51 +- .../example/respondage_respondage/config.xml | 484 ++++++++++-------- 3 files changed, 324 insertions(+), 247 deletions(-) diff --git a/config.xml b/config.xml index c61a479..91e787c 100644 --- a/config.xml +++ b/config.xml @@ -89,8 +89,8 @@ --> - - + - + - noto_sans + noto_sans @@ -157,23 +157,21 @@ - - #444444 - 16px - + 16px + #444444 + - #ffffff - #5e1c64 - #888888 - #dddddd + #ffffff + #5e1c64 + #888888 + #dddddd base diff --git a/options/options.twig b/options/options.twig index 6be289b..a039078 100644 --- a/options/options.twig +++ b/options/options.twig @@ -12,8 +12,8 @@ (fontselect = per-element font override: same choices as the base "font" dropdown plus "Same as base font"; see the branch below.) - Tab order: the "Default fonts and colors" category tab is FIRST (default font + - per-element font overrides), then the "Header" tab, then the "Page + Tab order: the "Default font and colors" category tab is FIRST (default font + + default colors), then the "Header" tab, then the "Page background" tab, then the "Groups" tab, then the other remaining categories, and LAST the "Other options" tab. @@ -174,7 +174,7 @@ font-size: 16px; } /* row 128/130: the section headers this page inserts (h2 inside the tab - panes, e.g. "Header", "Logos", "Default colors") — row 128 made them + panes, e.g. "Header", "Logos", "Page background") — row 128 made them h1-sized, which turned out too big, so row 130 fixes them at 24px. The modal title h2.modal-title is outside .tab-content and excluded. */ .tab-content h2:not(.modal-title) { @@ -277,8 +277,12 @@ {% set aShowIfMode = { 'navbarfontcolor': 'disable' } %} {% for ck in aColorChooserKeys %}{% set aShowIfMode = aShowIfMode|merge({ (ck): 'disable' }) %}{% endfor %} -{% set aFontsRow1 = ['font', 'fontcolor', 'fontsize'] %} -{% set aFontsRow2 = ['primarycolor', 'secondarycolor', 'tertiarycolor'] %} +{# row 174: the "Default font and colors" pane is ONE row with three col-md-4 + columns: col 1 = font, fontsize, fontcolor; col 2 = defaultbackgroundcolor; + col 3 = primarycolor, secondarycolor, tertiarycolor (slot mapping below) #} +{% set aFontsCol1 = ['font', 'fontsize', 'fontcolor'] %} +{% set aFontsCol2 = ['defaultbackgroundcolor'] %} +{% set aFontsCol3 = ['primarycolor', 'secondarycolor', 'tertiarycolor'] %} {% set aQuestionsCol1 = ['questiontitlebackgroundcolor', 'questiontitlefontcolor', 'questionbackgroundcolor', 'questionhelpbackgroundcolor', 'questionhelpfontcolor', 'questionhelptextposition'] %} {% set aQuestionsCol2 = ['questionborder', 'questionbordercolor', 'questionborderstyle', 'questiondropdown', 'questionborderradiusTL', 'questionborderradiusTR', 'questionborderradiusBL', 'questionborderradiusBR'] %} @@ -296,8 +300,8 @@ {% set aGroupCol1 = ['grouptitlefont', 'grouptitletextcolor', 'grouptitletextcolorcustom', 'grouptitlefontsize', 'grouptitlefontoptions'] %} {% set aGroupCol2 = ['groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', 'groupdescriptionfontsize', 'groupdescriptionfontoptions'] %} -{# Tab list: FIRST the "Default fonts and colors" tab (where the default/base font - is chosen and the per-element font overrides live), then the "Header" tab +{# Tab list: FIRST the "Default font and colors" tab (where the default/base font + and the default colors are chosen), then the "Header" tab tab (keys = aTopOfPageKeys), then row 147: the "Page background" tab (the config.xml "Page background" category, id kept as 'category-images' so the stored tab preference stays valid), then the "Groups" tab (keys = aGroupKeys), @@ -305,8 +309,8 @@ (keys = null: all options of that category). Row 159: config.xml category names equal these tab labels. #} {% set aTabs = [] %} -{% if 'Default fonts and colors' in aOptionAttributes.categories %} - {% set aTabs = [{ 'id': 'category-fonts', 'label': 'Default fonts and colors', 'category': 'Default fonts and colors', 'keys': null }] %} +{% if 'Default font and colors' in aOptionAttributes.categories %} + {% set aTabs = [{ 'id': 'category-fonts', 'label': 'Default font and colors', 'category': 'Default font and colors', 'keys': null }] %} {% endif %} {% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Header', 'category': 'Header', 'keys': aTopOfPageKeys }]) %} {# row 147/159: "Page background" category -> the Page background tab, directly after @@ -330,7 +334,7 @@ slot layout below instead of the Questions 3-column grid. #} {% set aTabs = aTabs|merge([{ 'id': 'groups', 'label': 'Groups', 'category': 'Groups', 'keys': aGroupKeys }]) %} {% for category in aOptionAttributes.categories %} - {% if category != 'Default fonts and colors' and category != 'Header' and category != 'Colors' and category != 'Page background' and category != 'Groups' and category != 'Other options' %} + {% if category != 'Default font and colors' and category != 'Header' and category != 'Colors' and category != 'Page background' and category != 'Groups' and category != 'Other options' %} {# The "Colors" tab is removed on purpose. Its only remaining options are sliderhandlecolor and privacybackgroundcolor (the other Colors keys carry category "Header" now) — TODO: place these two @@ -407,7 +411,7 @@ {% endif %} {% if tab.id == 'category-fonts' %}
-

{{ gT("Default font") }}

+

{{ gT("Default font and colors") }}

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

{% endif %} @@ -438,19 +442,18 @@ Every slot is row+col (two divs), except 'logo' (self-contained block) and 'rest' (normal grid). Computed BEFORE the logo-block branch so the transition into the logo slot also fires. #} - {% set bFontsPane = tab.category == 'Default fonts and colors' %} + {% set bFontsPane = tab.category == 'Default font and colors' %} {% set bTopPane = tab.id == 'top-of-page' %} {% set bImagesPane = tab.category == 'Page background' %} {% set bGroupsPane = tab.id == 'groups' %} {% set fSlot = 'rest' %} {% if bFontsPane %} - {% if key == 'font' %}{% set fSlot = 'f1' %} - {% elseif key == 'fontcolor' %}{% set fSlot = 'f2' %} - {% elseif key == 'fontsize' %}{% set fSlot = 'f3' %} - {% elseif key == 'defaultbackgroundcolor' %}{% set fSlot = 'c0' %} - {% elseif key == 'primarycolor' %}{% set fSlot = 'c1' %} - {% elseif key == 'secondarycolor' %}{% set fSlot = 'c2' %} - {% elseif key == 'tertiarycolor' %}{% set fSlot = 'c3' %} + {# row 174: one row, three col-md-4 columns — col 1 (fc1) = + font/fontsize/fontcolor, col 2 (fc2) = defaultbackgroundcolor, + col 3 (fc3) = the three colors #} + {% if key in aFontsCol1 %}{% set fSlot = 'fc1' %} + {% elseif key in aFontsCol2 %}{% set fSlot = 'fc2' %} + {% elseif key in aFontsCol3 %}{% set fSlot = 'fc3' %} {% endif %} {% elseif bTopPane %} {% if key in aLogoKeys %}{% set fSlot = 'logo' %} @@ -495,11 +498,11 @@ {% endif %} {% if fSlot != fLastSlot and (bFontsPane or bTopPane or bImagesPane or bGroupsPane) %} {% if bFontsPane %} - {% if fLastSlot == 'f3' %}

{{ gT("Default colors") }}

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

- {% elseif fLastSlot == 'f1' or fLastSlot == 'f2' %}
- {% elseif fLastSlot == 'c0' or fLastSlot == 'c1' or fLastSlot == 'c2' %}
+ {# row 174: column change inside the single fonts row — + close the previous col-md-4, open the next one #} + {% if fLastSlot == 'fc1' or fLastSlot == 'fc2' %}
{% endif %} - {% if fSlot == 'f1' %}
+ {% if fSlot == 'fc1' %}
{% endif %} {% elseif bTopPane %} {# top-of-page transitions: close previous slot, open new slot. @@ -892,7 +895,7 @@ {% if tab.id == 'groups' and fLastSlot in ['g1', 'g2'] %}
{% endif %} {# close an open slot container at the end of a Fonts/Top-of-page pane (every non-logo, non-rest slot has exactly two open divs: row + col) #} - {% if (tab.category == 'Default fonts and colors' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}
{% endif %} + {% if (tab.category == 'Default font and colors' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}
{% endif %}
{# row 150: the upload facility is NOT full-width at the bottom any more — it diff --git a/variants/example/respondage_respondage/config.xml b/variants/example/respondage_respondage/config.xml index fbd4b14..3fa81e1 100644 --- a/variants/example/respondage_respondage/config.xml +++ b/variants/example/respondage_respondage/config.xml @@ -13,7 +13,7 @@ respondage_respondage - Respondage (example variant) + Respondage Vanilla theme 2024-04-19 12:03 Respondage @@ -30,8 +30,8 @@ GNU General Public License version 2 or later (GPL-2.0-or-later) — full text in the LICENSE file 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 13:22:35 + <strong>Example variant of Respondage Vanilla</strong><br>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. + 2026-11-29 10:53:15 vanilla_respondage @@ -84,218 +84,294 @@ the json; build.php checks that the key exists. --> - - off - on - 1 - off - enable - - - - ./files/logo.png - 15 - on - on - off - off - 15 - on - on - off - off - 15 - on - on - off - - on - #dddddd - scroll - tile - ./files/tiledtexture.png - - - #5e1c64 - #ffffff - #ffffff - #fff3cd - #444444 - top - box - #cccccc - solid - hover - 5px - 5px - 5px - 5px - #ff005f - - - under - - - on - on - on - off - - - #eeeeee - #444444 - #5e1c64 - #eeeeee - #5e1c64 - #ffffff - lightyellow - - + + + - noto_sans + noto_sans - - #444444 - 16px - #5e1c64 - #888888 - #dddddd + + 16px + #444444 + + #ffffff + #5e1c64 + #888888 + #dddddd + + base + + other + #444444 + + + + other + #eeeeee + + + on + on + on + off + + 90 + + + ./files/logo.png + 15 + on + on + off + off + 15 + on + on + off + off + 15 + on + on + off + + + under + base + + other + #5e1c64 + other + #eeeeee + other + #ffffff + + + other + #dddddd + + on + ./files/tiledtexture.png + scroll + tile + + + base + default + + #444444 + 2.0rem + bold + base + default + + #444444 + 1.2rem + normal + + + + #5e1c64 + #ffffff + #ffffff + #fff3cd + #444444 + top + box + #cccccc + solid + hover + 5px + 5px + 5px + 5px + #ff005f - base - base - base + - 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- on the + element in the views (nav_bar, progress_bar, question_text_container, + answers, help, group_name, group_desc, navigator). Default "base". + - 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. + - textcolorcustom (colorpicker): only visible when textcolor + = "other" (parent show-value "other"). --> + base default - + #444444 - base + base default - + #444444 - base - default - - #444444 - base - default - - #444444 - base + base default - + #444444 - 1.2rem - 700 - 2.0rem - 700 - 1.2rem - 400 + 1.2rem + 700 + + #5e1c64 + lightyellow + + + off + on + 1 + off + enable