Skip to content

Commit 3355d7d

Browse files
committed
feat: add custom scrollbar styles for dark mode #1442
1 parent 545cdde commit 3355d7d

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

app/src/App.vue

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,68 @@ loadTranslations(route)
9595
padding-bottom: 0;
9696
}
9797
}
98+
99+
// 暗夜模式滚动条样式
100+
::-webkit-scrollbar {
101+
width: 8px;
102+
height: 8px;
103+
}
104+
105+
::-webkit-scrollbar-track {
106+
background: #1a1a1a;
107+
border-radius: 4px;
108+
}
109+
110+
::-webkit-scrollbar-thumb {
111+
background: #3a3a3a;
112+
border-radius: 4px;
113+
transition: background 0.3s ease;
114+
115+
&:hover {
116+
background: #4a4a4a;
117+
}
118+
119+
&:active {
120+
background: #555555;
121+
}
122+
}
123+
124+
// Firefox 滚动条样式
125+
* {
126+
scrollbar-width: thin;
127+
scrollbar-color: #3a3a3a #1a1a1a;
128+
}
129+
}
130+
131+
// 浅色模式滚动条样式
132+
::-webkit-scrollbar {
133+
width: 8px;
134+
height: 8px;
135+
}
136+
137+
::-webkit-scrollbar-track {
138+
background: #f0f0f0;
139+
border-radius: 4px;
140+
}
141+
142+
::-webkit-scrollbar-thumb {
143+
background: #d0d0d0;
144+
border-radius: 4px;
145+
transition: background 0.3s ease;
146+
147+
&:hover {
148+
background: #b0b0b0;
149+
}
150+
151+
&:active {
152+
background: #909090;
153+
}
154+
}
155+
156+
// Firefox 滚动条样式
157+
* {
158+
scrollbar-width: thin;
159+
scrollbar-color: #d0d0d0 #f0f0f0;
98160
}
99161
100162
.ant-layout-header {

0 commit comments

Comments
 (0)