Closed theairbend3r closed 4 years ago
Please see issue #17
For reference - you can see this approach
export const PrimaryButton = styled(Button)` ${({ color }) => color === 'blue' ? tw`hover:border-blue-400` : tw`hover:border-gray-400`}; `;
or you could do something like this
const generateBorderColor = (color) { switch(color) { case 'blue': return tw`hover:border-blue-400` default: return tw`hover:border-gray-400` } } const PrimaryButton = styled(Button)` ${({color}) => ${generateBorderColor(color}}} `
I have an array which contains key-value pairs as follows -
Now, I want to create a
<div> </div>
which has some base styles but it uses the bg-color from the abovecolourTypeMapping
array.For instance,
How do I complete the above component?