Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix formatting of pseudo-elements and pseudo-classes in styled-compon…
…ents (#7842)
- Loading branch information
Showing
4 changed files
with
120 additions
and
10 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,21 @@ | ||
#### Fix formatting of pseudo-elements and pseudo-classes in styled-components template literals ([#7842](https://github.com/prettier/prettier/pull/7842) by [@thorn0](https://github.com/thorn0)) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
const Foo = styled.div` | ||
${media.smallDown}::before {} | ||
`; | ||
|
||
// Prettier stable | ||
const Foo = styled.div` | ||
${media.smallDown}: : before{ | ||
} | ||
`; | ||
|
||
// Prettier master | ||
const Foo = styled.div` | ||
${media.smallDown}::before { | ||
} | ||
`; | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const Icon = styled.div` | ||
flex: none; | ||
transition: fill 0.25s; | ||
width: 48px; | ||
height: 48px; | ||
${Link}:hover { | ||
fill: rebeccapurple; | ||
} | ||
${Link} :hover { | ||
fill: yellow; | ||
} | ||
${media.smallDown}::before {} | ||
` |