Skip to content

noUnknownFunction (CSS)

Language CSS
biome.json
{
"linter": {
"rules": {
"correctness": {
"noUnknownFunction": "error"
}
}
}
}

Disallow unrecognized CSS value functions.

This rule ignores double-dashed custom functions, e.g. --custom-function(). In SCSS files, it also ignores SCSS built-in functions and functions declared in the same file.

The rule does not resolve functions made globally available by legacy SCSS @import. Configure the ignore option for imported functions that cannot be resolved locally.

Data sources of known CSS value functions are:

a { transform: unknown(1); }
code-block.css:1:16 lint/correctness/noUnknownFunction ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Unexpected unknown function: unknown

> 1 │ a { transform: unknown(1); }
│ ^^^^^^^
2 │

ℹ Browsers ignore a declaration that contains an unknown function, so the style is not applied.

ℹ Use a known function instead.

ℹ See MDN web docs for more details.

a { transform: scale(1); }

Lists additional function names to allow, without regard to letter case. Defaults to an empty list.

biome.json
{
"linter": {
"rules": {
"correctness": {
"noUnknownFunction": {
"level": "on",
"options": {
"ignore": [
"custom-function"
]
}
}
}
}
}
}
a { transform: custom-function(1); }