csscomb / sublime-csscomb

Sublime plugin for CSScomb—CSS coding style formatter
398 stars 61 forks source link

Feature: Sorting w/o line breaks and reformatting bracket styles #13

Closed bmcminn closed 10 years ago

bmcminn commented 10 years ago

I have this issue where CSS Comb forces formatting of my brackets... this is pretty inconvenient, in addition to issue #5 with not being able to run CSS Comb on a selection.

Having an option to turn these off would be nice, since nested preprocessor styles (eg: LESS) get all funked up like this:

//
// Navigation - (after CSS Comb)
//
.navigation
{
  // border-top: 2px solid @blue-light;
  margin: 0 0 1rem;
  padding-top: 1rem;

  .active;
  li
{
  display: block;
}
  a
{
  display: block;

  padding: .3rem 1rem;

  text-decoration: none;
  text-transform: capitalize;

  color: @blue-gray;
  border-left: 3px solid @blue-light;
    &:hover
{
  color: @white;
}
}{
    a
{
  color: @white;
  border-left-color: @white;
  background-color: @blue-light;
}
}
}

which really muddies up the readability of my files:

//
// Navigation - (before CSS Comb)
//
.navigation {
  // border-top: 2px solid @blue-light;
  margin: 0 0 1rem;
  padding-top: 1rem;

  li {
    display: block;
  }

  a {
    display: block;
    padding: .3rem 1rem;
    border-left: 3px solid @blue-light;
    text-decoration: none;
    color: @blue-gray;
    text-transform: capitalize;

    &:hover {
      color: @white;
    }
  }

  .active {
    a {
      border-left-color: @white;
      color: @white;
      background-color: @blue-light;
    }
  }
}
tonyganch commented 10 years ago

Line breaks are discussed here and brackets are discussed here.