Skip to content

Add option for single line declarations #395

@ixley

Description

@ixley

It would be great to have an option that would allow for single-line declarations, when there is a single property. I'm indifferent to whether it would also include support for multiple (comma delimited) selectors, or just a single one, but it is nice for reading when there aren't multiple properties.

By extension, this would conditionally adjust the behavior of space-before-opening-brace and space-before-closing-brace, and whatever other line wrapping behavior takes place.

I'm using this in conjunction with scss-lint and I like how the linter has certain logic for various options to allow for single line rulesets.

Single line properties as an exception:

.icon-chevron-up    { &:before { content: "\e030"; } }
.icon-chevron-down  { &:before { content: "\e031"; } }
.icon-chevron-left  { &:before { content: "\e032"; } }
.icon-chevron-right { &:before { content: "\e033"; } }

and standard formatting for multi-line declaration blocks:

p {
  margin: 0;
  padding: 0;
}

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/21072768-add-option-for-single-line-declarations?utm_campaign=plugin&utm_content=tracker%2F214563&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F214563&utm_medium=issues&utm_source=github).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions