From 931d61b13d6cd79c6f3337b45c9d3eecee39dc07 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Sun, 29 Nov 2026 16:54:28 +0100 Subject: [PATCH] =?UTF-8?q?fix(views):=20row=20201=20=E2=80=94=20emit=20th?= =?UTF-8?q?e=20border-radius=20values=20as-is=20(they=20already=20carry=20?= =?UTF-8?q?px/rem)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The duration options store e.g. "5px", but custom_header.twig appended "px" again, rendering border-radius: 5pxpx ... — invalid, so the browser dropped the declaration and no radius showed in the survey. Values are now emitted unchanged, with a ^(px|rem)$ guard falling back to 5px (regex written backslash-free: [0-9], [.]). Verified live: 5px renders, 1.5rem renders, invalid values fall back to 5px. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- views/subviews/header/custom_header.twig | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/views/subviews/header/custom_header.twig b/views/subviews/header/custom_header.twig index 84509cf..796a045 100644 --- a/views/subviews/header/custom_header.twig +++ b/views/subviews/header/custom_header.twig @@ -159,16 +159,30 @@ } {% endif %} + {# Row 201: the border radii are duration options — the stored value already + carries the unit ("5px", "0.5rem"), so emit it AS-IS. (Appending "px" here + rendered "5pxpx" — an invalid declaration the browser silently drops, so no + radius showed in the survey at all.) Values not matching (px|rem) + fall back to 5px. The regex deliberately uses [0-9] and [.] instead of + backslash escapes to avoid twig-string/PCRE escaping pitfalls. #} + {% set sRadiusTL = aSurveyInfo.options.questionborderradiusTL|default('5px') %} + {% set sRadiusTR = aSurveyInfo.options.questionborderradiusTR|default('5px') %} + {% set sRadiusBR = aSurveyInfo.options.questionborderradiusBR|default('5px') %} + {% set sRadiusBL = aSurveyInfo.options.questionborderradiusBL|default('5px') %} + {% set sRadiusTL = sRadiusTL matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusTL : '5px' %} + {% set sRadiusTR = sRadiusTR matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusTR : '5px' %} + {% set sRadiusBR = sRadiusBR matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusBR : '5px' %} + {% set sRadiusBL = sRadiusBL matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusBL : '5px' %} .question-container, #welcome-container, .save-form, #surveys-list-container, .privacy { - border-radius: {{ aSurveyInfo.options.questionborderradiusTL }}px {{ aSurveyInfo.options.questionborderradiusTR }}px {{ aSurveyInfo.options.questionborderradiusBR }}px {{ aSurveyInfo.options.questionborderradiusBL }}px; + border-radius: {{ sRadiusTL }} {{ sRadiusTR }} {{ sRadiusBR }} {{ sRadiusBL }}; } .question-title-container{ - border-radius: {{ aSurveyInfo.options.questionborderradiusTL }}px {{ aSurveyInfo.options.questionborderradiusTR }}px 0 0; + border-radius: {{ sRadiusTL }} {{ sRadiusTR }} 0 0; } {% if (aSurveyInfo.options.questiondropdown == "on" ) %}