【问题标题】:How to sort Sass properties (for example in alphabetical order)如何对 Sass 属性进行排序(例如按字母顺序)
【发布时间】:2019-07-31 08:50:26
【问题描述】:

我需要 gulp 模块,例如 vscode 扩展,它可以自动对 .sass 文件中的属性进行排序。

我知道 sort-sass npm 模块,但我不能自动化它(它在 CLI 中工作,所以我尝试从 gulp-exec 模块运行它)

需要从这个:

text-decoration: none
margin: 0 auto
justify-content: space-between
text-transform: uppercase
width: 500px
align-items: center
color: black
padding: 100px
background-color: white
z-index: 5
height: 100px
display: flex

到这里:

display: flex
justify-content: space-between
align-items: center
height: 100px
width: 500px
padding: 100px
margin: 0 auto
background-color: white
color: black
text-decoration: none
text-transform: uppercase
z-index: 5

(贴个人喜好,没必要这样)


现在我正在使用带有自动修复功能的 stylelint,这很酷。

【问题讨论】:

标签: node.js sass gulp


【解决方案1】:

谢谢你,Tien Duong。我在 vscode 中安装了 CSSComb,在我进行配置后效果很好(需要一些时间来理清它是如何工作的。现在我的属性每次保存文件时都会排序)

【讨论】:

    猜你喜欢
    • 2021-03-20
    • 1970-01-01
    • 1970-01-01
    • 2010-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-29
    • 2015-05-17
    相关资源
    最近更新 更多