New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
breaks CSS in JS ${Cls}:not() -> ${Cls}:not () #6259
Labels
lang:css/scss/less
Issues affecting CSS, Less or SCSS
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
scope:dependency
Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency
type:bug
Issues identifying ugly output, or a defect in the program
Comments
Same thing here, but mine is a space inserted before an attribute selector. The added space changes the behaviour of the selector, breaking the CSS. Input: const yesFrame = (
...args: Interpolation<ThemedStyledProps<{}, Theme>>[]
) => css`
${ChatRoot}[data-frame="yes"] & {
${css({}, ...args)}
}
` Output: const yesFrame = (
...args: Interpolation<ThemedStyledProps<{}, Theme>>[]
) => css`
${ChatRoot} [data-frame="yes"] & {
${css({}, ...args)}
}
` |
alexander-akait
added
lang:css/scss/less
Issues affecting CSS, Less or SCSS
scope:dependency
Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency
type:bug
Issues identifying ugly output, or a defect in the program
labels
Jul 15, 2019
Problem in |
I am having a similar issue which I imagine has the same root cause: Input: styled.css`
font-size: var(--fontSizes-${size});
`; Output styled.css`
font-size: var(--fontSizes- ${size});
`; |
4 tasks
fisker
added a commit
to fisker/prettier
that referenced
this issue
Nov 4, 2019
minimum reproduction Prettier 1.18.2 --parser typescript
--single-quote
--tab-width 5
--use-tabs Input: styled.div`
${expr}:not(:first-child) {
// should not add space after :not
}
${expr}[checked] {
// should not add space before [
}
margin: 0;.input {}
` Output: styled.div`
${expr}:not (:first-child) {
// should not add space after :not
}
${expr} [checked] {
// should not add space before [
}
margin: 0;
.input {
}
`; |
thorn0
added a commit
to thorn0/prettier
that referenced
this issue
Apr 23, 2020
fixed by #7883 |
thorn0
added a commit
to thorn0/prettier
that referenced
this issue
Apr 23, 2020
github-actions
bot
added
the
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
label
Jul 23, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lang:css/scss/less
Issues affecting CSS, Less or SCSS
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
scope:dependency
Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency
type:bug
Issues identifying ugly output, or a defect in the program
Prettier 1.18.2
Playground link
I am using Typescript but this does not matter here.
Input:
Output:
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.
The text was updated successfully, but these errors were encountered: