area:binary expressionsarea:multiparserhelp wantedlang:css/scss/less
描述
I'm not sure if it's can be fixable and how. But it's very common when using styled-components to write constructions that look like that.
Prettier 1.10.2 Playground link
Input:
const Something = styled.span`
${props => props.right && css`
padding: 10px 134px 10px 20px;
&:after {
left: initial;
right: 30px;
}
`}
`
So it looks a bit cleaner, especially for multiple rules. After the latest update, it's broken and looks ugly.
Output:
const Something = styled.span`
${props =>
props.right &&
css`
padding: 10px 134px 10px 20px;
&:after {
left: initial;
right: 30px;
}
`};
`;
To prove my words, this construction is on the main page first example of styled-components website: https://www.styled-components.com/