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

Emotion css parser does not support selectors over multiple lines #481

Closed
einarlove opened this issue Nov 30, 2017 · 2 comments · Fixed by #484
Closed

Emotion css parser does not support selectors over multiple lines #481

einarlove opened this issue Nov 30, 2017 · 2 comments · Fixed by #484

Comments

@einarlove
Copy link

  • emotion version: 8.0.10
  • react version: 16.2.0

Relevant code

css`
  .my-class:hover
  .its-child {
    background: pink;
  }
`

Outputs

.my-class:hover;
.its-child { background: pink; }

Expected

.my-class:hover .its-child { background: pink; }

In the CSS spec you can have selectors over multiple lines, but in my experience emotion does not.
This gets even more problematic when Prettier formats the code to be within set line width.

@thysultan
Copy link

Related to the default auto semi-colon insertion mode(configurable) in stylis #74.

@emmatown emmatown mentioned this issue Nov 30, 2017
3 tasks
@greggb
Copy link
Member

greggb commented Dec 3, 2017

I know this is already being looked into, but in this instance wrapping your child in brackets would solve the issue and be more clear about how the rule will apply.

In:

css`
  .myClass:hover {
      .itsChild {
        background: pink;
      }
  }
`

Out:

.myClass:hover .itsChild {
    background: pink;
}

@tkh44 tkh44 closed this as completed in #484 Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants