Skip to content

Commit 5339333

Browse files
authored
Document literal values in --value('…') (#2171)
This PR adds documentation for the new `--value('…')` and `--modifier('…')` where you can use literal values in strings. To support literal values, use the `--value('literal')` syntax (notice the quotes): ```css @Utility tab-* { tab-size: --value('inherit', 'initial', 'unset'); } ``` This will match utilities like `tab-inherit`, `tab-initial`, and `tab-unset`.
1 parent 9bd8291 commit 5339333

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/docs/adding-custom-styles.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,19 @@ To resolve the value as a bare value, use the `--value({type})` syntax, where `{
462462

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

465+
#### Literal values
466+
467+
To support literal values, use the `--value('literal')` syntax (notice the quotes):
468+
469+
```css
470+
/* [!code filename:CSS] */
471+
@utility tab-* {
472+
tab-size: --value('inherit', 'initial', 'unset');
473+
}
474+
```
475+
476+
This will match utilities like `tab-inherit`, `tab-initial`, and `tab-unset`.
477+
465478
#### Arbitrary values
466479

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

0 commit comments

Comments
 (0)