@ bridge-ds/ stylelint-plugin (英语)
使用 Bridge 设计系统的产品应用程序的Stylelint规则:生色、长度、光度、边框、阴影、,
期限、放松、z-index和字体在存在设计标志的地方报告,并使用标志.
stylelint --fix 以 var(--token);没有其他内容被重写.
它读取符号(每个品牌,主题和密度)通过 @bridge-ds/core 和设计系统的
bridge.config.json因此,建议与 bridge audit 编辑 bridge_audit MCP工具.
安装
npm install --save-dev stylelint @bridge-ds/stylelint-plugin
// .stylelintrc.json in the product app
{
"plugins": ["@bridge-ds/stylelint-plugin"],
"rules": {
"bridge/use-tokens": [true, { "designSystem": "../design-system" }]
}
}
桥/用具
.card {
color: #1c2735; /* Use var(--color-text-default) instead of #1c2735: it is the same color (#1c2735). */
padding: 13px; /* Use a token instead of the raw spacing 13px: closest is var(--space-3) (12px, high match). */
z-index: 1000; /* fixed to var(--layer-dropdown) */
}
| 选项 | 默认 | |
|---|---|---|
designSystem | BRIDGE_DS,否则最近的文件夹与 bridge.config.json | 设计系统回波根. |
minConfidence | "medium" | 仅在一个符号至少如此接近时报告一个值 : exact, (中文(简体) ), high, (中文(简体) ), medium, (中文(简体) ), low。 。 。 . |
categories | 全部 | color, (中文(简体) ), spacing, (中文(简体) ), size, (中文(简体) ), radius, (中文(简体) ), border-width, (中文(简体) ), shadow, (中文(简体) ), duration, (中文(简体) ), easing, (中文(简体) ), z-index, (中文(简体) ), font-family, (中文(简体) ), font-size, (中文(简体) ), font-weight, (中文(简体) ), line-height。 。 。 . |
ignoreProperties | 无 | 财产名称或 /regex/ 要跳过的字符串 . |
颜色由每个模式的知觉距离( OKLab 中的deltaE) 相匹配; 语义符号和符号
符合属性的(背景获得表面符号)赢得近五十个。 长度会到达最接近的尺度.
var() 后退率,百分比, 0, (中文(简体) ), auto 和本地堆放( e)z-index 0, 1, -1)没有报告.