Created
October 13, 2020 05:25
-
-
Save chetanraj/964d543aecef78d7fdbbd7760f35d6dd to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import styled from 'styled-components'; | |
const StyledInput = styled.input` | |
color: ${props => props.disabled ? `${props.theme.colors.gray}` : `${props.theme.colors.darkgray}`}; | |
font-size: ${props => `${props.theme.fontSizes[2]}px`}; | |
border: 1px solid; | |
border-color: ${props => props.theme.colors[props.borderColor] || props.theme.colors.lightgray}; | |
background: ${props => props.theme.colors[props.bg] || props.theme.colors.white}; | |
border-radius: ${props => `${props.theme.radii[2]}`}; | |
padding: ${props => `${props.theme.space[2]}`}; | |
outline: none; | |
::placeholder, | |
::-webkit-input-placeholder { | |
font-size: ${props => `${props.theme.fontSizes[2]}px`}; | |
} | |
:-ms-input-placeholder { | |
font-size: ${props => `${props.theme.fontSizes[2]}px`}; | |
} | |
`; | |
const Input = props => { | |
return <StyledInput {...props} />; | |
}; | |
export default Input; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment