Skip to content
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

Styled Components pseudo-selectors issue #7882

Closed
gochi-dot opened this issue Mar 26, 2020 · 2 comments
Closed

Styled Components pseudo-selectors issue #7882

gochi-dot opened this issue Mar 26, 2020 · 2 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:duplicate Issues that are a duplicate of a previous issue

Comments

@gochi-dot
Copy link

gochi-dot commented Mar 26, 2020

There is unexpected space after :not, which breaks the ts build.

Prettier 2.0.2
Playground link

--parser babel

Input:

export const Item = styled.div``;

export const List = styled.div`
    display: flex;
    flex-direction: column;
    ${Item}:not(:first-child) {
        margin-top: 10px;
    }
`;

Output:

export const Item = styled.div``;

export const List = styled.div`
  display: flex;
  flex-direction: column;
  ${Item}:not (:first-child) {
    margin-top: 10px;
  }
`;

Expected behavior:

export const Item = styled.div``;

export const List = styled.div`
  display: flex;
  flex-direction: column;
  ${Item}:not(:first-child) {
    margin-top: 10px;
  }
`;
@gochi-dot
Copy link
Author

Same issue with:

    ${Item}:nth-of-type (2) {
        flex-grow: 1;
    }

@thorn0
Copy link
Member

thorn0 commented Mar 26, 2020

Duplicate of #7826

@thorn0 thorn0 marked this as a duplicate of #7826 Mar 26, 2020
@thorn0 thorn0 closed this as completed Mar 26, 2020
@thorn0 thorn0 added the type:duplicate Issues that are a duplicate of a previous issue label Mar 26, 2020
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jun 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:duplicate Issues that are a duplicate of a previous issue
Projects
None yet
Development

No branches or pull requests

2 participants