-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathpanels.ts
More file actions
87 lines (75 loc) · 2.18 KB
/
panels.ts
File metadata and controls
87 lines (75 loc) · 2.18 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
78
79
80
81
82
83
84
85
86
87
import { SECTION_ATTR } from '../services/MenuStore';
import styled, { media } from '../styled-components';
export const MiddlePanel = styled.div<{ $compact?: boolean }>`
width: calc(100% - ${props => props.theme.rightPanel.width});
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
${({ $compact, theme }) =>
media.lessThan('medium', true)`
width: 100%;
padding: ${`${$compact ? 0 : theme.spacing.sectionVertical}px ${
theme.spacing.sectionHorizontal
}px`};
`};
${({ $compact, theme }) =>
media.lessThan('small', true)`
padding: ${`${$compact ? 0 : theme.spacing.sectionVertical / 2}px ${
theme.spacing.sectionHorizontal / 2
}px`};
`};
`;
export const Section = styled.div.attrs(props => ({
[SECTION_ATTR]: props.id,
}))<{ $underlined?: boolean }>`
padding: ${props => props.theme.spacing.sectionVertical}px 0;
&:last-child {
min-height: calc(100vh + 1px);
}
& > &:last-child {
min-height: initial;
}
${media.lessThan('medium', true)`
padding: 0;
`}
${({ $underlined }) =>
($underlined &&
`
position: relative;
&:not(:last-of-type):after {
position: absolute;
bottom: 0;
width: 100%;
display: block;
content: '';
}
`) ||
''}
`;
export const RightPanel = styled.div`
width: ${props => props.theme.rightPanel.width};
color: ${({ theme }) => theme.rightPanel.textColor};
background-color: ${props => props.theme.rightPanel.backgroundColor};
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
${media.lessThan('medium', true)`
width: 100%;
padding: ${props =>
`${props.theme.spacing.sectionVertical}px ${props.theme.spacing.sectionHorizontal}px`};
`};
${media.lessThan('small', true)`
width: 100%;
padding: ${props =>
`${props.theme.spacing.sectionVertical / 2}px ${
props.theme.spacing.sectionHorizontal / 2
}px`};
`};
`;
export const DarkRightPanel = styled(RightPanel)`
background-color: ${props => props.theme.rightPanel.backgroundColor};
`;
export const Row = styled.div`
display: flex;
width: 100%;
padding: 0;
${media.lessThan('medium', true)`
flex-direction: column;
`};
`;