-
-
Save scf4/4498561f2f38a82b7525be2b4bc94a61 to your computer and use it in GitHub Desktop.
Styled Map Object 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
import styledMap from 'styled-map'; | |
const buttonColor = styledMap({ | |
primary: '#0c0', | |
warning: '#c00', | |
info: '#0cc', | |
default: '#ccc', | |
}); | |
const Button = styled.button` | |
color: ${buttonColor}; | |
border: 2px solid ${buttonColor}; | |
font-size: ${styledMap({ | |
large: '32px', | |
small: '8px', | |
medium: '18px', | |
default: '16px', | |
})}; | |
`; | |
<Button primary large>Submit</Button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment