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

CSS pseudo-class are not pretty #8180

Open
fisker opened this issue Apr 29, 2020 · 1 comment
Open

CSS pseudo-class are not pretty #8180

fisker opened this issue Apr 29, 2020 · 1 comment
Labels
lang:css/scss/less Issues affecting CSS, Less or SCSS status:needs discussion Issues needing discussion and a decision to be made before action can be taken

Comments

@fisker
Copy link
Member

fisker commented Apr 29, 2020

Prettier 2.0.5
Playground link

--parser css

Input:

:not(
  .some-class
  .some-other-class
  .some-very-loooooooooooooong-class
  .some-very-loooooooooooooong-class
) {}

:not(
  .some-class
  .some-other-class
  .some-very-loooooooooooooong-class
  .some-very-loooooooooooooong-class
) +  :not(
  .some-class
  .some-other-class
  .some-very-loooooooooooooong-class
  .some-very-loooooooooooooong-class
) {}

:not(
  .some-class
  .some-other-class
  .some-very-loooooooooooooong-class
  .some-very-loooooooooooooong-class
) ~  :has(
  b:not(
    .some-class
    .some-other-class
    +
    .some-very-loooooooooooooong-class
    .some-very-loooooooooooooong-class
  )
):nth-last-child(2n + 1)::before {}

Output:

:not(.some-class
    .some-other-class
    .some-very-loooooooooooooong-class
    .some-very-loooooooooooooong-class) {
}

:not(.some-class
    .some-other-class
    .some-very-loooooooooooooong-class
    .some-very-loooooooooooooong-class)
  + :not(.some-class
    .some-other-class
    .some-very-loooooooooooooong-class
    .some-very-loooooooooooooong-class) {
}

:not(.some-class
    .some-other-class
    .some-very-loooooooooooooong-class
    .some-very-loooooooooooooong-class)
  ~ :has(b:not(.some-class
      .some-other-class
      + .some-very-loooooooooooooong-class
      .some-very-loooooooooooooong-class)):nth-last-child(2n + 1)::before {
}

Expected behavior:

Don't know, some better way.

@alexander-akait alexander-akait added lang:css/scss/less Issues affecting CSS, Less or SCSS status:needs discussion Issues needing discussion and a decision to be made before action can be taken labels Apr 29, 2020
@lydell
Copy link
Member

lydell commented Apr 29, 2020

I think the input code looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:css/scss/less Issues affecting CSS, Less or SCSS status:needs discussion Issues needing discussion and a decision to be made before action can be taken
Projects
None yet
Development

No branches or pull requests

3 participants