-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Prettier breaks with interpolation and complex CSS selector #2883
Copy link
Copy link
Labels
area:multiparserIssues with printing one language inside another, like CSS-in-JSIssues with printing one language inside another, like CSS-in-JSlang:css/scss/lessIssues affecting CSS, Less or SCSSIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.7.0
Playground link
--parser typescript
--tab-width 4Input:
export const foo = css`
&.foo .${bar}::before,&.foo[value="hello"] .${bar}::before {
position: absolute;
}
`;Output:
Error: Error: Couldn't insert all the expressionsExpected behavior:
export const foo = css`
&.foo .${bar}::before,
&.foo[value="hello"] .${bar}::before {
position: absolute;
}
`;If I replace before,& by before, & (space before &), it works but is not pretty...
Thank you to look at this :D you are wonderful!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:multiparserIssues with printing one language inside another, like CSS-in-JSIssues with printing one language inside another, like CSS-in-JSlang:css/scss/lessIssues affecting CSS, Less or SCSSIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.