Introduction to Tokenami
Tokenami is a modern CSS-in-JS toolkit that reinvents how you build design systems. It replaces atomic CSS classes with atomic CSS variables, giving you the type safety and developer experience of CSS-in-JS with the performance and simplicity of static CSS.Tokenami is still in early development. You might find bugs or missing features. Before reporting issues, please check the existing issues first.
What is Tokenami?
Tokenami isn’t another design system—it’s a toolkit for building your own. By providing atomic CSS variables and a unified set of tools, Tokenami makes it simple to create portable, type-safe design systems with tokens at the heart of your CSS. Instead of writing utility classes likep-4 bg-blue-500 hover:bg-blue-600, you write:
style attribute using CSS variables, keeping specificity low and making your components easy to override.
Why Use Tokenami?
The React team no longer recommends CSS-in-JS solutions that inject styles at runtime. Instead, they suggest using static stylesheets with inline styles for dynamic values. Tokenami bridges the gap between traditional CSS-in-JS and utility-first frameworks, giving you:Type Safety
Full TypeScript integration with autocomplete for your design tokens
No Runtime
Static CSS generation with no JavaScript runtime overhead
No Bundler
Simple CLI tool—no complex bundler integration required
Portable
Build design systems that work anywhere, with or without Tokenami
Key Benefits
Simple Naming Convention
Turn any CSS property into a variable by adding--. No need to memorize utility class names.
Smaller Stylesheets
One variable-driven rule instead of dozens of utility classes. The@tokenami/css package is only ~2.5kb gzipped.
Clean Markup
Usecss.compose() to extract styles into classes, keeping your markup DRY:
Single Source of Truth
Yourtokenami.config.ts file defines and enforces your design tokens:
Dynamic by Default
Pass props directly into tokens without workarounds:Expressive Selectors
Add responsive breakpoints and pseudo-states with underscores:No Specificity Wars
Thecss() utility handles composition safely—the last style always wins:
Framework Support
Tokenami works with any framework that supports thestyle attribute:
How It Works
Tokenami uses CSS variables to express everything, including media queries and pseudo-selectors. This approach:- Keeps specificity low so styles are easy to override
- Enables responsive styling without runtime CSS injection
- Works with inline styles since variables can be set on the
styleattribute - Makes design systems portable since consumers can override variables
Don’t worry about typing all those dashes—just type
bord, and Tokenami’s IntelliSense will complete --border-color for you.What’s Next?
Ready to get started? Follow our installation guide to set up Tokenami in your project.Installation
Install Tokenami and configure your project