The smallest, fastest, most feature complete Tailwind-in-JS solution in existence.
Twind is a small compiler that converts utility classes into CSS at runtime, aiming to combine the flexibility of CSS-in-JS with the constraints of the Tailwind API. It offers utility-first CSS without the need for a build step, allowing for seamless integration with various environments like the browser, Node.js, deno, and workers. With its latest stable release, Twind provides features like no build step, framework agnosticism, a low fixed cost, no bundler requirement, seamless integration with Tailwind, extended variants and syntax, and more.
To install Twind, ensure you have Node.js installed and run the following command:
npm install twind
For usage, import Twind in your JavaScript file:
import { tw } from 'twind'
Then, apply utility classes directly in your HTML or JavaScript like:
const className = tw`text-blue-500 bg-gray-200`
Twind is a versatile CSS utility-first compiler that eliminates the need for a build step and provides seamless integration with environments like the browser and Node.js. With its feature-rich functionalities, flexibility, and ease of use, Twind offers developers a practical solution for generating CSS at runtime while maintaining the constraints of the Tailwind API.