Skip to content

Commit 92d22a2

Browse files
committed
Document arbitrary variable shorthand (#1437)
Co-authored-by: Adam Wathan <[email protected]>
1 parent 0245d97 commit 92d22a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pages/docs/adding-custom-styles.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ It's even possible to use the [`theme` function](/docs/functions-and-directives#
9191
</div>
9292
```
9393

94+
When using a CSS variable as an arbitrary value, wrapping your variable in `var(...)` isn't needed — just providing the actual variable name is enough:
95+
96+
```html
97+
<div class="bg-[--my-color]">
98+
<!-- ... -->
99+
</div>
100+
```
101+
94102
### Arbitrary properties
95103

96104
If you ever need to use a CSS property that Tailwind doesn't include a utility for out of the box, you can also use square bracket notation to write completely arbitrary CSS:

0 commit comments

Comments
 (0)