---
title: "Fail on unknown and duplicate CSS · Agent Wranglers"
url: https://agentwranglers.se/playbook/html-css/checks-in-code/unknown-and-duplicate-css
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Fail on unknown and duplicate CSS

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

For AI agents: [llms.txt](https://agentwranglers.se/llms.txt) is a short guide that sends you to the rules your problem needs, and [rules.json](https://agentwranglers.se/playbook/html-css/rules.json) holds every rule of this playbook as JSON.

- Level: Recommended
- Chapter: [Checks in code](https://agentwranglers.se/playbook/html-css/checks-in-code)
- Rule: Make the linter reject unknown properties, values, at-rules and type selectors, and duplicate selectors or properties.
- How: A typo such as `colr` or `dispaly: grid` is ignored by the browser without a sound. A second `.order-card` block in the same file splits one component in two. Turn on the linter's unknown and duplicate rules, and allow vendor prefixes only through the build tool. Duplicates across files are caught by [Give each component exactly one stylesheet](https://agentwranglers.se/playbook/html-css/structure-and-files/component-stylesheet).
- Check: The linter rules in the example below are all on. The build fails when you add `dispaly: grid` or a second `.order-card` block to a component file.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JSON example

```json
{
  "rules": {
    "property-no-unknown": true,
    "declaration-property-value-no-unknown": true,
    "at-rule-no-unknown": true,
    "selector-type-no-unknown": true,
    "no-duplicate-selectors": true,
    "declaration-block-no-duplicate-properties": true,
    "property-no-vendor-prefix": true
  }
}
```

### CSS example

```css
/* Each line fails the lint */
.order-card { dispaly: grid; }
.order-card { margin: 0; margin: 0; }
@layr components { }
```

## Related rules

- [Give each component exactly one stylesheet](https://agentwranglers.se/playbook/html-css/structure-and-files/component-stylesheet) in HTML and CSS

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/html-css/checks-in-code/unknown-and-duplicate-css">Agent Wranglers HTML and CSS playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Lint styles with one shared config](https://agentwranglers.se/playbook/html-css/checks-in-code/style-linter)
- Next: [Remove selectors that match nothing](https://agentwranglers.se/playbook/html-css/checks-in-code/unused-selectors)
- [Checks in code](https://agentwranglers.se/playbook/html-css/checks-in-code)
