Skip to content

Commit 33c3048

Browse files
authored
fix(gui): color of the UI on dark mode (e.g. windows control, active sidebar) (#1161)
* update theme service to improve color handling and SVG icon styling * enhance sidebar item colors for better visibility * Fix the whitespace
1 parent 7ed779b commit 33c3048

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/gui/src/css/style.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ pre {
8989
--primary-lightness: 93.33%;
9090
--primary-alpha: 0.8;
9191
--primary-color: #373e44;
92+
--primary-color-icon: invert(0);
93+
--primary-color-sidebar-item: #fefeff;
9294

9395
--window-head-hue: var(--primary-hue);
9496
--window-head-saturation: var(--primary-saturation);
@@ -1235,7 +1237,7 @@ span.header-sort-icon img {
12351237
}
12361238

12371239
.window-sidebar-item:hover, .window-sidebar-item.has-open-contextmenu {
1238-
background-color: rgba(243, 243, 243, 0.8);
1240+
background-color: #5a5d6155;
12391241
cursor: pointer;
12401242
}
12411243

@@ -1244,7 +1246,7 @@ span.header-sort-icon img {
12441246
margin-top: 2px;
12451247
padding: 4px;
12461248
border-radius: 3px;
1247-
color: #444444;
1249+
color: var(--primary-color);
12481250
font-size: 13px;
12491251
cursor: pointer;
12501252
transition: 0.15s background-color;
@@ -1256,7 +1258,7 @@ span.header-sort-icon img {
12561258
}
12571259

12581260
.window-sidebar-item-active, .window-sidebar-item-drag-active, .window-sidebar-item-active:hover {
1259-
background-color: #fefeff;
1261+
background-color: var(--primary-color-sidebar-item);
12601262
}
12611263

12621264
.window-sidebar-item-placeholder {
@@ -1404,6 +1406,7 @@ span.header-sort-icon img {
14041406
-moz-user-select: none;
14051407
-webkit-user-select: none;
14061408
-ms-user-select: none;
1409+
filter: var(--primary-color-icon);
14071410
}
14081411

14091412
.window-action-btn:hover>img {

src/gui/src/services/ThemeService.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ export class ThemeService extends Service {
121121
this.root.style.setProperty('--primary-lightness', s.lig + '%');
122122
this.root.style.setProperty('--primary-alpha', s.alpha);
123123
this.root.style.setProperty('--primary-color', s.light_text ? 'white' : '#373e44');
124+
this.root.style.setProperty('--primary-color-icon', s.light_text ? 'invert(1)' : 'invert(0)');
125+
this.root.style.setProperty('--primary-color-sidebar-item', s.light_text ? '#5a5d61aa' : '#fefeff');
124126

125127
// TODO: Should we debounce this to reduce traffic?
126128
this.#broadcastService.sendBroadcast('themeChanged', {

0 commit comments

Comments
 (0)