eslint / eslint/css

Bug: `no-invalid-at-rules` rejects page margin at-rules

Open
#525 2 comments 0 reactions 1 assignee Claimed by @Pixel998 View on GitHub
accepted bug
Dominant language
JavaScript
Stars
308
Forks
44
Avg merge
2d 6h
Merged PRs (30d)
18

Description

### Environment

ESLint version: v10.8.0
@eslint/css version: v1.4.0
Node version: v24.18.0
npm version: v11.16.0
Operating System: windows

### Which language are you using?

stylesheet

### What did you do?

Configuration

```js
import css from "@eslint/css";

export default [
{
files: ["**/*.css"],
plugins: { css },
language: "css/css",
rules: {
"css/no-invalid-at-rules": "error",
},
},
];
```

```css
@page {
@top-left {
/* page-margin-properties */
}
}
```

### What did you expect to happen?

`@top-left` should be accepted as a page margin at-rule when nested inside `@page`, so `no-invalid-at-rules` should report no error.

### What actually happened?

```
Unknown at-rule '@top-left' found.
```

### Link to Minimal Reproducible Example

https://stackblitz.com/edit/stackblitz-starters-gnlz6acj

### Participation

- [x] I am willing to submit a pull request for this issue.

### AI acknowledgment

- [x] I did not use AI to generate this issue report.
- [ ] (If the above is not checked) I have reviewed the AI-generated content before submitting.

### Additional comments

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@page#margin_at-rules

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.