Created
July 25, 2018 00:00
-
-
Save zerobias/6f5615b0385da4b173298faa3c861fbf to your computer and use it in GitHub Desktop.
styled grid mixins
This file contains hidden or 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 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