Closed
Description
Thanks to the addition of tagged template literals it is possible to natively use styled components in CoffeeScript 1.12.
Hence something like
const Button = styled.button`
background: white;
color: palevioletred;
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border: 2px solid palevioletred;
border-radius: 3px;
`;
translates to
Button = styled.button"""
background: white
color: palevioletred
font-size: 1em
margin: 1em
padding: 0.25em 1em
border: 2px solid palevioletred
border-radius: 3px
"""
in CoffeeScript.
Styled components enable us to to override attributes in given components like so:
const TomatoButton = styled(Button)`
color: tomato;
border-color: tomato;
`;
When trying to translate this to CoffeeScript
TomatoButton = styled(Button)"""
color: tomato
border-color: tomato
"""
the compiler is throwing:
error: unexpected string
TomatoButton = styled(Button)"""
^^^