Skip to content

Commit 3e78a87

Browse files
committed
Improve scrollbar styling throughout site
1 parent 26a5ada commit 3e78a87

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

src/components/GitHubActivityCalendar.astro

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,19 @@ const activityYear = getYear(parseISO(firstActivity.date))
190190
const weeks = groupByWeeks(activities, weekStart)
191191
const labels = {
192192
months: [
193-
'Jan',
194-
'Feb',
195-
'Mar',
196-
'Apr',
197-
'May',
198-
'Jun',
199-
'Jul',
200-
'Aug',
201-
'Sep',
202-
'Oct',
203-
'Nov',
204-
'Dec',
205-
],
193+
'Jan',
194+
'Feb',
195+
'Mar',
196+
'Apr',
197+
'May',
198+
'Jun',
199+
'Jul',
200+
'Aug',
201+
'Sep',
202+
'Oct',
203+
'Nov',
204+
'Dec',
205+
],
206206
totalCount: `{{count}} contributions in ${year === 'last' ? 'the last year' : '{{year}}'}`,
207207
legend: {
208208
less: 'Less',
@@ -218,7 +218,13 @@ const height = labelHeight + (blockSize + blockMargin) * 7 - blockMargin
218218
id="github-activity-calendar"
219219
class="w-max max-w-full flex flex-col gap-2 text-sm"
220220
>
221-
<div class="max-w-full overflow-x-auto pt-0.5">
221+
<div
222+
class="max-w-full overflow-x-auto pt-0.5"
223+
style={{
224+
// Don't cover the calendar with the scrollbar.
225+
scrollbarGutter: 'stable',
226+
}}
227+
>
222228
<svg
223229
class="block visible"
224230
width={width}

src/styles/global.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ header {
3535
navigation: auto;
3636
}
3737

38+
* {
39+
/* Custom scrollbar styles */
40+
scrollbar-width: thin;
41+
scrollbar-color: color-mix(in oklab, var(--theme-accent) 20%, transparent) transparent;
42+
}
43+
44+
html {
45+
/* Slightly more accented scrollbar for better visibility */
46+
scrollbar-color: color-mix(in oklab, var(--theme-accent) 30%, transparent) transparent !important;
47+
/* Prevents layout from jumping when opening theme select or search dialog menus */
48+
scrollbar-gutter: stable;
49+
}
50+
3851
body {
3952
@apply transition-colors;
4053
font-display: block;

0 commit comments

Comments
 (0)