# useTailwindVariablesShorthand

Rule `biome/useTailwindVariablesShorthand`. Enforce the shorthand syntax for CSS variables in Tailwind CSS classes.

- Source: biome
- Technologies: Tailwind CSS, React
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #613 by reach, #248 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/useTailwindVariablesShorthand` | yes | safe | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/use-tailwind-variables-shorthand/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<div className="bg-[var(--brand)]" />;
```

```jsx
<div className="hover:bg-red-500/[var(--opacity)]" />;
```

### Correct: the rule accepts this

```jsx
<div className="bg-(--brand) hover:bg-red-500/(--opacity)" />;
<div className="w-[calc(var(--width)+1rem)] [color:var(--brand)]" />;
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useTailwindVariablesShorthand": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/useSvelteShorthandDirective](https://lintradar.dev/rules/biome/useSvelteShorthandDirective.md): Enforce the shorthand syntax for Svelte `bind:`, `class:`, and `style:` directives.
- [biome/useTanstackQueryExhaustiveDependencies](https://lintradar.dev/rules/biome/useTanstackQueryExhaustiveDependencies.md): Require query keys to include every value that the query function uses.
- [biome/useSvelteRequireEachKey](https://lintradar.dev/rules/biome/useSvelteRequireEachKey.md): Require keyed `{#each}` blocks in Svelte templates.
- [biome/useTanstackQueryInfiniteQueryPropertyOrder](https://lintradar.dev/rules/biome/useTanstackQueryInfiniteQueryPropertyOrder.md): Enforce a consistent property order in the options of TanStack Query infinite query functions.
- [biome/useSvelteReactiveClasses](https://lintradar.dev/rules/biome/useSvelteReactiveClasses.md): Require the reactive classes from `svelte/reactivity` instead of built-in objects that are modified.
- [biome/useTanstackQueryMutationPropertyOrder](https://lintradar.dev/rules/biome/useTanstackQueryMutationPropertyOrder.md): Enforce that `onMutate` comes before `onError` and `onSettled` in the options of TanStack Query mutations.

---

Web page: https://lintradar.dev/rules/biome/useTailwindVariablesShorthand. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
