fix(options): readable swatch chips + re-enable color swatch on 'Other'

Two fixes for the navbarfontcolor working example: (1) the hex value inside the
swatch chips was unreadable and obscured the color — chips are now plain color
swatches with the hex in a small label BELOW each swatch (.color-chip-label),
and the chips row uses gap: 10px so the swatches stand out. (2) The visible
color swatch input (navbarfontcolorcustom_picker) never re-enabled when
choosing 'Other…' from the dropdown: it lacked data-parent/selector_radio_childfield,
so updateChild/updateAllChildren never touched it and it stayed disabled
(server-side rendered disabled) — the text field was enabled but the swatch
the user actually clicks stayed grayed out. The swatch now gets the child
classes when parented, so it follows the mode like the text field (also fixes
the same latent bug for the per-element <el>textcolorcustom pickers).
OPTIONS_JS_TOKEN -> 20261126.3. jsdom test extended: swatch enabled in mode
'other'/disabled otherwise, hex below swatch, chip gap 10px asserted against
css/plain.css; suite 6/6, export 0. Variants intentionally not rebuilt.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-26 14:15:09 +01:00
commit f2316d1a5d

View file

@ -234,28 +234,41 @@ div.qvideo .question-valid-container {
}
/* 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. */
(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: 0.35rem;
gap: 10px;
margin-top: 0.4rem;
}
.color-chip {
.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 0.2rem;
padding: 0;
border: 1px solid rgba(0, 0, 0, 0.35);
border-radius: 0.25rem;
cursor: pointer;
background: transparent;
color: #fff;
text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}
.color-chip-label {
font-size: 0.65rem;
line-height: 1;
overflow: hidden;
color: #6c757d;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.color-chip.active {