Skip to content

Commit c49342a

Browse files
authored
style: inject scrollbar style (#340)
1 parent 9397fb0 commit c49342a

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/App.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,45 @@ const previewOptions = {
2626
presets: [],
2727
}
2828
<\/script>
29+
<style>
30+
:root {
31+
--scrollbar-size: 6px;
32+
}
33+
* {
34+
scrollbar-color: var(--el-scrollbar-bg-color) var(--el-fill-color-light);
35+
}
36+
::-webkit-scrollbar {
37+
width: var(--scrollbar-size);
38+
}
39+
40+
::-webkit-scrollbar:horizontal {
41+
height: var(--scrollbar-size);
42+
}
43+
44+
::-webkit-scrollbar-track {
45+
border-radius: 10px;
46+
}
47+
48+
::-webkit-scrollbar-thumb {
49+
background-color: rgba(0, 0, 0, 0.2);
50+
border-radius: 10px;
51+
transition: all 0.2s ease-in-out;
52+
53+
&:hover {
54+
cursor: pointer;
55+
background-color: rgba(0, 0, 0, 0.3);
56+
}
57+
}
58+
59+
.dark {
60+
::-webkit-scrollbar-thumb {
61+
background-color: rgba(255, 255, 255, 0.2);
62+
&:hover {
63+
background-color: rgba(255, 255, 255, 0.4);
64+
}
65+
}
66+
}
67+
</style>
2968
`,
3069
}
3170

0 commit comments

Comments
 (0)