Forked from carl0zen/styled-components-mixin-example.jsx
Created
March 30, 2017 20:07
-
-
Save amowu/dac55173427fe458246e9a24f97931fa to your computer and use it in GitHub Desktop.
Styled Components Mixin example
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
// Mixin like functionality | |
const textInput = props => ` | |
color: ${props.error ? color.white : color.base}; | |
background-color: ${props.error ? color.alert : color.white}; | |
`; | |
export const Input = styled.input` | |
${textInput} | |
`; | |
export const Textarea = styled.textarea` | |
${textInput}; | |
height: ${props => props.height ? props.height : '130px'} | |
resize: none; | |
overflow: auto; | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment