fix(options): move options-page chip styles inline into options.twig

The admin options page (themeOptions/update) does NOT load the theme's
css/plain.css — that file is registered for survey pages only — so the swatch
chip styles added there never applied on the options page: with the new JS
(hex label element) but old/absent CSS the swatches collapsed to tiny buttons
with the hex beside them. The chip/disable-mode styles are options-page-only
UI, so they now live in an inline <style> block in options/options.twig (always
rendered with the page, twig auto_reload — no asset cache involved) and were
removed from css/plain.css (sass source kept in sync). No options.js change, so
OPTIONS_JS_TOKEN stays 20261126.3. jsdom test now asserts gap:10px and the
column layout against the inline <style>; suite 6/6, export 0. 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 14:20:21 +01:00
commit 75ff90ab85
2 changed files with 62 additions and 63 deletions

View file

@ -227,68 +227,8 @@ div.qvideo .question-valid-container {
margin-left: 0; margin-left: 0;
} }
/* Row 115: "disable" mode for parented options (navbarfontcolor working example) — /* NOTE: the swatch-chip / disable-mode styles for the options page live INLINE in
the child stays visible but grayed out; swatch chips + effective-color swatch. */ options/options.twig (<style> block) — the admin options page does not load
.option-visibility-disable .mb-3 { css/plain.css, so they would not apply from here (rows 117-119). */
opacity: 0.55;
}
/* Full column width: the chips row sits in its own block under the dropdown
(sel.after(chips) in options.js) and stretches to the column's full width.
10px between the swatches so they stand out; the hex value sits BELOW each
swatch in .color-chip-label (inside the swatch it was unreadable). */
.color-mode-chips {
display: flex;
width: 100%;
gap: 10px;
margin-top: 0.4rem;
}
.color-chip-item {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.color-chip {
width: 100%;
height: 1.6rem;
padding: 0;
border: 1px solid rgba(0, 0, 0, 0.35);
border-radius: 0.25rem;
cursor: pointer;
background: transparent;
}
.color-chip-label {
font-size: 0.65rem;
color: #6c757d;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.color-chip.active {
outline: 2px solid currentColor;
outline-offset: 1px;
}
.color-chip:focus-visible {
outline: 2px solid #0d6efd;
outline-offset: 1px;
}
.color-mode-effective {
display: inline-block;
width: 1.1rem;
height: 1.1rem;
border: 1px solid rgba(0, 0, 0, 0.35);
border-radius: 0.25rem;
vertical-align: middle;
background: transparent;
}
/*# sourceMappingURL=plain.css.map */ /*# sourceMappingURL=plain.css.map */

View file

@ -105,6 +105,65 @@
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i> <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
</div> </div>
{# Options-page-only styles, INLINE on purpose: this admin page does NOT load the
theme's css/plain.css (that is registered for survey pages only), so anything
styled from plain.css would be unstyled here. These rules cover the
navbarfontcolor working example (row 115-118): the preset swatch chips under
the dropdown (full column width, 10px gap, hex label BELOW each swatch) and
the grayed-out look of "disable"-mode children (visible but dimmed). #}
<style>
.option-visibility-disable .mb-3 {
opacity: 0.55;
}
.color-mode-chips {
display: flex;
width: 100%;
gap: 10px;
margin-top: 0.4rem;
}
.color-chip-item {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.color-chip {
width: 100%;
height: 1.6rem;
padding: 0;
border: 1px solid rgba(0, 0, 0, 0.35);
border-radius: 0.25rem;
cursor: pointer;
background: transparent;
}
.color-chip.active {
outline: 2px solid currentColor;
outline-offset: 1px;
}
.color-chip:focus-visible {
outline: 2px solid #0d6efd;
outline-offset: 1px;
}
.color-chip-label {
font-size: 0.65rem;
color: #6c757d;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.color-mode-effective {
display: inline-block;
width: 1.1rem;
height: 1.1rem;
border: 1px solid rgba(0, 0, 0, 0.35);
border-radius: 0.25rem;
vertical-align: middle;
background: transparent;
}
</style>
{# If this is a survey-specific (or survey-group) settings page, offer full inheritance of the parent template #} {# If this is a survey-specific (or survey-group) settings page, offer full inheritance of the parent template #}
{% if bInherit %} {% if bInherit %}
<div class="row" id="general_inherit_active"> <div class="row" id="general_inherit_active">