Skip to main content

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.

选项

¥Options

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: ["/regex/", /regex/, "non-regex"]

忽略指定的函数。

¥Ignore the specified functions.

例如,true

¥For example, with true.

鉴于:

¥Given:

["theme", "/^foo-/"]

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { transform: theme(1); }
a { transform: foo-func(1); }