---
# Don't modify this file manually. This file is auto generated from source, and you will lose your changes next time the website is built.
# Head to the `biomejs/biome` repository, and modify the source code in there.

title: noUnknownAtRules
description: Learn more about noUnknownAtRules
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem label="CSS" icon="seti:css">
## Summary
- Rule available since: `v2.0.0`
- Diagnostic Category: [`lint/suspicious/noUnknownAtRules`](/reference/diagnostics#diagnostic-category)
- This rule is **recommended**, meaning it is enabled by default.
- This rule doesn't have a fix.
- The default severity of this rule is [**error**](/reference/diagnostics#error).
- Sources: 
  - Same as [`at-rule-no-unknown`](https://github.com/stylelint/stylelint/blob/main/lib/rules/at-rule-no-unknown/README.md)

## How to configure
```json title="biome.json"
{
	"linter": {
		"rules": {
			"suspicious": {
				"noUnknownAtRules": "error"
			}
		}
	}
}

```
## Description
Disallow unknown at-rules.

For details on known at-rules, see the [MDN web docs](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).

## Examples

### Invalid

```css
@uNkNoWn {}
```

<pre class="language-text"><code class="language-text">code-block.css:1:2 <a href="https://biomejs.dev/linter/rules/no-unknown-at-rules">lint/suspicious/noUnknownAtRules</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Unexpected unknown at-rule: </span><span style="color: Tomato;"><strong>uNkNoWn</strong></span><span style="color: Tomato;"> </span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>@uNkNoWn &#123;&#125;<br />   <strong>   │ </strong> <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;"><strong>uNkNoWn</strong></span><span style="color: lightgreen;"> is not a standard CSS at-rule, which may lead to unexpected styling results or failure to interpret the styles as intended.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">See </span><span style="color: lightgreen;"><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule">MDN web docs</a></span><span style="color: lightgreen;"> for a known list of at-rules.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">To fix this issue, consider removing the unknown at-rule.</span><br />  <br /></code></pre>

```css
@unknown-at-rule {
  font-size: 14px;
}
```

<pre class="language-text"><code class="language-text">code-block.css:1:2 <a href="https://biomejs.dev/linter/rules/no-unknown-at-rules">lint/suspicious/noUnknownAtRules</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Unexpected unknown at-rule: </span><span style="color: Tomato;"><strong>unknown-at-rule</strong></span><span style="color: Tomato;"> </span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>@unknown-at-rule &#123;<br />   <strong>   │ </strong> <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong>  font-size: 14px;<br />    <strong>3 │ </strong>&#125;<br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;"><strong>unknown-at-rule</strong></span><span style="color: lightgreen;"> is not a standard CSS at-rule, which may lead to unexpected styling results or failure to interpret the styles as intended.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">See </span><span style="color: lightgreen;"><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule">MDN web docs</a></span><span style="color: lightgreen;"> for a known list of at-rules.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">To fix this issue, consider removing the unknown at-rule.</span><br />  <br /></code></pre>

### Valid

```css
@charset 'UTF-8';
```

```css
@media (max-width: 960px) {
  body {
    font-size: 13px;
  }
}
```

## Options

### `ignore`

A list of unknown at-rule names to ignore (case-insensitive).

```json title='biome.json'
{
	"linter": {
		"rules": {
			"suspicious": {
				"noUnknownAtRules": {
					"options": {
						"ignore": [
							"custom-at-rule",
							"my-custom-rule"
						]
					}
				}
			}
		}
	}
}

```

#### Valid

```css
@custom-at-rule {}
@my-custom-rule {
  color: red;
}
```

## Related links

- [Disable a rule](/linter/#disable-a-rule)
- [Configure the code fix](/linter#configure-the-code-fix)
- [Rule options](/linter/#rule-options)
- [Source Code](https://github.com/biomejs/biome/blob/main/crates/biome_css_analyze/src/lint/suspicious/no_unknown_at_rules.rs)
- [Test Cases](https://github.com/biomejs/biome/blob/main/crates/biome_css_analyze/tests/specs/suspicious/noUnknownAtRules)

</TabItem>
</Tabs>