function-no-unknown
禁止未知功能。
¥Disallow unknown functions.
a { transform: unknown(1); }
/** ↑
* Functions like this */
该规则认为 CSS 规范中定义的函数是已知的。
¥This rule considers functions defined in the CSS Specifications to be known.
此规则忽略双虚线自定义函数,例如 --custom-function()
。
¥This rule ignores double-dashed custom functions, e.g. --custom-function()
.
message
次要选项 可以接受该规则的参数。
¥The message
secondary option can accept the arguments of this rule.
此规则与以下内容重叠:
¥This rule overlaps with:
我们建议对 CSS 使用这些规则,对类似 CSS 的语言(例如 SCSS 和 Less)使用此规则。
¥We recommend using these rules for CSS and this rule for CSS-like languages, such as SCSS and Less.
选项
¥Options
true
{
"function-no-unknown": true
}
以下模式被视为问题:
¥The following patterns are considered problems:
a { transform: unknown(1); }
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { transform: scale(1); }
a { transform: --custom-function(1); }
可选的辅助选项
¥Optional secondary options
ignoreFunctions
{ "ignoreFunctions": ["array", "of", "functions", "/regex/"] }
忽略指定的函数。
¥Ignore the specified functions.
鉴于:
¥Given:
{
"function-no-unknown": [true, { "ignoreFunctions": ["theme", "/^foo-/"] }]
}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a { transform: theme(1); }
a { transform: foo-func(1); }