Skip to content

Commit bd19566

Browse files
committed
fix(sidebar): make full size
1 parent ee06d3f commit bd19566

File tree

4 files changed

+45
-15
lines changed

4 files changed

+45
-15
lines changed

src/MapApp.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#root > main {
2-
margin-left: calc(60px + 1vw);
2+
margin-left: calc(var(--base-size-sidebar) + 1vw);
33
}

src/base.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
--bg-blue-8: #020d47;
1010
--color-warning: #e7c27b;
1111
--color-dark-red: #860404;
12+
--base-size-sidebar: 40px;
13+
}
14+
15+
@media (min-width: 400px) {
16+
:root {
17+
--base-size-sidebar: 60px;
18+
}
1219
}
1320

1421
html,

src/component/Sidebar.css

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
nav.sidebar {
22
background-color: var(--bg-blue-4);
3-
width: 60px;
3+
width: var(--base-size-sidebar);
44
height: 100vh;
55
position: fixed;
66
left: 0;
@@ -19,8 +19,8 @@ nav.sidebar hr {
1919
}
2020

2121
nav.sidebar .button {
22-
width: 59px;
23-
height: 59px;
22+
width: calc(var(--base-size-sidebar) - 1px);
23+
height: calc(var(--base-size-sidebar) - 1px);
2424
display: flex;
2525
align-items: center;
2626
justify-content: center;
@@ -37,27 +37,44 @@ nav.sidebar .white {
3737

3838
aside.sidebar {
3939
position: fixed;
40-
left: 59px;
41-
top: 60px;
40+
left: calc(var(--base-size-sidebar) - 1px);
41+
top: var(--base-size-sidebar);
42+
border-top-right-radius: calc(var(--base-size-sidebar) / 2);
4243
}
4344

4445
aside.sidebar > header {
4546
display: flex;
4647
justify-content: space-between;
4748
align-items: center;
48-
height: 60px;
49+
height: var(--base-size-sidebar);
4950
margin: 0 1rem;
5051
}
5152

53+
aside.sidebar nav {
54+
border-bottom-width: 1px;
55+
border-bottom-style: solid;
56+
color: 1px solid rgba(0, 0, 0, 0.5);
57+
margin: 0 1rem;
58+
display: flex;
59+
justify-content: space-between;
60+
align-items: end;
61+
}
62+
63+
aside.sidebar .close {
64+
display: flex;
65+
justify-content: space-between;
66+
align-items: center;
67+
}
68+
5269
aside.sidebar.warning {
5370
background-color: var(--color-warning);
5471
color: var(--color-dark-red);
55-
56-
min-height: 50vh;
72+
border-bottom-color: var(--color-dark-red);
73+
height: calc(100vh - var(--base-size-sidebar));
5774
}
5875

5976
@media (min-width: 400px) {
6077
aside.sidebar.warning {
61-
width: 300px;
78+
width: calc(400px - var(--base-size-sidebar));
6279
}
6380
}

src/component/Sidebar.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ export const Sidebar = () => {
1919
<SidebarContent class="warning">
2020
<header>
2121
<h1>Under construction!</h1>
22-
<a href="#">
23-
<Close />
24-
</a>
2522
</header>
26-
23+
<nav>
24+
<span></span>
25+
<a href="#" class="close">
26+
<Close size={20} />
27+
</a>
28+
</nav>
2729
<div style={{ padding: '1rem' }}>
2830
<p>
2931
This website is under construction and not intended for production
@@ -43,7 +45,11 @@ const SidebarContent = (props: ParentProps<{ class?: string }>) => (
4345
const SidebarNav = () => (
4446
<nav class="sidebar">
4547
<a href="#" class="button white">
46-
<img src="/assets/logo.svg" class="logo" alt="hello.nrfcloud.com logo" />
48+
<img
49+
src="../assets/logo.svg"
50+
class="logo"
51+
alt="hello.nrfcloud.com logo"
52+
/>
4753
</a>
4854
<hr />
4955
<a class="button warning" href="#warning">

0 commit comments

Comments
 (0)