Skip to content

Commit c4d9def

Browse files
feat: drive checkbox/radio input colors from theme CSS variables
The custom-styled checkbox/radio inputs hardcoded their colors (#3498db, #eee, etc.) in the @supports block, so themes could not restyle them. Introduce --colorInput* variables in the base :root (deriving active/border from the existing accent vars) and have the input block consume them. Add dark-theme overrides that darken the unchecked and disabled surfaces so the controls no longer render as light-grey boxes on the dark background. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 648f0ea commit c4d9def

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

web/skins/classic/css/base/skin.css

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
--colorLink: #3498db;
3131
--colorBackgroundButtons: #3498db;
3232
--colorBorder: #3498db;
33+
34+
/* Custom-styled checkbox/radio inputs. Themes override these in their own
35+
:root so the controls restyle automatically. */
36+
--colorInputActive: var(--colorBackgroundButtons);
37+
--colorInputActiveInner: #eee;
38+
--colorInputBorder: var(--colorBorder);
39+
--colorInputBorderHover: var(--colorBorder);
40+
--colorInputBackground: #eee;
41+
--colorInputFocus: rgba(39, 94, 254, 0.3);
42+
--colorInputDisabled: #f6f8ff;
43+
--colorInputDisabledInner: #e1e6f9;
3344
}
3445

3546
html,
@@ -1346,14 +1357,14 @@ button.btn.btn-view-watch:hover {
13461357
/* +++ Style for <input> +++ */
13471358
@supports (-webkit-appearance: none) or (-moz-appearance: none) {
13481359
input[type='checkbox'], input[type='radio'] {
1349-
--active: #3498db;
1350-
--active-inner: #eee;
1351-
--focus: 2px rgba(39, 94, 254, 0.3);
1352-
--border: #3498db;
1353-
--border-hover: #3498db;
1354-
--background: #eee;
1355-
--disabled: #F6F8FF;
1356-
--disabled-inner: #E1E6F9;
1360+
--active: var(--colorInputActive);
1361+
--active-inner: var(--colorInputActiveInner);
1362+
--focus: 2px var(--colorInputFocus);
1363+
--border: var(--colorInputBorder);
1364+
--border-hover: var(--colorInputBorderHover);
1365+
--background: var(--colorInputBackground);
1366+
--disabled: var(--colorInputDisabled);
1367+
--disabled-inner: var(--colorInputDisabledInner);
13571368
-webkit-appearance: none;
13581369
-moz-appearance: none;
13591370
appearance: none;

web/skins/classic/css/dark/skin.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
--sliderBG: #95AFC0;
2727
--alarmBG: #352424;
2828
--backgroundMediumDark: #485460;
29+
30+
/* Custom-styled checkbox/radio inputs tuned for the dark background. The
31+
active fill keeps the accent colour (--colorBackgroundButtons) and the
32+
checkmark/dot stays light (--colorInputActiveInner) for contrast against
33+
it; only the unchecked/disabled surfaces need darkening so they don't
34+
glow on the dark page. */
35+
--colorInputBackground: #2c2c2c;
36+
--colorInputDisabled: #333333;
37+
--colorInputDisabledInner: #555555;
2938
}
3039

3140
body {

0 commit comments

Comments
 (0)