csscomb.js icon indicating copy to clipboard operation
csscomb.js copied to clipboard

.sass, 3.0.0: adding second delimiter newline

Open afknapping opened this issue 11 years ago • 4 comments

config:

"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": "  ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
"sort-order-fallback": "abc",
"space-before-colon": "",
"space-after-colon": " ",
"space-before-combinator": " ",
"space-after-combinator": " ",
"space-between-declarations": "",
"space-before-opening-brace": " ",
"space-after-opening-brace": "",
"space-after-selector-delimiter": " ",
"space-before-selector-delimiter": "",
"space-before-closing-brace": "",
"strip-spaces": true,
"tab-size": true,
"unitless-zero": true,
"vendor-prefix-align": true,
"verbose": true,

original sass:

=hello
  border: 1px

body
  +hello
  color: white
  font-family: red

after running comb:

=hello
  border: 1px

body
  font-family: red

  color: white

  +hello

after running comb second time:

=hello
  border: 1px

body
  font-family: red


  color: white


  +hello


it stays like this on more runs.

OT: why is the mixin sorted to the end of the attributes?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3325611-sass-3-0-0-adding-second-delimiter-newline?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).

afknapping avatar Jul 25 '14 10:07 afknapping

@filtercake Any luck with finding a solution for this second line issue?

skrzyszewski avatar Feb 18 '15 21:02 skrzyszewski

@filtercake I can't speak to the extra whitespace, but in regards to the mixin being sorted to the end, you can set that in your sort-order with $include. I agree that putting it at the end of the property list is a poor default, but it's unlikely to be intentional. see: https://github.com/csscomb/csscomb.js/blob/master/doc/options.md#sort-order-vs-preprocessors

ixley avatar Jun 08 '15 22:06 ixley

+1 . It seems that it needs the curly brackets to give "context" and manage correctly the whitespace. Pretty annoying, because it seems to happen only for .sass syntax files. Anyone found a solution?

eduardodomingos avatar Jan 04 '16 20:01 eduardodomingos

I'm actually running into this issue in SCSS files too. This is my configuration (I've snipped out the sort-order to keep the length down).

I have it configured this way to not mess with single-line rules (which I prefer to format like this, as it really cuts down on scrolling when reading a stylesheet: .selector { rule: value }).

Most of the insertions happen near lines that were moved up or down for property sorting, but the really weird thing is it also happens in areas where no actual changes were made. To me it just looks like empty lines are being randomly inserted throughout the file.

Using version 3.1.7.

{
  "eof-newline": true,
  "leading-zero": false,
  "remove-empty-rulesets": true,
  "space-after-colon": " ",
  "space-after-combinator": " ",
  "space-before-colon": "",
  "space-before-combinator": " ",
  "space-before-selector-delimiter": "",
  "strip-spaces": true,
  "unitless-zero": true,
  "sort-order": [--snipped--]
}

symmetriq avatar Sep 12 '16 08:09 symmetriq