-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply sidebar hack only on aspect pages
- Loading branch information
Showing
5 changed files
with
66 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styles from "./styles.module.css"; | ||
import { Sidebar } from "@/components/sidebar"; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className={styles["aspect-wrapper"]}> | ||
<div className={styles["sidebar-floater"]}> | ||
<div className={styles["sidebar"]}> | ||
<Sidebar /> | ||
</div> | ||
</div> | ||
<div className={styles["content"]}> | ||
<a className={styles["home-link"]} href="/"> | ||
🔙 Homepage | ||
</a> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* centered content with responsive sidebar */ | ||
.aspect-wrapper { | ||
display: flex; | ||
justify-content: center; | ||
max-width: 960px; | ||
margin: 40px auto 80px auto; | ||
} | ||
|
||
.sidebar-floater { | ||
position: absolute; | ||
justify-content: center; | ||
width: calc(30%); | ||
left: 0; | ||
} | ||
.sidebar { | ||
width: 240px; | ||
font-size: 16px; | ||
margin: 28px auto 0 auto; | ||
} | ||
|
||
.content { | ||
max-width: 680px; | ||
margin: 0 auto 0 auto; | ||
} | ||
.home-link { | ||
font-size: 26px; | ||
} | ||
.content a { | ||
text-decoration: underline; | ||
} | ||
|
||
/* replace sidebar with home link on narrow screen */ | ||
@media (min-width: 1281px) { | ||
.home-link { | ||
display: none; | ||
} | ||
} | ||
@media (max-width: 1280px) { | ||
.sidebar { | ||
display: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import "./globals.css"; | ||
import { Sidebar } from "@/components/sidebar"; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<html lang="en"> | ||
<body> | ||
<div id="sidebar"> | ||
<div> | ||
<Sidebar /> | ||
</div> | ||
</div> | ||
<div id="content"> | ||
<a className="home-link" href="/"> | ||
🔙 Homepage | ||
</a> | ||
<div className="children">{children}</div> | ||
</div> | ||
</body> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters