Skip to content

Commit 6d128f4

Browse files
committed
Move styles to CSS Modules
1 parent 6c0b504 commit 6d128f4

File tree

6 files changed

+61
-60
lines changed

6 files changed

+61
-60
lines changed

components/Footer.js

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1+
import styles from './Footer.module.css'
2+
13
export default function Footer() {
24
return (
35
<>
4-
<footer>
5-
Made with{' '}
6-
<img src="/netliheart.svg" alt="Netlify Logo" className="logo" /> for
7-
you
6+
<footer className={styles.footer}>
7+
Made with <img src="/netliheart.svg" alt="Netlify Logo" className={styles.logo} /> for you
88
</footer>
9-
<style jsx>{`
10-
footer {
11-
width: 100%;
12-
height: 100px;
13-
border-top: 1px solid #eaeaea;
14-
display: flex;
15-
justify-content: center;
16-
align-items: center;
17-
}
18-
19-
.logo {
20-
height: 1em;
21-
margin: 5px;
22-
}
23-
`}</style>
249
</>
2510
)
2611
}

components/Footer.module.css

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.footer {
2+
width: 100%;
3+
height: 100px;
4+
border-top: 1px solid #eaeaea;
5+
display: flex;
6+
justify-content: center;
7+
align-items: center;
8+
}
9+
10+
.logo {
11+
height: 1em;
12+
margin: 5px;
13+
}

jsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"compilerOptions": {
33
"baseUrl": "./",
44
"paths": {
5-
"@components/*": ["components/*"]
5+
"@components/*": ["components/*"],
6+
"@styles/*": ["styles/*"]
67
}
78
}
89
}

pages/_app.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import '@styles/globals.css'
2+
3+
function Application({ Component, pageProps }) {
4+
return <Component {...pageProps} />
5+
}
6+
7+
export default Application

pages/index.js

-40
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,6 @@ export default function Home() {
1818
</main>
1919

2020
<Footer />
21-
22-
<style jsx>{`
23-
.container {
24-
height: 100vh;
25-
display: flex;
26-
flex-direction: column;
27-
justify-content: center;
28-
align-items: center;
29-
}
30-
31-
main {
32-
padding: 5rem 0;
33-
flex: 1;
34-
display: flex;
35-
flex-direction: column;
36-
justify-content: center;
37-
align-items: center;
38-
}
39-
40-
code {
41-
background: #fafafa;
42-
border-radius: 5px;
43-
padding: 0.75rem;
44-
font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
45-
}
46-
`}</style>
47-
48-
<style jsx global>{`
49-
html,
50-
body {
51-
padding: 0;
52-
margin: 0;
53-
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu,
54-
Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
55-
}
56-
57-
* {
58-
box-sizing: border-box;
59-
}
60-
`}</style>
6121
</div>
6222
)
6323
}

styles/globals.css

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
html,
2+
body {
3+
padding: 0;
4+
margin: 0;
5+
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell,
6+
Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7+
}
8+
9+
* {
10+
box-sizing: border-box;
11+
}
12+
13+
main {
14+
padding: 5rem 0;
15+
flex: 1;
16+
display: flex;
17+
flex-direction: column;
18+
justify-content: center;
19+
align-items: center;
20+
}
21+
22+
code {
23+
background: #fafafa;
24+
border-radius: 5px;
25+
padding: 0.75rem;
26+
font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
27+
}
28+
29+
.container {
30+
height: 100vh;
31+
display: flex;
32+
flex-direction: column;
33+
justify-content: center;
34+
align-items: center;
35+
}

0 commit comments

Comments
 (0)