Add <Flex />

This commit is contained in:
Jinksi 2017-03-29 12:01:55 +10:00
parent 15b6ee34ee
commit 383a3f90a5

View file

@ -1,11 +1,5 @@
import styled from 'styled-components'
export const Container = styled.div`
margin: 0 auto;
max-width: 1111px;
width: 90vw;
`
export const Section = styled.section`
width: 100%;
padding: ${props => {
@ -14,3 +8,29 @@ export const Section = styled.section`
return '5rem 0'
}};
`
export const Container = styled.div`
margin: 0 auto;
max-width: 1111px;
width: 90vw;
`
export const Flex = styled.div`
display: flex;
flex-direction: ${props => props.column ? 'column' : 'row'};
justify-content: ${props => {
if (props.justifyCenter) return 'center'
if (props.justifyEnd) return 'flex-end'
if (props.justifyBetween) return 'space-between'
if (props.justifyAround) return 'space-around'
return 'flex-start'
}};
align-items: ${props => {
if (props.alignStart) return 'flex-start'
if (props.alignEnd) return 'flex-end'
if (props.alignStretch) return 'stretch'
return 'center'
}};
height: ${props => props.fill ? '100%' : 'auto'};
width: ${props => props.fill ? '100%' : 'auto'};
`