at-rule-no-unknown
CSS / SCSS / LessCSS / SCSS / LessCSS / SCSS / Lesscorrectnessno fixdefault: warncss/stylelint-recommended
What it does
Section titled “What it does”Reports an at-rule that no CSS specification lists. Vendor-prefixed ones are not reported; SCSS has its own (@include, @mixin, …) and Less at-rules are not checked. Tailwind’s are left out by default; the ignore option lists more.
Why it matters
Section titled “Why it matters”An unknown at-rule is a typo or a rule that the browser does not implement, and the browser skips the whole block it opens, so a large part of the stylesheet can be dropped.
To fix, correct the name.
Example
Section titled “Example”@foo {}...@media (min-resolution: 2x) {}...Configuration
Section titled “Configuration”css: lint: rules: at-rule-no-unknown: level: warn # off, warn (default), error options: ignore: ["tailwind","apply","theme","utility","variant","custom-variant","source","plugin","config","reference","screen"]less: lint: rules: at-rule-no-unknown: level: warn # off, warn (default), error options: ignore: ["tailwind","apply","theme","utility","variant","custom-variant","source","plugin","config","reference","screen"]scss: lint: rules: at-rule-no-unknown: level: warn # off, warn (default), error options: ignore: ["tailwind","apply","theme","utility","variant","custom-variant","source","plugin","config","reference","screen"]| Option | Type | Default | Description |
|---|---|---|---|
ignore |
list | ["tailwind","apply","theme","utility","variant","custom-variant","source","plugin","config","reference","screen"] |
Names left out: names, or /regex/. |
Enabled by the presets: css/stylelint-recommended.
Suppress one line with sudsy-disable-next-line at-rule-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 | at-rule-no-unknown |
partial | Less at-rules are not told apart (detached ruleset calls look like at-rules), so none is reported in Less. |
| stylelint-scss | scss/at-rule-no-unknown |
partial | Less at-rules are not told apart (detached ruleset calls look like at-rules), so none is reported in Less. |