lightness-notation
为亮度指定数字或百分比表示法。
¥Specify number or percentage notation for lightness.
a { color: oklch(85% 0.17 88) }
/** ↑
* This notation */
此规则支持 oklch
、oklab
、lch
和 lab
函数。
¥This rule supports oklch
, oklab
, lch
and lab
functions.
fix
选项 可以自动修复此规则报告的所有问题。
¥The fix
option can automatically fix all of the problems reported by this rule.
message
次要选项 可以接受该规则的参数。
¥The message
secondary option can accept the arguments of this rule.
选项
¥Options
string
:"percentage"|"number"
"percentage"
亮度必须始终使用百分比表示法。
¥Lightness must always use the percentage notation.
以下模式被视为问题:
¥The following patterns are considered problems:
a { color: oklch(0.85 0.17 88) }
a { color: oklab(0.86 0.2 154) }
a { color: lch(85 0.17 88) }
a { color: lab(86 0.2 154) }
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { color: oklch(85% 0.17 88) }
a { color: oklab(86% 0.2 154) }
a { color: lch(85% 0.17 88) }
a { color: lab(86% 0.2 154) }
"number"
亮度必须始终使用数字表示法。
¥Lightness must always use the number notation.
以下模式被视为问题:
¥The following patterns are considered problems:
a { color: oklch(85% 0.17 88) }
a { color: oklab(86% 0.2 154) }
a { color: lch(85% 0.17 88) }
a { color: lab(86% 0.2 154) }
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { color: oklch(0.85 0.17 88) }
a { color: oklab(0.86 0.2 154) }
a { color: lch(85 0.17 88) }
a { color: lab(86 0.2 154) }