---
title: "invalid-variant"
description: "Reports a known variant with a value that it does not accept, such as min-[foo]."
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.

# invalid-variant

This rule reports a variant whose name is known but whose value is not valid. For
example, `min-[foo]:` needs a length, and `foo` is not one. The condition never
matches, so the utilities under it never apply.

## Reported

```tsx
style("min-[foo]:p-4");
```

> invalid-variant: `min-` does not accept `foo`
> 
> Example:1:12

## Fixed

```tsx
style("min-[40rem]:p-4");
```

## How to fix

- Give the variant a value of the type that it accepts, such as a length for
  `min-[...]`.
- Prefer a named breakpoint, such as `md:`, when one matches the width.

A variant name that does not exist is reported by
[unknown-variant](/docs/lints/unknown-variant) instead.

## Rule settings

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

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

Source: https://stillwind.dev/docs/lints/invalid-variant/index.mdx
