Skip to content

function-no-unknown

Reports a function in a declaration value that no CSS specification lists. SCSS and Less are not checked, because their built-in functions are not in the table. The ignore option lists names to leave out.

An unknown function is a typo or a function that the browser does not implement, and the declaration is dropped without an error.

To fix, correct the name.

Reported
...
@media (min-resolution: 2x) {}
a { colour: red; width: 1foo; height: 2x; -webkit-foo: 1; --x: 1foo; width: foo(1) bar(2) var(--a) calc(1px + 2px) }
a { background: image-set(url("a.png") 1x); margin: 1PX 2% 1e3em }
...
css:
lint:
rules:
function-no-unknown:
level: warn # off (default), warn, error
options:
ignore: []
less:
lint:
rules:
function-no-unknown:
level: warn # off (default), warn, error
options:
ignore: []
scss:
lint:
rules:
function-no-unknown:
level: warn # off (default), warn, error
options:
ignore: []
Option Type Default Description
ignore list [] Names left out: names, or /regex/.

Suppress one line with sudsy-disable-next-line function-no-unknown in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
stylelint function-no-unknown partial SCSS and Less built-in functions are not in the table, so none is reported there.
stylelint-scss scss/function-no-unknown partial SCSS and Less built-in functions are not in the table, so none is reported there.