forked from mantinedev/mantine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spotlight.styles.ts
51 lines (45 loc) · 1.27 KB
/
Spotlight.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
51
import { createStyles, MantineNumberSize } from '@mantine/core';
export interface SpotlightStylesParams {
centered: boolean;
maxWidth: number;
topOffset: number;
radius: MantineNumberSize;
zIndex: React.CSSProperties['zIndex'];
}
export default createStyles(
(theme, { centered, maxWidth, topOffset, radius, zIndex }: SpotlightStylesParams) => ({
root: {
...theme.fn.cover(),
position: 'fixed',
zIndex,
},
spotlight: {
position: 'relative',
zIndex: 2,
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.white,
borderRadius: theme.fn.radius(radius),
width: '100%',
maxWidth,
overflow: 'auto',
marginLeft: 'calc(var(--removed-scroll-width, 0px) * -1)',
},
overlay: {
...theme.fn.cover(),
position: 'fixed',
},
inner: {
height: '100vh',
display: 'flex',
flexDirection: 'column',
paddingTop: centered ? theme.spacing.md : topOffset,
justifyContent: centered ? 'center' : 'flex-start',
alignItems: 'center',
},
searchInput: {
border: 0,
borderBottomRightRadius: 0,
borderBottomLeftRadius: 0,
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.white,
},
})
);