Skip to content

Instantly share code, notes, and snippets.

@zerobias
Created July 25, 2018 00:00
Show Gist options
  • Save zerobias/6f5615b0385da4b173298faa3c861fbf to your computer and use it in GitHub Desktop.
Save zerobias/6f5615b0385da4b173298faa3c861fbf to your computer and use it in GitHub Desktop.
styled grid mixins
import styled, {css} from 'styled-components'
const gridArea = area => area
? `grid-area: "${area}";`
: ``
const gridAreaMixin = css`
${props => gridArea(props.area)}
`
const CommonButton = styled.button`
${gridAreaMixin}
`
const SpecialHeader = styled.h1`
${gridArea('head')}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment