---
title: "invalid-style-input"
description: "Reports a style() argument that the compiler cannot compile, such as a number."
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-style-input

This rule reports an argument of `style()` that the compiler cannot compile, such
as a number or a `style()` call written inside another `style()` call. The
argument adds nothing to the element. A number alone supplies neither a CSS
property nor a unit. The example intends to set a width in pixels.

## Reported

```tsx
style(42);
```

> invalid-style-input: style() accepts literal utility strings, arrays, `condition && "…"` branches, and variant wrappers
> 
> Example:1:7

## Fixed

```tsx
style("w-[42px]");
```

## How to fix

- For a value that you know when you write the code, use a utility, as in the
  example, or a theme value.
- For a value that changes at runtime, set a custom property and read it in a
  utility, such as `w-(--width)`.
- Store a `style()` result in a variable before you pass it to another call.

[style()](/docs/macros/style#inputs) lists the accepted inputs.

## 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-style-input/index.mdx
