Skip to content

Commit 54c4402

Browse files
committed
fix: fix a issue which will make sidebar hover label not clear
1 parent 62faa9e commit 54c4402

2 files changed

Lines changed: 39 additions & 4 deletions

File tree

src/dao/browser/ui/webui/resources/sidebar/dao_tab_item.ts

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,39 @@ export class DaoTabItem extends CrLitElement {
2727
cursor: default;
2828
gap: 8px;
2929
position: relative;
30-
transition: background 0.15s ease;
30+
transition: background 0.12s ease, box-shadow 0.12s ease;
3131
}
3232
3333
.tab-row:hover {
34-
background: var(--ink-drop);
34+
background: var(--ink-drop-strong, rgba(0, 0, 0, 0.06));
3535
}
3636
37-
:host([active]) .tab-row {
37+
/* Active state — explicitly defined for both hover and non-hover to
38+
* defend against CSS specificity edge cases and ensure the active
39+
* row never reverts to the hover background. The accent-tinted
40+
* hairline ring gives the active tab a clear boundary so users can
41+
* distinguish it from the surrounding sidebar even when the
42+
* translucent white surface blends into a light background. */
43+
:host([active]) .tab-row,
44+
:host([active]) .tab-row:hover {
3845
background: var(--surface-active);
39-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
46+
box-shadow: 0 0 0 0.5px rgba(70, 120, 190, 0.24),
47+
0 1px 3px rgba(0, 0, 0, 0.10),
4048
0 1px 2px rgba(0, 0, 0, 0.06);
4149
}
4250
51+
@media (prefers-color-scheme: dark) {
52+
.tab-row:hover {
53+
background: var(--ink-drop-strong, rgba(255, 255, 255, 0.10));
54+
}
55+
:host([active]) .tab-row,
56+
:host([active]) .tab-row:hover {
57+
box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.14),
58+
0 1px 3px rgba(0, 0, 0, 0.30),
59+
0 1px 2px rgba(0, 0, 0, 0.18);
60+
}
61+
}
62+
4363
.favicon {
4464
width: 16px;
4565
height: 16px;
@@ -91,6 +111,15 @@ export class DaoTabItem extends CrLitElement {
91111
color: var(--text-primary);
92112
}
93113
114+
/* Reaffirm title color under active state. Defensive: keeps text
115+
* legible even if a stale CSS variable from a media-query transition
116+
* briefly leaks (e.g. system theme auto-switch) and prevents
117+
* "white-on-white" symptoms on the near-white active surface. */
118+
:host([active]) .title {
119+
color: var(--text-primary);
120+
font-weight: 500;
121+
}
122+
94123
.audio-btn {
95124
width: 16px;
96125
height: 16px;

src/dao/browser/ui/webui/resources/sidebar/sidebar.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
--accent: rgb(70, 120, 190);
1212
--accent-subtle: rgba(70, 120, 190, 0.10);
1313
--ink-drop: rgba(0, 0, 0, 0.04);
14+
/* Stronger hover ink-drop used by primary row hovers (tabs, folders).
15+
* The base --ink-drop is too subtle (4% black) for primary navigation
16+
* surfaces; the strong variant gives clearer feedback without changing
17+
* tertiary hover affordances (icon buttons, scrollbar, etc.). */
18+
--ink-drop-strong: rgba(0, 0, 0, 0.07);
1419
--scrollbar-thumb: rgba(0, 0, 0, 0.15);
1520
--scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);
1621
--radius-tab: 12px;
@@ -29,6 +34,7 @@
2934
--text-muted: rgba(255, 255, 255, 0.40);
3035
--accent-subtle: rgba(70, 120, 190, 0.18);
3136
--ink-drop: rgba(255, 255, 255, 0.06);
37+
--ink-drop-strong: rgba(255, 255, 255, 0.10);
3238
--scrollbar-thumb: rgba(255, 255, 255, 0.18);
3339
--scrollbar-thumb-hover: rgba(255, 255, 255, 0.30);
3440
}

0 commit comments

Comments
 (0)