Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix line breaks for CSS in JS (#9136)
* Fix 2.1 regression for css-in-js * Add changelog
- Loading branch information
1 parent
d5da779
commit ab9474e
Showing
6 changed files
with
104 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#### Fix line breaks for CSS in JS (#9136 by @sosukesuzuki) | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
styled.div` | ||
// prettier-ignore | ||
@media (aaaaaaaaaaaaa) { | ||
z-index: ${(props) => (props.isComplete ? '1' : '0')}; | ||
} | ||
`; | ||
styled.div` | ||
${props => getSize(props.$size.xs)} | ||
${props => getSize(props.$size.sm, 'sm')} | ||
${props => getSize(props.$size.md, 'md')} | ||
`; | ||
|
||
// Prettier stable | ||
styled.div` | ||
// prettier-ignore | ||
@media (aaaaaaaaaaaaa) { | ||
z-index: ${(props) => | ||
props.isComplete ? "1" : "0"}; | ||
} | ||
`; | ||
styled.div` | ||
${(props) => getSize(props.$size.xs)} | ||
${(props) => getSize(props.$size.sm, "sm")} | ||
${(props) => | ||
getSize(props.$size.md, "md")} | ||
`; | ||
|
||
// Prettier master | ||
styled.div` | ||
// prettier-ignore | ||
@media (aaaaaaaaaaaaa) { | ||
z-index: ${(props) => (props.isComplete ? "1" : "0")}; | ||
} | ||
`; | ||
styled.div` | ||
${(props) => getSize(props.$size.xs)} | ||
${(props) => getSize(props.$size.sm, "sm")} | ||
${(props) => getSize(props.$size.md, "md")} | ||
`; | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters