Created
November 27, 2016 19:54
-
-
Save jamesslock/c3ae888e894e20b4bafd6ffdab97bb50 to your computer and use it in GitHub Desktop.
Container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, PropTypes } from 'react'; | |
import styled, { css } from 'styled-components'; | |
const Container = styled.div` | |
/* Root styles */ | |
margin: auto; | |
padding: 0 80px 0 10%; | |
&:before, | |
&:after { | |
content: ""; | |
display: table; | |
} | |
&:after { | |
clear: both; | |
} | |
${props => props.full && css` | |
/* full width container */ | |
padding: 0 20px; | |
`} | |
${props => props.inner && css` | |
/* Internal container */ | |
padding: 0 10%; | |
`} | |
${props => props.small && css` | |
/* Small container */ | |
max-width: 60%; | |
`} | |
${props => props.left && css` | |
/* Pull container left */ | |
margin: 0; | |
padding: 0; | |
`} | |
${props => props.right && css` | |
/* Pull container right */ | |
float: right; | |
margin: 0; | |
padding: 0; | |
`} | |
`; | |
export default Container; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment