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 <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 11:56:04 +01:00
commit 44cef7d530

View file

@ -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' %}
<div class="row action_hide_on_inherit fonts-intro"><div class="col-12">
<h2>{{ gT("Default font") }}</h2>
<h2>{{ gT("Default font and colors") }}</h2>
<p>{{ gT("Here you choose the default font, the font that is used on most places in your version of the theme.") }}</p>
</div></div>
{% 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' %}</div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="fonts-hr"></div></div><div class="row action_hide_on_inherit fonts-section-intro"><div class="col-12"><h2>{{ gT("Default colors") }}</h2><p>{{ gT("The default colors are your most used colors.") }}</p></div></div><div class="row action_hide_on_inherit fonts-colors-row"><div class="col-md-3">
{% elseif fLastSlot == 'f1' or fLastSlot == 'f2' %}</div><div class="col-md-4">
{% elseif fLastSlot == 'c0' or fLastSlot == 'c1' or fLastSlot == 'c2' %}</div><div class="col-md-3">
{# 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' %}</div><div class="col-md-4">
{% endif %}
{% if fSlot == 'f1' %}<div class="row action_hide_on_inherit fonts-top-row"><div class="col-md-4">
{% if fSlot == 'fc1' %}<div class="row action_hide_on_inherit fonts-top-row"><div class="col-md-4">
{% 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'] %}</div>{% 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' %}</div></div>{% endif %}
{% if (tab.category == 'Default font and colors' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}</div></div>{% endif %}
</div>
{# row 150: the upload facility is NOT full-width at the bottom any more — it