csscomb删除soorting组之间的换行符

即时通讯使用csscomb.js来组织我的CSS。 它完美的作品,除了我不想在排队之间的linebreaks [见图]

有没有办法去除这些? 我看着每一个地方。

在这里输入图像描述

这是mij设置:

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

没有select,但这是我使用的解决方法。

编辑名为sort-order的属性如下:

原版的:

 "sort-order": [ [ "font", "font-family", "font-size", "font-weight", "font-style", "font-variant", "font-size-adjust", "font-stretch", "font-effect", "font-emphasize", "font-emphasize-position", "font-emphasize-style", "font-smooth", "line-height" ], [ "position", "z-index", "top", "right", "bottom", "left" ], ... 

新:

  "sort-order": [ [ "font", "font-family", "font-size", "font-weight", "font-style", "font-variant", "font-size-adjust", "font-stretch", "font-effect", "font-emphasize", "font-emphasize-position", "font-emphasize-style", "font-smooth", "line-height", "position", "z-index", "top", "right", "bottom", "left", ... ] ] 

基本上你把这些组合成一个,所以没有添加分隔线。 这是Csscomb创作者的官方回应: github.com/csscomb/csscomb.js/issues/314

你可以尝试连接插件csscomb-group-size到csscomb,因为它正在寻找答案本身….
这里有一点关于开发者写道:

CSScomb – 一个伟大的工具,但有时你想添加任何东西。 所以我们试图尽可能地使代码成为一个模块化的,容易扩展的代码。 您可以添加“梳子”所需的function不被叉子困扰。 要做到这一点,有三种方法:

 connect a third-party plug-in write your plugin done on the basis of its postprocessor CSScomb 

第三方插件

最简单的方法来使用别人的插件。 例如,这里有一个选项,当组返回太less时删除声明组之间的空白行。 连接插件是相当简单的,因为这是use ()方法:

 var CSScomb = require('csscomb'); var groupSize = require('csscomb-group-size'); // Number 4 indicates that if the group is less than 4 returns between this // And the previous group will remove the empty string delimiter: var config = { 'group-size': 4 }; // Create a new instance of the "comb": var csscomb = new CSScomb().use(groupSize).configure(config); // Works wonders: csscomb.processPath('path/to/css'); 

但是,如何使这一切工作,我不明白,也许,你会详细了解文件和理解。