Install typescriptcss with tsdown
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.
tsdown accepts Rollup-compatible plugins, so typescriptcss integrates through the Rollup adapter.
Install typescriptcss
Install the runtime package and the Rollup adapter used by tsdown.
Add the plugin to your config
Add the adapter to the plugins array in your tsdown configuration.
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 tsdown. The extracted styles are emitted as a CSS build asset next to your JavaScript output.