From 6b592c118e7091fb14bd3448c0d4b452a2e5f912 Mon Sep 17 00:00:00 2001 From: Marco Schindler <58122429+marcoschndlr@users.noreply.github.com> Date: Sun, 20 Jul 2025 20:41:59 +0200 Subject: [PATCH] docs: document supported data types for arbitrary and bare values Add documentation for the supported data types of arbitrary and bare values in custom functional utilities. Previously, it was not clear which data types are supported when declaring a custom functional utility. Especially when declaring a utility with arbitrary values as this silently fails. Closes #2176 --- src/docs/adding-custom-styles.mdx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/docs/adding-custom-styles.mdx b/src/docs/adding-custom-styles.mdx index 13d79d749..a6521fb64 100644 --- a/src/docs/adding-custom-styles.mdx +++ b/src/docs/adding-custom-styles.mdx @@ -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): @@ -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