Skip to content

Commit a3a065b

Browse files
authored
feat(scrollbar): customize chat content scrollbar styles for better v… (#445)
* feat(scrollbar): customize chat content scrollbar styles for better visibility * feat(scrollbar): add custom scrollbar styles for Firefox in chat content * feat(scrollbar): add custom scrollbar styles for dark mode in Firefox
1 parent 13e7c3d commit a3a065b

3 files changed

Lines changed: 52 additions & 1 deletion

File tree

static/css/dark-mode.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,21 @@ html #chat-container {
318318
}
319319

320320
/* ===== 暗色模式:滚动条 ===== */
321+
/* Firefox 滚动条 */
322+
[data-theme="dark"] #chat-content-wrapper {
323+
scrollbar-color: rgba(255, 255, 255, 0.15) rgba(25, 25, 25, 0.95);
324+
}
325+
326+
[data-theme="dark"] #chat-content-wrapper:hover {
327+
scrollbar-color: rgba(255, 255, 255, 0.25) rgba(25, 25, 25, 0.95);
328+
}
329+
321330
[data-theme="dark"] #chat-content-wrapper::-webkit-scrollbar {
322331
width: 6px;
323332
}
324333

325334
[data-theme="dark"] #chat-content-wrapper::-webkit-scrollbar-track {
326-
background: rgba(255, 255, 255, 0.03);
335+
background: rgba(25, 25, 25, 0.95);
327336
}
328337

329338
[data-theme="dark"] #chat-content-wrapper::-webkit-scrollbar-thumb {

static/css/index.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,31 @@ button * {
348348
visibility: visible;
349349
background: rgba(249, 249, 249, 0.7);
350350
/* Fluent Design 背景层 */
351+
/* Firefox 滚动条 */
352+
scrollbar-width: thin;
353+
scrollbar-color: rgba(0, 0, 0, 0.15) rgba(249, 249, 249, 0.95);
354+
}
355+
356+
#chat-content-wrapper:hover {
357+
scrollbar-color: rgba(0, 0, 0, 0.25) rgba(249, 249, 249, 0.95);
358+
}
359+
360+
/* 聊天内容滚动条 - 防止透明窗口中滚动条轨道穿透桌面 */
361+
#chat-content-wrapper::-webkit-scrollbar {
362+
width: 6px;
363+
}
364+
365+
#chat-content-wrapper::-webkit-scrollbar-track {
366+
background: rgba(249, 249, 249, 0.95);
367+
}
368+
369+
#chat-content-wrapper::-webkit-scrollbar-thumb {
370+
background: rgba(0, 0, 0, 0.15);
371+
border-radius: 3px;
372+
}
373+
374+
#chat-content-wrapper::-webkit-scrollbar-thumb:hover {
375+
background: rgba(0, 0, 0, 0.25);
351376
}
352377

353378
/* 切换按钮样式 - 更醒目的设计 */

templates/viewer.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,23 @@
114114
background: #fff;
115115
}
116116

117+
#chat-content-wrapper::-webkit-scrollbar {
118+
width: 6px;
119+
}
120+
121+
#chat-content-wrapper::-webkit-scrollbar-track {
122+
background: rgba(255, 255, 255, 0.95);
123+
}
124+
125+
#chat-content-wrapper::-webkit-scrollbar-thumb {
126+
background: rgba(0, 0, 0, 0.15);
127+
border-radius: 3px;
128+
}
129+
130+
#chat-content-wrapper::-webkit-scrollbar-thumb:hover {
131+
background: rgba(0, 0, 0, 0.25);
132+
}
133+
117134
#toggle-chat-btn {
118135
pointer-events: auto;
119136
position: absolute;

0 commit comments

Comments
 (0)