Install typescriptcss with Vite
typescriptcss is a zero-runtime CSS-in-JS library. You write styles as inline chains directly on your elements, and the build plugin collects them into a stylesheet with hashed class names.
Add the Vite adapter to an existing or new Vite project. It transforms style chains during development and emits the collected CSS in production.
Install typescriptcss
Install the runtime package and the Vite adapter.
Add the plugin to your config
Register the adapter before the rest of your application plugins so it can transform source files during the build.
Write your styles inline
Import the utilities you need and build a chain, then call it to produce the style object. No class names or separate CSS file are required.
Compose states and breakpoints
Insert dark, sm, md, or lg anywhere in the chain to scope the styles after it. Everything stays in the same expression.
Run the build
Run the Vite build. The adapter collects every chain, removes duplicates, and emits the resulting styles.