---
title: "missing-document-target"
description: "Reports a style.css() utility without a selector to apply to."
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.

# missing-document-target

This rule reports a utility in `style.css()` that has no element to style.
`style.css()` returns a stylesheet, not props for an element, so a utility needs
a `selector` option or a variant that sets its own selector. Otherwise the utility
produces no CSS.

## Reported

```tsx
style.css("p-4");
```

> missing-document-target: no variant selects the element to style; start with a variant such as `host:` or `[:root]:`
> 
> Example:1:12

## Fixed

```tsx
style.css("p-4", { selector: ":host" });
```

## How to fix

- Add a `selector` option, such as `:host` for the shadow host.
- Or use a variant that sets its own selector, such as `host:p-4`.

See [style.css()](/docs/macros/css#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/missing-document-target/index.mdx
