Skip to content

Instantly share code, notes, and snippets.

@jamesslock
Created November 27, 2016 19:54
Show Gist options
  • Save jamesslock/c3ae888e894e20b4bafd6ffdab97bb50 to your computer and use it in GitHub Desktop.
Save jamesslock/c3ae888e894e20b4bafd6ffdab97bb50 to your computer and use it in GitHub Desktop.
Container.js
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