Skip to content

Commit fabe1c2

Browse files
authored
fix(ui): scrollbar stabilize width to prevent layout jumps and fix color (#1038)
1 parent bd6265b commit fabe1c2

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

app/assets/main.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ html {
155155
-moz-osx-font-smoothing: grayscale;
156156
text-rendering: optimizeLegibility;
157157
scroll-padding-top: 5rem; /* Offset for fixed header - otherwise anchor headers are cutted */
158+
scrollbar-gutter: stable;
158159
}
159160

160161
/*
@@ -229,6 +230,10 @@ select:focus-visible {
229230
}
230231

231232
/* Scrollbar styling */
233+
* {
234+
scrollbar-color: var(--border) var(--bg);
235+
}
236+
232237
::-webkit-scrollbar {
233238
width: 8px;
234239
height: 8px;
@@ -244,14 +249,13 @@ select:focus-visible {
244249
}
245250

246251
::-webkit-scrollbar-thumb:hover {
247-
background: #404040;
252+
background: var(--border-hover);
248253
}
249254

250255
/* Scrollbar styling for Firefox */
251256
@supports not selector(::-webkit-scrollbar) {
252257
* {
253258
scrollbar-width: thin;
254-
scrollbar-color: var(--border) var(--bg);
255259
}
256260
}
257261

app/pages/package/[...package].vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,23 +1344,23 @@ onKeyStroke(
13441344
@media (min-width: 1024px) {
13451345
.sidebar-scroll {
13461346
scrollbar-gutter: stable;
1347-
scrollbar-width: none;
1347+
scrollbar-width: 8px;
1348+
scrollbar-color: transparent transparent;
13481349
}
13491350
13501351
.sidebar-scroll::-webkit-scrollbar {
1351-
width: 0;
1352-
height: 0;
1352+
width: 8px;
1353+
height: 8px;
13531354
}
13541355
1355-
.sidebar-scroll:hover,
1356-
.sidebar-scroll:focus-within {
1357-
scrollbar-width: auto;
1356+
.sidebar-scroll::-webkit-scrollbar-track,
1357+
.sidebar-scroll::-webkit-scrollbar-thumb {
1358+
background: transparent;
13581359
}
13591360
1360-
.sidebar-scroll:hover::-webkit-scrollbar,
1361-
.sidebar-scroll:focus-within::-webkit-scrollbar {
1362-
width: 8px;
1363-
height: 8px;
1361+
.sidebar-scroll:hover,
1362+
.sidebar-scroll:focus-within {
1363+
scrollbar-color: var(--border) transparent;
13641364
}
13651365
13661366
.sidebar-scroll:hover::-webkit-scrollbar-thumb,

0 commit comments

Comments
 (0)