fix(layout): centered layout with responsive principles applied

This commit is contained in:
Thomas Ibarra
2019-07-30 17:23:59 -05:00
parent 674d304408
commit 2e85d8e9f1
5 changed files with 22 additions and 21 deletions
+1 -6
View File
@@ -3,12 +3,7 @@ import styled from "styled-components"
export const ContainerWrapper = styled.div`
display: flex;
flex-direction: column;
/* the 172px is necessary because the logo is offset by that much */
/* this ensures the logo never goes off screen */
/* TODO: most likely extract this number */
padding: 0 calc(172px + 32px);
margin: 0 auto;
width: 100%;
margin: 20px;
max-width: 800px;
& > :first-child {
+6 -3
View File
@@ -6,9 +6,12 @@ export function Footer() {
return (
<SC.FooterWrapper>
<Container>
© {new Date().getFullYear()}, Built with
{` `}
<a href="https://www.gatsbyjs.org">Gatsby</a>
<p>
© {new Date().getFullYear()}, Built with
{` `}
<a href="https://www.gatsbyjs.org">Gatsby</a>
</p>
</Container>
</SC.FooterWrapper>
)
+5 -1
View File
@@ -1,4 +1,8 @@
import { Link } from "gatsby"
import styled from "styled-components"
export const FooterWrapper = styled.footer``
export const FooterWrapper = styled.footer`
& a {
display: inline;
}
`
+8 -10
View File
@@ -1,27 +1,28 @@
import { Link } from "gatsby"
import styled from "styled-components"
export const HeaderWrapper = styled.header``
export const HeaderWrapper = styled.header`
margin: 0 auto 20px;
`
export const InnerWrapper = styled.div`
position: relative;
display: flex;
align-items: center;
height: 122px;
flex-direction: column;
`
export const Logo = styled.img`
position: absolute;
margin-right: 50px;
left: calc(-122px - 50px);
width: 122px;
height: 122px;
`
export const Menu = styled.nav`
margin-top: 16px;
display: flex;
align-items: flex-start;
justify-content: space-between;
flex-wrap: wrap;
width: 100%;
`
export const MenuItem = styled(Link)`
@@ -32,6 +33,7 @@ export const MenuItem = styled(Link)`
color: #555;
position: relative;
transition: color 0.3s;
margin: 5px 10px;
/* underline bar, getting animated through hover */
&::after {
@@ -76,8 +78,4 @@ export const MenuItem = styled(Link)`
background: #d33636;
}
}
& + & {
margin-left: 48px;
}
`
+2 -1
View File
@@ -3,12 +3,13 @@ import styled from "styled-components"
export const Main = styled.div`
display: flex;
flex-direction: column;
margin: 128px auto 64px !important;
margin: 20px auto;
width: 100%;
`
export const MainContent = styled.main`
flex: 1 0 auto;
margin: 0 auto;
& > :first-child {
margin-top: 0;