Merge pull request #46 from the-programmers-hangout/feature/sparks/refactor-container-styles

refact: reduce container styles complexity
This commit is contained in:
Jean-Philippe Sirois
2019-07-31 13:20:11 -04:00
committed by GitHub
6 changed files with 9 additions and 33 deletions
+1 -13
View File
@@ -1,16 +1,4 @@
import styled from "styled-components"
export const ContainerWrapper = styled.div`
display: flex;
flex-direction: column;
margin: 20px;
max-width: 800px;
& > :first-child {
margin-top: 0;
}
& > :last-child {
margin-bottom: 0;
}
`
`
-3
View File
@@ -2,9 +2,6 @@ import { Link } from "gatsby"
import styled from "styled-components"
export const FooterWrapper = styled.footer`
max-width: 840px;
margin: auto auto;
& a {
display: inline;
}
-1
View File
@@ -17,7 +17,6 @@ export function Header() {
<Container>
<SC.InnerWrapper>
<SC.Logo src={logo} />
<SC.Menu>
<MenuItem to="/about">about</MenuItem>
<MenuItem to="/rules">rules</MenuItem>
+2 -3
View File
@@ -2,7 +2,7 @@ import { Link } from "gatsby"
import styled from "styled-components"
export const HeaderWrapper = styled.header`
margin: 0 auto 20px;
margin-bottom: 20px;
`
export const InnerWrapper = styled.div`
@@ -21,9 +21,8 @@ export const Logo = styled.img`
export const Menu = styled.nav`
display: flex;
align-items: flex-start;
justify-content: space-between;
justify-content: center;
flex-wrap: wrap;
width: 100%;
`
export const MenuItem = styled(Link)`
+1 -1
View File
@@ -38,8 +38,8 @@ export function Layout({ children }: PropsWithChildren<{}>) {
{children}
</Container>
</SC.MainContent>
<Footer />
</SC.Main>
<Footer />
</Scrollbar>
)
}
+5 -12
View File
@@ -3,19 +3,12 @@ import styled from "styled-components"
export const Main = styled.div`
display: flex;
flex-direction: column;
margin: 20px auto;
width: 100%;
align-items: center;
margin: 20px;
`
export const MainContent = styled.main`
flex: 1 0 auto;
margin: 0 auto;
& > :first-child {
margin-top: 0;
}
& > :last-child {
margin-bottom: 0;
}
display: flex;
justify-content: center;
max-width: 800px;
`