feat(theme): default logos left/center/right + 30px top margin + 90px header bar

Row 138: default look of the mother theme:
- brandlogofile default -> ./files/logo-left.png (left)
- centerlogofile default -> ./files/logo.png (center, was "off")
- rightlogofile default -> ./files/logo-right.png (right, was "off")
  so all three logos are visible by default
- brand/center/rightlogotopmargin defaults 15 -> 30 (px added in the view)
- new option headerheight (Top of the page tab, col 3 next to the sticky
  checkboxes, default 90) applied in custom_header.twig as min-height on
  #survey-nav (min-height so taller logos can still grow the bar; the sticky
  body padding in scripts/custom.js follows the real nav height)
- sticky defaults were already computer on / tablet on / mobile off (unchanged)

Core normalizes ./files/x on theme reset to image::theme::files/x, so the
config defaults keep the ./files/ style like the existing one. The PNG files
logo-left.png / logo-right.png remain the owner's untracked files (Prompt PL).
Verified: options render tc=633 (headerheight field present, logo dropdowns
list all three files, divs balanced); live survey 282267 with the defaults
applied to the DB row: three logo imgs (logo-left/logo/logo-right),
padding-top 30px on all logo imgs, min-height 90px on #survey-nav, fixed-top
media queries only for computer+tablet (mobile non-sticky) — DB row restored
afterwards; jsdom 7/7; export exit 0. Theme reset needed for the new defaults
to land in the DB. Variants not rebuilt (deferred).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-26 19:41:12 +01:00
commit 1d0161374b
3 changed files with 31 additions and 14 deletions

View file

@ -105,24 +105,25 @@
FIRST option is "No logo" (value "off", prepended by options.twig), a top
margin in px (plain number 0-100; the views add the "px"), and "Show logo
on" checkboxes per device (Bootstrap breakpoints: mobile < 768px,
tablet 768-991px, computer >= 992px). Defaults: left logo on with
logo.png, center/right "off" (no logo); margin 15; show on computer and
tablet, NOT on mobile (same as the old hide-on-small default).
tablet 768-991px, computer >= 992px). Defaults (row 138): ALL THREE
logos on — left logo-left.png, center logo.png, right logo-right.png;
margin 30 px; show on computer and tablet, NOT on mobile (same as the
old hide-on-small default).
The old keys (brandlogo/centerlogo/rightlogo, *logohideonsmall, the shared
logotopmargin) were removed; variants/build.php maps the variant json's
old keys onto these new keys. -->
<brandlogofile type="imagefile" category="Images" width="12" title="Logo file (left)">./files/logo.png</brandlogofile>
<brandlogotopmargin type="text" category="Images" width="12" title="Margin between logo and top of screen (left), in px (0-100)">15</brandlogotopmargin>
<brandlogofile type="imagefile" category="Images" width="12" title="Logo file (left)">./files/logo-left.png</brandlogofile>
<brandlogotopmargin type="text" category="Images" width="12" title="Margin between logo and top of screen (left), in px (0-100)">30</brandlogotopmargin>
<brandshowoncomputer type="checkbox" category="Images" width="12" title="Computer screen">on</brandshowoncomputer>
<brandshowontablet type="checkbox" category="Images" width="12" title="Tablet">on</brandshowontablet>
<brandshowonmobile type="checkbox" category="Images" width="12" title="Mobile phone">off</brandshowonmobile>
<centerlogofile type="imagefile" category="Images" width="12" title="Logo file (center)">off</centerlogofile>
<centerlogotopmargin type="text" category="Images" width="12" title="Margin between logo and top of screen (center), in px (0-100)">15</centerlogotopmargin>
<centerlogofile type="imagefile" category="Images" width="12" title="Logo file (center)">./files/logo.png</centerlogofile>
<centerlogotopmargin type="text" category="Images" width="12" title="Margin between logo and top of screen (center), in px (0-100)">30</centerlogotopmargin>
<centershowoncomputer type="checkbox" category="Images" width="12" title="Computer screen">on</centershowoncomputer>
<centershowontablet type="checkbox" category="Images" width="12" title="Tablet">on</centershowontablet>
<centershowonmobile type="checkbox" category="Images" width="12" title="Mobile phone">off</centershowonmobile>
<rightlogofile type="imagefile" category="Images" width="12" title="Logo file (right)">off</rightlogofile>
<rightlogotopmargin type="text" category="Images" width="12" title="Margin between logo and top of screen (right), in px (0-100)">15</rightlogotopmargin>
<rightlogofile type="imagefile" category="Images" width="12" title="Logo file (right)">./files/logo-right.png</rightlogofile>
<rightlogotopmargin type="text" category="Images" width="12" title="Margin between logo and top of screen (right), in px (0-100)">30</rightlogotopmargin>
<rightshowoncomputer type="checkbox" category="Images" width="12" title="Computer screen">on</rightshowoncomputer>
<rightshowontablet type="checkbox" category="Images" width="12" title="Tablet">on</rightshowontablet>
<rightshowonmobile type="checkbox" category="Images" width="12" title="Mobile phone">off</rightshowonmobile>
@ -191,6 +192,12 @@
<headerstickycomputer type="checkbox" category="Top of the page" width="12" title="Computer screen">on</headerstickycomputer>
<headerstickytablet type="checkbox" category="Top of the page" width="12" title="Tablet">on</headerstickytablet>
<headerstickymobile type="checkbox" category="Top of the page" width="12" title="Mobile phone">off</headerstickymobile>
<!-- Row 138: header bar height. Applied as min-height on #survey-nav in
custom_header.twig (the "px" unit is added there; |replace guards against
a stored value that still carries the unit). min-height so taller logos
can still grow the bar — the sticky body padding follows nav.height().
Default 90 px. Sticky defaults above: computer + tablet on, mobile off. -->
<headerheight type="text" category="Top of the page" width="12" title="Header bar height, in px">90</headerheight>
<!-- Various colors
HOUSE-STYLE: ALL colorpickers in this section (header, navbar menu,

View file

@ -225,7 +225,7 @@
value. The order of this list is the order shown in the tab. #}
{% set aTopOfPageKeys = [
'headerfont', 'navbarfontcolor', 'navbarfontcolorcustom', 'headerbackgroundcolor', 'headerbackgroundcolorcustom',
'headersticky', 'headerstickycomputer', 'headerstickytablet', 'headerstickymobile',
'headersticky', 'headerstickycomputer', 'headerstickytablet', 'headerstickymobile', 'headerheight',
'brandlogofile', 'brandlogotopmargin', 'brandshowoncomputer', 'brandshowontablet', 'brandshowonmobile',
'centerlogofile', 'centerlogotopmargin', 'centershowoncomputer', 'centershowontablet', 'centershowonmobile',
'rightlogofile', 'rightlogotopmargin', 'rightshowoncomputer', 'rightshowontablet', 'rightshowonmobile',
@ -381,6 +381,7 @@
{% elseif key == 'navbarfontcolorcustom' %}{% set fSlot = 'h1' %}
{% elseif key == 'headerbackgroundcolor' %}{% set fSlot = 'h2' %}
{% elseif key == 'headerbackgroundcolorcustom' %}{% set fSlot = 'h2' %}
{% elseif key == 'headerheight' %}{% set fSlot = 'h3' %}
{% elseif key in aTopStickyKeys %}{% set fSlot = 'h3' %}
{% elseif key == 'progressbarposition' %}{% set fSlot = 'ppos' %}
{% elseif key == 'progressbarfont' %}{% set fSlot = 'pfont' %}

View file

@ -184,15 +184,24 @@
{# Prompt M: per-logo top margin (options <pos>logotopmargin hold a plain px
number 0-100; the "px" unit is added here. |replace({'px':''}) guards
against a legacy stored value that still carries the unit. #}
against a legacy stored value that still carries the unit. Row 138
default: 30 px. #}
#survey-nav .logo-left > img {
padding-top: {{ aSurveyInfo.options.brandlogotopmargin|default('15')|replace({'px': ''}) }}px;
padding-top: {{ aSurveyInfo.options.brandlogotopmargin|default('30')|replace({'px': ''}) }}px;
}
#survey-nav .logo-center > img {
padding-top: {{ aSurveyInfo.options.centerlogotopmargin|default('15')|replace({'px': ''}) }}px;
padding-top: {{ aSurveyInfo.options.centerlogotopmargin|default('30')|replace({'px': ''}) }}px;
}
#survey-nav .logo-right > img {
padding-top: {{ aSurveyInfo.options.rightlogotopmargin|default('15')|replace({'px': ''}) }}px;
padding-top: {{ aSurveyInfo.options.rightlogotopmargin|default('30')|replace({'px': ''}) }}px;
}
{# Row 138: header bar height (option headerheight, plain px number; the "px"
unit is added here, |replace guards a legacy value with the unit). Applied
as min-height so taller logos can still grow the bar — the sticky body
padding in scripts/custom.js follows the real nav height. #}
#survey-nav {
min-height: {{ aSurveyInfo.options.headerheight|default('90')|replace({'px': ''}) }}px;
}
{# Row 115 working example: navbarfontcolor is now a MODE dropdown