Skip to content

[Prettier CSS] Multi-line comma separated selectors #1962

Closed

Description

@TheSisb

I think in terms of legibility, multi-lining comma separated selectors is much more readable. Could this be the default?

Example of desired effect:

.ball, 
.rabbit,
.wrapper:hover .contents,
.wrapper:active .contents {
  color: red;
}

What prettier currently emits:

.ball, .rabbit, .wrapper:hover .contents, .wrapper:active .contents {
  color: red;
}

The single line approach usually ends up creating really long lines that require horizontal scrolling and break n characters per line conventions (usually 80 or 120).

Activity

  1. jitendravyas commented on Jun 5, 2017

    @jitendravyas

    It also does this too.
    monosnap 2017-06-05 16-42-38

  2. giuseppeg commented on Jun 6, 2017

    @giuseppeg

    Agreed, this style kinda makes it uglier :)

    Maybe you can borrow the formatting guidelines from Nicolas' Ideomatic CSS. Properties sorted alphabetically because it is probably the only universal criteria (although I prefer Nicolas' version).

  3. added
    lang:css/scss/less
    on Jun 6, 2017
  4. jitendravyas commented on Jun 7, 2017

    @jitendravyas

    Any solution for this?

  5. yuchi commented on Jun 7, 2017

    @yuchi
    Contributor

    I’m making a pull request for this just now.

  6. added 2 commits that reference this issue on Jun 7, 2017
    61376ed
    a7c9ba6
  7. added a commit that references this issue on Jun 8, 2017
    1267273
  8. jitendravyas commented on Jun 8, 2017

    @jitendravyas

    @yuchi will it solve this too?
    #1962 (comment)

  9. vjeux commented on Jun 8, 2017

    @vjeux
    Contributor

    @jitendravyas no, this will not change with his PR. Could you open a separate issue for it?

  10. added
    locked-due-to-inactivity
    on Jul 7, 2018
  11. locked as resolved and limited conversation to collaborators on Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:css/scss/lesslocked-due-to-inactivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions