Skip to content

Commit 8aad0a8

Browse files
Harden setup wizard contrast across themes
1 parent 579227d commit 8aad0a8

2 files changed

Lines changed: 56 additions & 4 deletions

File tree

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/styles/folderviewplus.css

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,10 +3765,12 @@ body.fv-mobile-compact .fv-setup-field-grid {
37653765
background: rgba(8, 12, 18, 0.985);
37663766
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
37673767
overflow: hidden;
3768-
color: var(--fvplus-settings-text-primary);
3769-
--fv-wizard-text-primary: var(--fvplus-settings-text-primary);
3770-
--fv-wizard-text-muted: var(--fvplus-settings-text-muted);
3771-
--fv-wizard-text-dim: var(--fvplus-settings-text-dim);
3768+
/* Keep wizard contrast stable regardless of host Unraid theme tokens. */
3769+
color-scheme: dark;
3770+
color: #e7eef9;
3771+
--fv-wizard-text-primary: #e7eef9;
3772+
--fv-wizard-text-muted: #c5d4e8;
3773+
--fv-wizard-text-dim: #a7bad1;
37723774
--fv-wizard-font-103: 1.03rem;
37733775
--fv-wizard-font-108: 1.08rem;
37743776
--fv-wizard-font-115: 1.15rem;
@@ -3781,6 +3783,40 @@ body.fv-mobile-compact .fv-setup-field-grid {
37813783
color: var(--fv-wizard-text-primary);
37823784
}
37833785

3786+
#fv-setup-assistant-dialog :is(
3787+
h1,
3788+
h2,
3789+
h3,
3790+
h4,
3791+
h5,
3792+
h6,
3793+
p,
3794+
span,
3795+
label,
3796+
legend,
3797+
li,
3798+
strong,
3799+
small,
3800+
dt,
3801+
dd,
3802+
th,
3803+
td
3804+
) {
3805+
color: inherit;
3806+
}
3807+
3808+
#fv-setup-assistant-dialog .fv-setup-assistant-shell button,
3809+
#fv-setup-assistant-dialog .fv-setup-assistant-shell .btn {
3810+
color: var(--fv-wizard-text-primary);
3811+
border-color: rgba(255, 255, 255, 0.22);
3812+
background: rgba(255, 255, 255, 0.05);
3813+
}
3814+
3815+
#fv-setup-assistant-dialog .fv-setup-assistant-shell button:disabled,
3816+
#fv-setup-assistant-dialog .fv-setup-assistant-shell .btn:disabled {
3817+
color: rgba(231, 238, 249, 0.68);
3818+
}
3819+
37843820
.fv-setup-assistant-shell input:not([type="checkbox"]):not([type="radio"]),
37853821
.fv-setup-assistant-shell select,
37863822
.fv-setup-assistant-shell textarea {

tests/theme-compatibility.test.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const settingsCssPath = path.join(
1515

1616
const settingsPage = fs.readFileSync(settingsPagePath, 'utf8');
1717
const settingsCss = fs.readFileSync(settingsCssPath, 'utf8');
18+
const wizardDialogBlocks = Array.from(settingsCss.matchAll(/#fv-setup-assistant-dialog\s*\{[\s\S]*?\n\}/g)).map((match) => match[0]);
19+
const wizardTokenBlock = wizardDialogBlocks.find((block) => /--fv-wizard-text-primary/.test(block)) || '';
1820

1921
test('settings page wraps plugin UI in a theme-safe root container', () => {
2022
assert.match(settingsPage, /<div id="fv-settings-root" class="fv-theme-safe">/);
@@ -32,3 +34,17 @@ test('theme compatibility: global focus and body selectors are scoped to plugin
3234
assert.doesNotMatch(settingsCss, /\nbody\s*\{/);
3335
assert.doesNotMatch(settingsCss, /\nbutton:focus-visible,\s*\ninput:focus-visible,/);
3436
});
37+
38+
test('theme compatibility: setup wizard enforces theme-safe dark contrast tokens', () => {
39+
assert.ok(wizardTokenBlock, 'Wizard token block should exist in settings CSS.');
40+
assert.match(wizardTokenBlock, /color-scheme:\s*dark/);
41+
assert.match(wizardTokenBlock, /--fv-wizard-text-primary:\s*#e7eef9/);
42+
assert.match(wizardTokenBlock, /--fv-wizard-text-muted:\s*#c5d4e8/);
43+
assert.match(wizardTokenBlock, /--fv-wizard-text-dim:\s*#a7bad1/);
44+
assert.doesNotMatch(wizardTokenBlock, /--fv-wizard-text-primary:\s*var\(--fvplus-settings-text-primary\)/);
45+
assert.doesNotMatch(wizardTokenBlock, /--fv-wizard-text-primary:\s*var\(--text/);
46+
assert.match(
47+
settingsCss,
48+
/#fv-setup-assistant-dialog\s+\.fv-setup-assistant-shell button,\s*\n#fv-setup-assistant-dialog\s+\.fv-setup-assistant-shell \.btn\s*\{[\s\S]*color:\s*var\(--fv-wizard-text-primary\)/
49+
);
50+
});

0 commit comments

Comments
 (0)