Skip to content

Commit

Permalink
Move styles to CSS Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cassidoo committed Nov 10, 2020
1 parent 6c0b504 commit 6d128f4
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 60 deletions.
23 changes: 4 additions & 19 deletions components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import styles from './Footer.module.css'

export default function Footer() {
return (
<>
<footer>
Made with{' '}
<img src="/netliheart.svg" alt="Netlify Logo" className="logo" /> for
you
<footer className={styles.footer}>
Made with <img src="/netliheart.svg" alt="Netlify Logo" className={styles.logo} /> for you
</footer>
<style jsx>{`
footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
.logo {
height: 1em;
margin: 5px;
}
`}</style>
</>
)
}
13 changes: 13 additions & 0 deletions components/Footer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}

.logo {
height: 1em;
margin: 5px;
}
3 changes: 2 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@components/*": ["components/*"]
"@components/*": ["components/*"],
"@styles/*": ["styles/*"]
}
}
}
7 changes: 7 additions & 0 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import '@styles/globals.css'

function Application({ Component, pageProps }) {
return <Component {...pageProps} />
}

export default Application
40 changes: 0 additions & 40 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,6 @@ export default function Home() {
</main>

<Footer />

<style jsx>{`
.container {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
}
`}</style>

<style jsx global>{`
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu,
Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
* {
box-sizing: border-box;
}
`}</style>
</div>
)
}
35 changes: 35 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell,
Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

* {
box-sizing: border-box;
}

main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-family: Menlo, Monaco, Lucida Console, Courier New, monospace;
}

.container {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

0 comments on commit 6d128f4

Please sign in to comment.