Skip to content

Commit ca68dc3

Browse files
Add: create a widthContainer in Layout.module.css that is used to define all components width
1 parent 5d435f7 commit ca68dc3

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

components/Footer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import Link from "next/link";
22
import footerStyles from "../styles/Footer.module.css";
3+
import layoutStyles from "../styles/Layout.module.css";
34
import { linksNav, linksSocial } from "../utils/links";
45

56
export default function Footer() {
67
return (
78
<footer className={footerStyles.footer}>
8-
<div className={footerStyles.container}>
9+
<div
10+
className={`${layoutStyles.widthContainer} ${footerStyles.container}`}
11+
>
912
<div className={footerStyles.columnLeft}>
1013
<ul className={footerStyles.footerList}>
1114
{linksNav.map((link) => (
@@ -47,7 +50,7 @@ export default function Footer() {
4750
</div>
4851
</div>
4952
</div>
50-
<p className={footerStyles.copyright}>
53+
<p className={`${layoutStyles.widthContainer} ${footerStyles.copyright}`}>
5154
Web Dev Path 2021. All rights reserved.
5255
</p>
5356
</footer>

components/Layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function Layout({ children }) {
66
return (
77
<>
88
<Nav />
9-
<div className={styles.container}>
9+
<div className={`${styles.widthContainer} ${styles.container}`}>
1010
<main className={styles.main}>{children}</main>
1111
</div>
1212
<Footer />

components/Nav.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from "next/link";
22
import { useEffect, useState } from "react";
33
import styles from "../styles/Nav.module.css";
4+
import layoutStyles from "../styles/Layout.module.css";
45

56
export default function Nav() {
67
const [active, setActive] = useState(false);
@@ -21,7 +22,9 @@ export default function Nav() {
2122

2223
return (
2324
<header className={styles.header}>
24-
<div className={`${styles.navContainer} ${styles.row}`}>
25+
<div
26+
className={`${styles.navContainer} ${styles.row} ${layoutStyles.widthContainer}`}
27+
>
2528
<div className={styles.align}>
2629
<Link href="/">
2730
<img

styles/Footer.module.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676

7777
@media (min-width: 578px) {
7878
.container {
79-
max-width: 800px;
8079
margin: 0 auto;
8180
display: flex;
8281
flex-direction: row;
@@ -122,10 +121,7 @@
122121
}
123122

124123
.copyright {
125-
max-width: 800px;
126-
margin: 0 auto;
127-
margin-top: 1rem;
128-
margin-bottom: 1rem;
124+
margin: 1rem auto;
129125
text-align: left;
130126
}
131127
}

styles/Home.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
justify-content: center;
4040
flex-wrap: wrap;
4141

42-
max-width: 800px;
4342
margin-top: 3rem;
4443
}
4544

styles/Layout.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
.widthContainer {
2+
max-width: 80%;
3+
margin: 0 auto;
4+
}
5+
16
.container {
27
min-height: 100vh;
38
padding: 0 0.5rem;

styles/Nav.module.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
.navContainer {
22
width: 80%;
3-
max-width: 800px;
4-
margin: 0 auto;
53
position: relative;
64
}
75

0 commit comments

Comments
 (0)