@ecosia/stylelint-config-property-sort-order-smacs (英语)
相关软件包
使用量
下列情况被视为侵权行为:
a {
color: red;
top: 0;
}
a {
top: 0;
color: black;
position: absolute;
display: block;
}
以下模式是: 没有 被考虑的侵权行为:
a {
top: 0;
color: red;
}
a {
display: block;
position: absolute;
top: 0;
color: black;
}
参见 cs-财产类型-顺序-smacs 财产命令综合清单.
关于Stylelint配置的更多信息,请查看 配置 向导.
高级
目前这只有在导出 JavaScript 配置的情况下才有可能.
上文概述的基本用法将强制执行: 严格 在其组内排序(框、边框、背景等)。 鉴于此配置使用了 样式lint 顺序 在引擎盖下,还有几处额外的功能可以配置. 这将需要手动生成配置 - 但是在认为合适的额外选项中传递 。 这些规定将适用于: 每个 属性组.
选项
参见 属性顺序 可选选项列表的文档.
所有选项除外 properties 财务报告和审定财务报表 groupName 可以修改.
实例
灵活排序
这将允许同一组内的属性按任何顺序排列.
鉴于:
// stylelint.config.js
const sortOrderSmacss = require('stylelint-config-property-sort-order-smacss/generate');
module.exports = {
plugins: ['stylelint-order'],
rules: {
'order/properties-order': [
sortOrderSmacss()
],
},
};
下列情况被视为侵权行为:
a {
top: 0;
position: absolute;
display: block;
color: black;
}
鉴于:
// stylelint.config.js
const sortOrderSmacss = require('stylelint-config-property-sort-order-smacss/generate');
module.exports = {
plugins: ['stylelint-order'],
rules: {
'order/properties-order': [
sortOrderSmacss({ order: 'flexible' })
],
},
};
以下模式是: 没有 被考虑的侵权行为:
a {
top: 0;
position: absolute;
display: block;
color: black;
}
属性组后为空行
这将允许在每个属性组后有一条空行 :
鉴于:
// stylelint.config.js
const sortOrderSmacss = require('stylelint-config-property-sort-order-smacss/generate');
module.exports = {
plugins: ['stylelint-order'],
rules: {
'order/properties-order': [
sortOrderSmacss({ emptyLineBefore: 'never' })
],
},
};
下列情况被视为侵权行为:
a {
display: block;
position: absolute;
top: 0;
color: black;
}
鉴于:
// stylelint.config.js
const sortOrderSmacss = require('stylelint-config-property-sort-order-smacss/generate');
module.exports = {
plugins: ['stylelint-order'],
rules: {
'order/properties-order': [
sortOrderSmacss({ emptyLineBefore: 'always' })
],
},
};
以下模式是: 没有 被考虑的侵权行为:
a {
display: block;
position: absolute;
top: 0;
color: black;
}
捐款
见 捐款额 捐款准则.
许可证
见 利比里亚 获取许可证信息.