-
Notifications
You must be signed in to change notification settings - Fork 4k
Expand file tree
/
Copy pathStyle.js
More file actions
40 lines (34 loc) · 821 Bytes
/
Style.js
File metadata and controls
40 lines (34 loc) · 821 Bytes
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
const style = {}
const sidebarWidth = 250
style.container = {
display: 'flex',
flexDirection: 'row', // Default value for non-mobile devices
}
style.menu = {
position: 'fixed',
display: 'flex',
flexDirection: 'column',
top: 0,
bottom: 0,
left: 0,
width: sidebarWidth,
background: '#1B1C1D',
overflowX: 'hidden',
}
style.sidebarMain = {
marginLeft: sidebarWidth,
minWidth: parseInt(sidebarWidth, 10) + 300,
}
style.main = {
...style.sidebarMain,
maxWidth: parseInt(sidebarWidth, 10) + 900,
}
// Manually check the screen size and apply appropriate styles
const screenWidth = window.innerWidth
if (screenWidth <= 768) {
style.container.flexDirection = 'column'
style.menu.position = 'relative'
style.menu.width = '100%'
style.sidebarMain.marginLeft = '0%'
}
export default style