Skip to content

Commit 9c6dabb

Browse files
authored
Merge a15f784 into 809166f
2 parents 809166f + a15f784 commit 9c6dabb

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

special-pages/pages/history/app/components/App.module.css

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ body {
1313
--sidebar-width: 250px;
1414
--main-padding-left: 48px;
1515
--main-padding-right: 76px;
16-
--windows-scrollbar: 15px;
16+
--scrollbar-width: 18px;
1717

1818
&[data-layout-mode="reduced"] {
1919
--sidebar-width: 230px;
2020
--main-padding-left: 28px;
2121
--main-padding-right: 56px;
2222
}
2323

24+
[data-platform="windows"] & {
25+
--scrollbar-width: 15px
26+
}
27+
2428
display: grid;
2529
grid-template-columns: var(--sidebar-width) 1fr;
2630
grid-template-rows: max-content 1fr;
@@ -51,13 +55,53 @@ body {
5155
padding-right: var(--main-padding-right);
5256
padding-top: 24px;
5357
}
58+
5459
.customScroller {
5560
overflow-y: scroll;
56-
scrollbar-gutter: stable;
61+
padding-right: calc(var(--main-padding-right) - var(--scrollbar-width));
5762
}
5863

64+
/**
65+
* Windows has access to newer CSS features for styling the scrollbar
66+
*/
5967
[data-platform="windows"] {
6068
.customScroller {
61-
padding-right: calc(var(--main-padding-right) - var(--windows-scrollbar));
69+
scrollbar-gutter: stable;
70+
scrollbar-width: var(--scrollbar-width);
71+
scrollbar-color: var(--history-scrollbar-controls-color) var(--history-background-color);
72+
}
73+
}
74+
75+
/**
76+
* macOS specific styling to handle dark mode - without this full
77+
* override you cannot change the track color :(
78+
*/
79+
[data-platform="macos"] {
80+
.customScroller {
81+
--webkit-thumb-color: rgba(136, 136, 136, 0.8);
82+
83+
&::-webkit-scrollbar {
84+
width: var(--scrollbar-width);
85+
}
86+
87+
&::-webkit-scrollbar-track {
88+
background-color: var(--history-background-color)
89+
}
90+
91+
&::-webkit-scrollbar-thumb {
92+
background-color: var(--webkit-thumb-color);
93+
border-radius: calc(var(--scrollbar-width) / 2);
94+
95+
/** faking some padding on the thumb */
96+
border: 4px solid var(--history-background-color);
97+
}
98+
99+
&::-webkit-scrollbar-button {
100+
display: block;
101+
background-color: var(--history-background-color);
102+
103+
/** a small vertical gap to prevent it touching boundaries */
104+
height: 2px;
105+
}
62106
}
63-
}
107+
}

special-pages/pages/history/styles/history-theme.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
--history-background-color: var(--default-light-bg);
3636
--history-surface-background-color: var(--color-white-at-30);
3737
--history-surface-border-color: var(--color-black-at-9);
38+
--history-scrollbar-controls-color: var(--color-black-at-18);
3839
--history-text-normal: var(--color-black-at-84);
3940
--history-text-invert: var(--color-white-at-84);
4041
--history-text-muted: var(--color-black-at-60);
@@ -44,6 +45,7 @@
4445
--history-background-color: var(--default-dark-bg);
4546
--history-surface-background-color: var(--color-black-at-18);
4647
--history-surface-border-color: var(--color-white-at-12);
48+
--history-scrollbar-controls-color: var(--color-white-at-18);
4749
--history-surface-color: var(--color-white-at-12);
4850
--history-text-normal: var(--color-white-at-84);
4951
--history-text-invert: var(--color-black-at-84);

0 commit comments

Comments
 (0)