fix(options): 15px after the last checkbox of a checkbox group (.checkbox-last)

The last checkbox of each consecutive checkbox run now gets the class
checkbox-last, styled margin-bottom: 15px in the page style block (beats
mb-1 by specificity), so there is 15px between a checkbox group (e.g.
'Make header sticky') and the following item. The 'Show logo on' boxes in
the Logos row get it via loop.last. Inner checkbox spacing stays mb-1
(row 176). jsdom: new row-177 assertions, suite 8/8.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 14:04:19 +01:00
commit c4d728445d

View file

@ -173,6 +173,12 @@
.action_update_options_string_form .form-label { .action_update_options_string_form .form-label {
font-size: 16px; font-size: 16px;
} }
/* row 177: 15px between the LAST checkbox of a checkbox group and the
following item (.checkbox-last is set in twig on the last checkbox of
each consecutive run; beats .mb-1 by specificity) */
.form-check.checkbox-last {
margin-bottom: 15px;
}
/* row 128/130: the section headers this page inserts (h2 inside the tab /* row 128/130: the section headers this page inserts (h2 inside the tab
panes, e.g. "Header", "Logos", "Page background") — 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. h1-sized, which turned out too big, so row 130 fixes them at 24px.
@ -401,6 +407,18 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{# row 177: keys of the LAST checkbox of each consecutive checkbox run in this
tab — its .form-check gets the extra class .checkbox-last (margin-bottom:
15px, see the style block), so there is 15px between a checkbox group and
the following item #}
{% set aLastCheckboxKeys = [] %}
{% for ck in aTabKeys %}
{% set cka = aOptionAttributes.optionAttributes[ck] ?? null %}
{% if cka is not null and cka.type == 'checkbox' %}
{% set nka = aOptionAttributes.optionAttributes[aTabKeys[loop.index] ?? ''] ?? null %}
{% if nka is null or nka.type != 'checkbox' %}{% set aLastCheckboxKeys = aLastCheckboxKeys|merge([ck]) %}{% endif %}
{% endif %}
{% endfor %}
<div role="tabpanel" class="CoreThemeOptions--settingsTab tab-pane {% if loop.first %}active{% endif %}" <div role="tabpanel" class="CoreThemeOptions--settingsTab tab-pane {% if loop.first %}active{% endif %}"
id="{{ tab.id }}" aria-labelledby="tab-{{ tab.id }}"> id="{{ tab.id }}" aria-labelledby="tab-{{ tab.id }}">
{% if tab.id == 'top-of-page' %} {% if tab.id == 'top-of-page' %}
@ -579,7 +597,7 @@
{% set ckey = pos ~ 'showon' ~ dev %} {% set ckey = pos ~ 'showon' ~ dev %}
{% set cattr = aOptionAttributes.optionAttributes[ckey] %} {% set cattr = aOptionAttributes.optionAttributes[ckey] %}
{% set ccv = bGeneralInherit ? 'inherit' : (aCurrentOptions[ckey] is defined ? aCurrentOptions[ckey] : (oParentOptions[ckey] is defined ? oParentOptions[ckey] : '')) %} {% set ccv = bGeneralInherit ? 'inherit' : (aCurrentOptions[ckey] is defined ? aCurrentOptions[ckey] : (oParentOptions[ckey] is defined ? oParentOptions[ckey] : '')) %}
<div class="form-check mb-1"> <div class="form-check mb-1{% if loop.last %} checkbox-last{% endif %}">
<input type="checkbox" value="on" <input type="checkbox" value="on"
{% if ccv == 'on' %}checked{% endif %} {% if ccv == 'on' %}checked{% endif %}
class="form-check-input selector_option_checkbox_field" class="form-check-input selector_option_checkbox_field"
@ -738,8 +756,10 @@
of a parent switch get selector_radio_childfield + data-parent. of a parent switch get selector_radio_childfield + data-parent.
Row 176: mb-1 on the .form-check (exactly like the "Show logo on" Row 176: mb-1 on the .form-check (exactly like the "Show logo on"
boxes in the Logos row) — the distance between the checkbox rows boxes in the Logos row) — the distance between the checkbox rows
is then the same in every row of the page. #} is then the same in every row of the page. Row 177: the LAST
<div class="form-check mb-1"> checkbox of a run also gets .checkbox-last (margin-bottom 15px)
for the gap to the following item. #}
<div class="form-check mb-1{% if key in aLastCheckboxKeys %} checkbox-last{% endif %}">
<input type="checkbox" value="on" <input type="checkbox" value="on"
{% if currentValue == 'on' %}checked{% endif %} {% if currentValue == 'on' %}checked{% endif %}
class="form-check-input selector_option_checkbox_field {% if attr.parent != '' %}selector_radio_childfield{% endif %}" class="form-check-input selector_option_checkbox_field {% if attr.parent != '' %}selector_radio_childfield{% endif %}"