/
Toolbar.styles.ts
50 lines (43 loc) · 1.32 KB
/
Toolbar.styles.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { createStyles } from '@mantine/core';
interface ToolbarStyles {
sticky: boolean;
stickyOffset: string | number;
}
export default createStyles((theme, { sticky, stickyOffset }: ToolbarStyles) => ({
toolbarGroup: {
display: 'flex',
alignItems: 'center',
flexWrap: 'wrap',
margin: `calc(${theme.spacing.md}px / 2)`,
},
toolbar: {
position: sticky ? 'sticky' : 'relative',
zIndex: 1,
top: sticky ? stickyOffset : 0,
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,
borderBottom: `1px solid ${
theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[4]
}`,
borderTopRightRadius: theme.radius.sm,
borderTopLeftRadius: theme.radius.sm,
padding: `${theme.spacing.sm}px ${theme.spacing.md}px`,
},
toolbarInner: {
display: 'flex',
flexWrap: 'wrap',
margin: `calc(${-theme.spacing.md}px / 2)`,
},
toolbarControl: {
'& + &': {
borderLeftWidth: 0,
},
'&:first-of-type': {
borderTopLeftRadius: theme.fn.radius(theme.defaultRadius),
borderBottomLeftRadius: theme.fn.radius(theme.defaultRadius),
},
'&:last-of-type': {
borderTopRightRadius: theme.fn.radius(theme.defaultRadius),
borderBottomRightRadius: theme.fn.radius(theme.defaultRadius),
},
},
}));