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
createGlobalStyle
and keyframes
are not getting formatted - styled-components
#11196
Comments
As a workaround, I would like to propose something like this import { createGlobalStyle } from 'styled-components'
const styled = { createGlobalStyle }
const GlobalStyle = styled.createGlobalStyle`
body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
...
`
export default GlobalStyle I have previously mentioned it here, styled-components/vscode-styled-components#175 |
you genius! |
@HanSeokSeo you can also do use |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Prettier 2.3.2
Playground link
Input:
Output:
Expected behavior:
Prettier does not format the css styles passed to
createGlobalStyle
andkeyframes
functions from styled-components.This issue exist for a long time but is not yet fixed.
There are some workarounds but fixing this should not be a big deal because Prettier already supports formatting for styled-components functions line
css
.The text was updated successfully, but these errors were encountered: