Skip to content

Commit 407036c

Browse files
fix: improve scrollbar and support firefox (#51)
* feat: improve scrollbar * fix: improve scrollbar and support firefox * style: reformat code * adjust colors * do not show scrollbar for decl if not needed
1 parent 342d740 commit 407036c

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

src/components/decl-doc/Decl.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.decl {
1111
background-color: var(--sl-color-gray-6);
1212
border-bottom: 1px solid var(--sl-color-gray-5);
13-
overflow: scroll;
13+
overflow: auto;
1414
margin: 0;
1515
padding: 0 1em;
1616
}

src/styles/custom.css

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,41 @@
3030
}
3131

3232
/* Custom scrollbar */
33-
:root[data-theme="light"] ::-webkit-scrollbar-track {
34-
background: #f1f1f1;
33+
::-webkit-scrollbar {
34+
width: 4px;
35+
}
36+
37+
::-webkit-scrollbar-track {
38+
background-color: #e6f3ff;
39+
border-radius: 2px;
3540
}
3641

37-
:root[data-theme="light"] ::-webkit-scrollbar-thumb {
38-
background: #888;
42+
::-webkit-scrollbar-thumb {
43+
background-color: #87ceeb;
44+
border-radius: 2px;
3945
}
4046

41-
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
42-
background: #555;
47+
::-webkit-scrollbar-thumb:hover {
48+
background-color: #4682b4;
4349
}
4450

4551
:root[data-theme="dark"] ::-webkit-scrollbar-track {
46-
background: #2a2a2a;
52+
background-color: #1e3a5f;
4753
}
4854

4955
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
50-
background: #666;
56+
background-color: #4a90e2;
5157
}
5258

5359
:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
54-
background: #aaa;
60+
background-color: #5b9bd5;
5561
}
5662

57-
::-webkit-scrollbar {
58-
width: 8px;
63+
* {
64+
scrollbar-width: thin;
65+
scrollbar-color: #87ceeb #e6f3ff;
5966
}
6067

61-
::-webkit-scrollbar-thumb {
62-
border-radius: 4px;
68+
:root[data-theme="dark"] * {
69+
scrollbar-color: #4a90e2 #1e3a5f;
6370
}

0 commit comments

Comments
 (0)