Skip to content

Commit ba5041d

Browse files
Update scrollbars to match theme (#1128)
* Use new scrollbar styles based on latest standards. * Properly apply styles to body and html, so scrollbars know how to get their colors. * Fix search container so scrollbar knows where to get its color * Fix scrollbar bg color in Kapa modal.
1 parent 69573b2 commit ba5041d

File tree

4 files changed

+44
-16
lines changed

4 files changed

+44
-16
lines changed

components/utilities/kapaModal.css

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
background-color: rgba(166, 168, 184, 0.6) !important;
33
}
44

5+
.mantine-Paper-root {
6+
@apply bg-white dark:bg-gray-90;
7+
}
8+
59
.mantine-Modal-header,
610
.mantine-Modal-header h3 {
711
@apply bg-white dark:bg-gray-90 text-gray-90 dark:text-gray-40 border-b-0 font-normal tracking-wide;

components/utilities/search.module.css

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
.ContentContainer {
1111
@apply p-0 rounded-md w-96 overflow-x-hidden overflow-y-auto w-full h-full;
12+
@apply bg-gray-10;
13+
}
14+
15+
:global(.dark) .ContentContainer {
16+
@apply bg-gray-90;
1217
}
1318

1419
/* Search Bar */

styles/globals.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
@tailwind utilities;
44

55
html {
6-
@apply overflow-x-hidden scroll-pt-12;
6+
@apply overflow-x-hidden overflow-y-auto scroll-pt-12;
77
}
88

99
body {
10+
@apply bg-white;
1011
@apply scroll-m-12;
1112
}
1213

14+
.dark body {
15+
@apply bg-gray-100;
16+
}
17+
1318
/* Utility to hide text that only is needed in screen readers */
1419
.sr-only {
1520
@apply absolute top-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-none;

styles/scrollbars.scss

+29-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
1-
/* Improve scrollbars on Chrome + Windows/Linux. */
2-
body:not(.mac) {
1+
@supports (scrollbar-color: #000 #111) {
2+
* {
3+
scrollbar-width: thin;
4+
scrollbar-color: transparent transparent;
5+
}
6+
7+
:hover {
8+
scrollbar-color: theme("colors.gray.40") transparent;
9+
}
10+
11+
.dark:hover,
12+
.dark :hover {
13+
scrollbar-color: theme("colors.gray.70") transparent;
14+
}
15+
}
16+
17+
@supports not (scrollbar-color: #000 #111) {
318
::-webkit-scrollbar {
4-
height: 6px;
5-
width: 6px;
6-
background: transparent;
19+
@apply h-2 w-2 bg-transparent;
720
}
821

9-
::-webkit-scrollbar-thumb:horizontal {
10-
margin-top: -6px;
22+
::-webkit-scrollbar-thumb {
23+
@apply rounded-full;
1124
}
1225

13-
::-webkit-scrollbar-thumb:active {
14-
opacity: 1;
15-
background-color: rgba(128, 132, 149, 0.75);
26+
:hover::-webkit-scrollbar-thumb {
27+
@apply bg-gray-50 bg-opacity-70;
1628
}
1729

1830
::-webkit-scrollbar-thumb:hover,
19-
:hover::-webkit-scrollbar-thumb:horizontal,
20-
:hover::-webkit-scrollbar-thumb:vertical {
21-
border-radius: 9999px;
22-
opacity: 1;
23-
background-color: rgba(191, 197, 211, 0.75);
31+
:hover::-webkit-scrollbar-thumb:hover {
32+
@apply bg-gray-50 bg-opacity-100;
33+
}
34+
35+
::-webkit-scrollbar-thumb:active,
36+
:hover::-webkit-scrollbar-thumb:active {
37+
@apply bg-gray-70 bg-opacity-100;
2438
}
2539
}

0 commit comments

Comments
 (0)