Skip to content

Commit

Permalink
fix: migrate the rest of the layout styles to emotion
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jul 29, 2020
1 parent 749427a commit cee2d25
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 32 deletions.
28 changes: 25 additions & 3 deletions src/layouts/MainLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ const MainLayout = ({ children }) => {
}, []);

return (
<div className={styles.layout}>
<div
css={css`
--global-header-height: 30px;
--sidebar-width: 300px;
min-height: 100vh;
display: grid;
grid-template-rows: auto 1fr;
`}
>
<Helmet>
{cookieConsent ? (
<script>
Expand All @@ -68,7 +77,11 @@ const MainLayout = ({ children }) => {
</Helmet>
<GlobalHeader editUrl={editUrl} />
<MobileHeader
className={styles.hideOnDesktop}
css={css`
@media (min-width: 761px) {
display: none;
}
`}
isOpen={isMobileNavOpen}
toggle={() => setIsMobileNavOpen(!isMobileNavOpen)}
/>
Expand All @@ -91,8 +104,17 @@ const MainLayout = ({ children }) => {
<Sidebar
css={css`
grid-area: sidebar;
position: fixed;
top: var(--global-header-height);
bottom: 0;
width: var(--sidebar-width);
height: calc(100vh - var(--global-header-height));
overflow: auto;
@media (max-width: 760px) {
display: none;
}
`}
className={cx(styles.sidebar, styles.hideOnMobile)}
/>
<div
css={css`
Expand Down
29 changes: 0 additions & 29 deletions src/layouts/MainLayout.module.scss

This file was deleted.

0 comments on commit cee2d25

Please sign in to comment.