Learn how to use the triple-dash fallback syntax for one-off values outside your theme
While Tokenami encourages using theme tokens for consistency, sometimes you need one-off values that aren’t in your design system. The triple-dash fallback syntax allows you to use arbitrary values while maintaining type safety.
The triple-dash (---) is a special CSS custom property fallback that Tokenami recognizes. It tells TypeScript “this is intentionally outside the theme” while still producing valid CSS:
/* Generated CSS */.element { --padding: var(---, 20px); /* Falls back to 20px */ padding: var(--padding);}
Tokenami intentionally adds friction to using arbitrary values. This encourages you to stick to your theme guidelines and helps you quickly identify values that don’t conform to your design system.
Arbitrary values should be the exception, not the rule. They bypass your design system’s constraints.
Document reasoning
Add comments explaining why an arbitrary value is needed. This helps future maintainers.
Consider refactoring
If you use the same arbitrary value multiple times, add it to your theme instead.
Prefer theme tokens
Always check if a theme token can solve your problem before using arbitrary values.
The friction of the triple-dash syntax is intentional. It makes arbitrary values visible in your codebase, making it easy to audit and clean up one-off values later.