function-no-unknown
What it does
Section titled “What it does”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.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...@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 }...Configuration
Section titled “Configuration”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.
Upstream equivalents
Section titled “Upstream equivalents”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. |