---
title: "duplicate-definition"
description: "Reports a utility or variant definition that replaces an earlier one with the same name."
image: "https://stillwind.dev/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://stillwind.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# duplicate-definition

This rule reports a `@utility` or `@custom-variant` definition that replaces an
earlier definition with the same name. The definitions do not combine, so the
earlier one is lost. In the example, `hocus` matches focus only, not hover.

## Reported

```css
@custom-variant hocus (&:hover);
@custom-variant hocus (&:focus);
```

> duplicate-definition: `@custom-variant hocus` is never used because a later definition with the same name replaces it
> 
> Example:1:17
> 
> Example:2:17: later definition

## Fixed

```css
@custom-variant hocus (&:hover, &:focus);
```

## How to fix

- To combine the definitions, write them as one definition, as in the example.
- If one of the definitions is left over, remove it.

## Rule settings

| Preset | Severity |
| --- | --- |
| `recommended` | warn |
| `strict` | deny |
| `stylistic` | off |

[Configure lint](/docs/configuration#lint) to change the severity or options.

Source: https://stillwind.dev/docs/lints/duplicate-definition/index.mdx
