Skip to content

Document supported data types for arbitrary and bare values in custom functional utilities #2310

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion src/docs/adding-custom-styles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ To resolve the value as a bare value, use the `--value({type})` syntax, where `{

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

To prevent creating new syntax that we typically don't support, only `number`, `integer`, `ratio`, and `percentage` are allowed as bare value data types.

#### Literal values

To support literal values, use the `--value('literal')` syntax (notice the quotes):
Expand All @@ -486,7 +488,11 @@ To support arbitrary values, use the `--value([{type}])` syntax (notice the squa
}
```

This will match utilities like `tab-[1]` and `tab-[76]`. If you want to support any data type, you can use `--value([*])`.
This will match utilities like `tab-[1]` and `tab-[76]`.

The currently supported data types for arbitrary values are `color`, `length`, `percentage`, `ratio`, `number`, `integer`, `url`, `position`, `bg-size`, `line-width`, `image`, `family-name`, `generic-name`, `absolute-size`, `relative-size`, `angle`, and `vector`.

If you want to support any data type, you can use `--value([*])`.

#### Supporting theme, bare, and arbitrary values together

Expand Down