alpha-value-notation
指定 alpha 值的百分比或数字表示法。
¥Specify percentage or number notation for alpha-values.
a { color: rgb(0 0 0 / 0.5) }
/** ↑
* This notation */
fix
选项 可以自动修复此规则报告的所有问题。
¥The fix
option can automatically fix all of the problems reported by this rule.
选项
¥Options
"number"
Alpha 值必须始终使用数字表示法。
¥Alpha-values must always use the number notation.
{
"alpha-value-notation": "number"
}
以下模式被视为问题:
¥The following patterns are considered problems:
a { opacity: 50% }
a { color: rgb(0 0 0 / 50%) }
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { opacity: 0.5 }
a { color: rgb(0 0 0 / 0.5) }
"percentage"
Alpha 值必须始终使用百分比表示法。
¥Alpha-values must always use percentage notation.
{
"alpha-value-notation": "percentage"
}
以下模式被视为问题:
¥The following patterns are considered problems:
a { opacity: 0.5 }
a { color: rgb(0 0 0 / 0.5) }
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { opacity: 50% }
a { color: rgb(0 0 0 / 50%) }
可选的辅助选项
¥Optional secondary options
exceptProperties
{ "exceptProperties": ["array", "of", "properties", "/regex/"] }
反转匹配属性的主要选项。
¥Reverse the primary option for matching properties.
鉴于:
¥Given:
{
"alpha-value-notation": ["percentage", { "exceptProperties": ["opacity"] }]
}
以下模式被视为问题:
¥The following patterns are considered problems:
a { opacity: 50% }
a { color: rgb(0 0 0 / 0.5) }
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { opacity: 0.5 }
a { color: rgb(0 0 0 / 50%) }