hudochenkov / postcss-sorting

PostCSS plugin to keep rules and at-rules content in order.
MIT License
517 stars 31 forks source link

Line after dollar var #56

Closed UltraDosaaf closed 7 years ago

UltraDosaaf commented 7 years ago

I need empty line after dollar variable. Maybe there is the option opposit to "dollar-variable-empty-line-before"?

hudochenkov commented 7 years ago

No there isn't. Can you show different code examples and we'll figure out what configuration you need to enforce this?

UltraDosaaf commented 7 years ago

Sure:

#wrapper {
   $width: 600px;
   $height: 300px;

   width: $width;
   height: $height;
   margin: 0 auto 0;

   border: 1px solid #ff0000;

   .item {
      position: relative;
      overflow: hidden;
      $bg_color: #ff9900;

      background-color: $bg_color;

      .block {
         $block_width: $width / 3;

         float: left;
         width: $block_width;
      }
   }
}
hudochenkov commented 7 years ago

You might want this setting:

{
    "declaration-empty-line-before": [true, {
        "except": ["first-nested", "after-comment", "after-declaration"]
    }],
}
UltraDosaaf commented 7 years ago

It clears now all empty lines except the one after dollar-rule )

hudochenkov commented 7 years ago

There is no *-after options. Your case is unusual. Most of developers group variables in one place, declaration in another place. In your case variables all over the rule.