Skip to content

Document literal values in --value('…') #2171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/docs/adding-custom-styles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,19 @@ To resolve the value as a bare value, use the `--value({type})` syntax, where `{

This will match utilities like `tab-1` and `tab-76`.

#### Literal values

To support literal values, use the `--value('literal')` syntax (notice the quotes):

```css
/* [!code filename:CSS] */
@utility tab-* {
tab-size: --value('inherit', 'initial', 'unset');
}
```

This will match utilities like `tab-inherit`, `tab-initial`, and `tab-unset`.

#### Arbitrary values

To support arbitrary values, use the `--value([{type}])` syntax (notice the square brackets) to tell Tailwind which types are supported as an arbitrary value:
Expand Down