Skip to content

Commit 9a1ada1

Browse files
feat(theme): add overlayscrollbars CSS
1 parent 4a32205 commit 9a1ada1

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

lib/theme/overlayscrollbars.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import type { SystemStyleObject } from '@chakra-ui/styled-system';
2+
3+
export const overlayscrollbars: SystemStyleObject = {
4+
'.os-scrollbar': {
5+
/* The size of the scrollbar */
6+
'--os-size': '9px',
7+
/* The axis-perpedicular padding of the scrollbar (horizontal: padding-y, vertical: padding-x) */
8+
/* --os-padding-perpendicular: 0; */
9+
/* The axis padding of the scrollbar (horizontal: padding-x, vertical: padding-y) */
10+
/* --os-padding-axis: 0; */
11+
/* The border radius of the scrollbar track */
12+
/* --os-track-border-radius: 0; */
13+
/* The background of the scrollbar track */
14+
/* --os-track-bg: rgba(0, 0, 0, 0.3); */
15+
/* The :hover background of the scrollbar track */
16+
/* --os-track-bg-hover: rgba(0, 0, 0, 0.3); */
17+
/* The :active background of the scrollbar track */
18+
/* --os-track-bg-active: rgba(0, 0, 0, 0.3); */
19+
/* The border of the scrollbar track */
20+
/* --os-track-border: none; */
21+
/* The :hover background of the scrollbar track */
22+
/* --os-track-border-hover: none; */
23+
/* The :active background of the scrollbar track */
24+
/* --os-track-border-active: none; */
25+
/* The border radius of the scrollbar handle */
26+
/* --os-handle-border-radius: 2px; */
27+
/* The background of the scrollbar handle */
28+
/* --os-handle-bg: var(--invokeai-colors-accentAlpha-500); */
29+
/* The :hover background of the scrollbar handle */
30+
/* --os-handle-bg-hover: var(--invokeai-colors-accentAlpha-700); */
31+
/* The :active background of the scrollbar handle */
32+
/* --os-handle-bg-active: var(--invokeai-colors-accentAlpha-800); */
33+
/* The border of the scrollbar handle */
34+
/* --os-handle-border: none; */
35+
/* The :hover border of the scrollbar handle */
36+
/* --os-handle-border-hover: none; */
37+
/* The :active border of the scrollbar handle */
38+
/* --os-handle-border-active: none; */
39+
/* The min size of the scrollbar handle */
40+
'--os-handle-min-size': '50px',
41+
/* The max size of the scrollbar handle */
42+
/* --os-handle-max-size: none; */
43+
/* The axis-perpedicular size of the scrollbar handle (horizontal: height, vertical: width) */
44+
/* --os-handle-perpendicular-size: 100%; */
45+
/* The :hover axis-perpedicular size of the scrollbar handle (horizontal: height, vertical: width) */
46+
/* --os-handle-perpendicular-size-hover: 100%; */
47+
/* The :active axis-perpedicular size of the scrollbar handle (horizontal: height, vertical: width) */
48+
/* --os-handle-perpendicular-size-active: 100%; */
49+
/* Increases the interactive area of the scrollbar handle. */
50+
/* --os-handle-interactive-area-offset: 0; */
51+
},
52+
53+
'.os-scrollbar-handle': {
54+
cursor: 'grab',
55+
},
56+
57+
'.os-scrollbar-handle:active': {
58+
cursor: 'grabbing',
59+
},
60+
};

lib/theme/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { ThemeOverride } from '@chakra-ui/react';
33
import { colors } from './colors';
44
import { components } from './components';
55
import { layerStyles } from './layers';
6+
import { overlayscrollbars } from './overlayscrollbars';
67
import { space } from './space';
78

89
export const theme: ThemeOverride = {
@@ -14,6 +15,7 @@ export const theme: ThemeOverride = {
1415
styles: {
1516
global: {
1617
body: { bg: 'base.900', color: 'base.50' },
18+
...overlayscrollbars,
1719
},
1820
},
1921
fonts: {

0 commit comments

Comments
 (0)