Forked from carl0zen/styled-components-mixin-example.jsx
Created
November 18, 2019 21:30
-
-
Save russellr922/754ff0510b022a943214e1b25c36c4da to your computer and use it in GitHub Desktop.
Styled Components Mixin example
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
// 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