From 9716aac4ee36acfa7692317fd261d23b2c06c1ae Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Wed, 25 Nov 2026 11:51:57 +0100 Subject: [PATCH] feat(options): Fonts tab becomes 'Fonts and colors' with per-element font+color combos (Prompt U) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tab 'Fonts' is renamed to 'Fonts and colors' and gets a dedicated layout: top row (col 1: font, fontcolor, fontsize; col 2: primarycolor + new secondarycolor; col 3 empty), an hr, then one combo row per element (header, progressbar, questiontitle, answers, grouptitle, groupdescription, buttons) with col 1 = existing font fontselect, col 2 = new textcolor dropdown (default|primary|secondary|other), col 3 = new textcolorcustom colorpicker, visible only when mode is 'other' (parent show-value via aShowIfValues, server-side initial d-none, options.js updateVisibilityByParent/updateChild now handle select parents, multi-value aware; font's self-parent removed from config.xml). config.xml: fontcolor/primarycolor moved from Colors to Fonts (retitled 'Default font color (body text)' / 'Primary color'), secondarycolor added (default #888888), 14 per-element color keys added with dropdownoptions. Views emit the per-element color as inline style (default->fontcolor, primary->primarycolor, secondary->secondarycolor, other->custom picker). Colors tab now only holds sliderhandlecolor + privacybackgroundcolor (final Colors layout = Prompt T, still open). Variants rebuilt (defensie, erasmus, example respondage_respondage) — no unknown-key failures; theme reset in LS-admin still owner action. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- config.xml | 114 +++++++-- options/options.js | 44 +++- options/options.twig | 78 +++++-- .../example/respondage_respondage/config.xml | 221 ++++++++++++------ views/subviews/header/nav_bar.twig | 7 +- views/subviews/header/progress_bar.twig | 7 +- views/subviews/navigation/navigator.twig | 7 +- .../survey/group_subviews/group_desc.twig | 7 +- .../survey/group_subviews/group_name.twig | 7 +- .../survey/question_subviews/answers.twig | 7 +- .../question_text_container.twig | 7 +- .../survey_question_help.twig | 7 +- .../valid_message_and_help.twig | 7 +- 13 files changed, 398 insertions(+), 122 deletions(-) diff --git a/config.xml b/config.xml index ca60f5c..074e381 100644 --- a/config.xml +++ b/config.xml @@ -194,13 +194,17 @@ + slider, progressbar, privacy) are house-style colors and are set per + variant via variants/.json. + NOTE (Prompt U): primarycolor, fontcolor and the new secondarycolor + moved to the "Fonts" category (they live in the "Fonts and colors" + tab now); header/navbar/progressbar colors are pulled into the + "Top of the page" tab by options.twig. What remains here in the + Colors pane: sliderhandlecolor + privacybackgroundcolor (final + Colors layout = Prompt T, still open). --> #eeeeee #444444 - #5e1c64 - #444444 #5e1c64 #eeeeee #5e1c64 @@ -245,7 +249,7 @@ + the "Bundled open source fonts" optgroup below). --> - noto_sans + noto_sans @@ -275,22 +279,92 @@ - - base - base - base - base - base - base - base + + #444444 16px + #5e1c64 + #888888 + + 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 diff --git a/options/options.js b/options/options.js index d82e50d..b4e3f62 100644 --- a/options/options.js +++ b/options/options.js @@ -311,14 +311,22 @@ var ThemeOptions = function () { let enabled = true; if(parentEl.length) { - // THEME ADDITION (Prompt R): parentEl is a SET of radios — read the - // CHECKED one (not the first element) and accept any of the wrapper's - // show-values (data-show-if-value, pipe-separated). Single-value - // parents ('on') behave exactly as before. - const checked = parentEl.filter(':checked'); const wrapper = $(childEl).closest('.option-visibility'); const showValues = String(wrapper.data('show-if-value') || 'on').split('|'); - enabled = checked.length > 0 && showValues.indexOf(String(checked.val())) !== -1; + // THEME ADDITION (Prompt U): the parent may also be a