-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstyles.ts
More file actions
77 lines (70 loc) · 1.83 KB
/
Copy pathstyles.ts
File metadata and controls
77 lines (70 loc) · 1.83 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import styled from 'styled-components';
export const StyledBackdrop = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: ${({ theme }) => theme.colors.backdrop};
overflow: scroll;
@media screen and (min-width: 768px) {
padding: 24px;
}
animation: backdrop-animation 250ms ease-out;
@keyframes backdrop-animation {
from {
background-color: transparent;
}
to {
background-color: rgba(21, 41, 53, 0.3);
}
}
`;
export const StyledModal = styled.div<{
$disableOverflow?: boolean;
$customWidth?: string;
$flexLayout?: boolean;
}>`
position: relative;
padding: 24px;
${({ $flexLayout }) =>
$flexLayout ? 'display: flex; flex-direction: column;' : ''}
@media screen and (max-width: 767px) {
width: 100vw;
height: 100vh;
}
@media screen and (min-width: 768px) {
min-width: ${({ $customWidth }) =>
$customWidth ? `${$customWidth}` : '400px'};
max-width: ${({ $customWidth }) =>
$customWidth ? `${$customWidth}` : '504px'};
max-height: ${({ $disableOverflow }) =>
$disableOverflow ? '90vh' : '80vh'};
border-radius: 8px;
}
background-color: ${({ theme }) => theme.colors.modalBackground};
box-shadow: ${({ theme }) => `0px 20px 40px ${theme.colors.shadow}`};
${({ $disableOverflow }) => ($disableOverflow ? '' : `overflow-y: auto;`)}
animation: modal-animation 250ms ease-out;
@keyframes modal-animation {
from {
transform: translateY(100%);
}
to {
transform: translateY(0%);
}
}
`;
export const StyledCloseButton = styled.button`
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 24px;
right: 24px;
background-color: transparent;
cursor: pointer;
`;