Skip to content

Commit

Permalink
chore: Use flex and get rid of floating div
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 19, 2020
1 parent 37fd8a3 commit fd9dfcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const Layout = ({ children }) => {
/>
<div className={cx(styles.main, 'site-container')}>
<Sidebar className={cx(styles.sidebar, styles.hideOnMobile)} />
<div />
<div
className={cx(styles.contentContainer, {
[styles.hideOnMobile]: isMobileNavOpen,
Expand Down
7 changes: 4 additions & 3 deletions src/components/Layout.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.layout {
--global-header-height: 30px;
--sidebar-width: 300px;

min-height: 100vh;
display: grid;
grid-template-rows: auto 1fr;
}

.main {
display: grid;
grid-template-columns: 300px minmax(0, 1fr);
display: flex;
width: 100%;

@media screen and (max-width: 760px) {
Expand All @@ -20,13 +20,14 @@
display: flex;
flex-direction: column;
padding: 2rem;
padding-left: calc(2rem + var(--sidebar-width));
}

.sidebar {
position: fixed;
top: var(--global-header-height);
bottom: 0;
width: 300px;
width: var(--sidebar-width);
height: calc(100vh - var(--global-header-height));
overflow: auto;
}
Expand Down

0 comments on commit fd9dfcb

Please sign in to comment.