Hi @zaraket 👋 Thanks again for your honest feedback and for being willing to share more details. We're working on a fix for this, but in the meantime, here's a workaround you can add to your tokens.md file.
## Unitless token values
All token values are unitless (e.g., `12`, not `12px`). You must add units yourself when a token needs them — otherwise the browser silently drops the declaration as invalid.
**CSS**
```css
/* tokens.css ships these as unitless numbers */
:root {
--spacing-3: 12; /* means 12px */
--gap-sections: var(--spacing-10); /* alias -> 40, still unitless */
}
/* Avoid: `gap: 12` is invalid; the browser drops it */
.row {
gap: var(--spacing-3);
}
/* Preferred: multiply by 1px so it resolves to a length */
.row {
gap: calc(var(--spacing-3) * 1px);
}
```
**TypeScript**
```tsx
// Avoid: Tailwind arbitrary value resolves to `gap: 12` (invalid)
<div className="gap-[var(--spacing-3)]" />
// Preferred: wrap in calc(); no spaces needed around `*` inside the brackets
<div className="gap-[calc(var(--spacing-3)*1px)]" />
```
## Escaping token names by string context
Token names use `\/` as a namespace separator. The number of backslashes you write depends on whether a JavaScript parser processes the string.
**1. Raw CSS (`.css`) — one backslash**
```css
color: var(--foreground\/primary);
padding: calc(var(--spacing\/4) * 1px);
```
**2. Tailwind classes in a plain JSX string attribute — one backslash**
JSX attribute strings are not JS strings, so the backslash is treated as literal.
```tsx
<div className="text-[var(--foreground\/primary)] p-[calc(var(--spacing\/4)*1px)]" />
```
**3. Any JavaScript string — double the backslash**
JS collapses `\\` to `\`. This covers inline style values, `clsx`/`cn`, variables, and template-literal classNames.
```tsx
<div style={{ color: "var(--foreground\\/primary)" }} />
<div className={cn("text-[var(--foreground\\/primary)]", cond && "...")} />
<div className={`p-[calc(var(--spacing\\/4)*1px)] ${x}`} /> // template literal!
```
> ⚠️ A single backslash inside a template literal or JS string is silently stripped at runtime, so the utility won't apply — grids, spacing, and borders collapse with no error thrown. We recommend plain string classNames so you don't have to double up.
I'm happy to pass along any additional feedback to the team. Thanks again! — Jaycee