Skip to content

Commit

Permalink
feat: Use a fixed sidebar and scroll independently
Browse files Browse the repository at this point in the history
jerelmiller committed Jun 19, 2020
1 parent ed41f38 commit 7d9a7fe
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,8 @@ const Layout = ({ children }) => {
toggle={() => setIsMobileNavOpen(!isMobileNavOpen)}
/>
<div className={cx(styles.main, 'site-container')}>
<Sidebar className={cx(styles.hideOnMobile)} />
<Sidebar className={cx(styles.sidebar, styles.hideOnMobile)} />
<div />
<div
className={cx(styles.contentContainer, {
[styles.hideOnMobile]: isMobileNavOpen,
9 changes: 9 additions & 0 deletions src/components/Layout.module.scss
Original file line number Diff line number Diff line change
@@ -20,6 +20,15 @@
padding: 2rem;
}

.sidebar {
position: fixed;
top: 30px;
bottom: 0;
width: 300px;
height: calc(100vh - 30px);
overflow: auto;
}

.content {
flex: 1;
}

0 comments on commit 7d9a7fe

Please sign in to comment.