-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
breaks CSS in JS ${Cls}:not() -> ${Cls}:not () #6259
Copy link
Copy link
Closed
Labels
lang: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.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency
Description
Prettier 1.18.2
Playground link
--parser typescriptI am using Typescript but this does not matter here.
Input:
export const Group = styled.div`
margin: 0;
.input {
margin: 0;
}
${StyledInput}:not(:first-child) {
margin: 0;
}
& > :not(.${inputWrap}):not(${Button}) {
display: flex;
}
`Output:
export const Group = styled.div`
margin: 0;
.input {
margin: 0;
}
${StyledInput}:not (:first-child) {
margin: 0;
}
& > :not(.${inputWrap}):not(${Button}) {
display: flex;
}
`;Expected behavior:
No space should be inserted after not as this breaks the CSS.
Updated with minimal reproduction. It appears that having a child selector is required. Oddly, the space is not always inserted as you can see in the last declaration.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang: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.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency