# Introduction ts-css is a blazingly fast utility-first CSS framework built with Bun for exceptional performance. It generates only the CSS you need, with a familiar Tailwind-compatible syntax and powerful optimization features. ## What is ts-css ts-css is a modern CSS framework that provides utility classes for building user interfaces. Unlike traditional CSS frameworks that ship pre-built components, ts-css gives you low-level utility classes that let you build completely custom designs without ever leaving your HTML. ### Key Features -**โšก๏ธ Blazingly Fast**- Built with Bun for exceptional performance. Generate 1000+ utilities in under 10ms -**๐ŸŽฏ On-Demand Generation**- Only generates CSS for utilities you actually use. Zero bloat, maximum efficiency -**๐ŸŽจ Tailwind-Compatible**- Familiar utility classes and syntax. Easy migration path from Tailwind CSS -**๐Ÿ’ช Fully Typed**- Complete TypeScript support with type-safe configuration and API -**๐Ÿ”ง Highly Configurable**- Customize theme, colors, spacing, variants, shortcuts, and more -**๐Ÿ”ฅ Hot Reload**- Watch mode for instant rebuilds during development -**๐ŸŽญ Variant Support**- Responsive, state (hover, focus), dark mode, group/peer, and custom variants -**โœจ Modern CSS**- Grid, Flexbox, animations, transforms, filters, backdrop filters, and more -**๐Ÿ”จ Class Compilation**- Compile groups of utilities into single optimized class names for smaller HTML -**๐Ÿงช Thoroughly Tested**- 999+ tests including comprehensive performance benchmarks ## Why ts-css ### Performance-First ts-css is built with Bun, making it one of the fastest CSS frameworks available: ```bash # Generate 1000+ utilities in under 10ms cssx build # โœ… Built 1243 classes in 8.45ms ```### On-Demand CSS Generation Unlike traditional frameworks that ship large CSS files, ts-css scans your source files and generates only the CSS you use:```html

Hello ts-css!

```This approach results in: -**Smaller CSS files**- Only ship what you use -**Faster load times**- Less CSS to download and parse -**Better performance**- Reduced render-blocking CSS ### Tailwind-Compatible Syntax If you know Tailwind, you already know ts-css:```html

Content
```### Theme Customization Customize your design system via configuration:```typescript const config = { theme: { colors: { primary: '#3b82f6', secondary: '#8b5cf6', brand: { 50: '#f0f9ff', 100: '#e0f2fe', 500: '#0ea5e9', 900: '#0c4a6e', }, }, spacing: { xs: '0.5rem', sm: '1rem', md: '1.5rem', lg: '2rem', xl: '3rem', }, fontFamily: { sans: ['Inter', 'system-ui', 'sans-serif'], mono: ['Fira Code', 'monospace'], }, }, } satisfies TsCssOptions ```### Shortcuts Create reusable utility combinations:```typescript const config = { shortcuts: { 'btn': 'px-4 py-2 rounded font-semibold transition-colors', 'btn-primary': 'btn bg-blue-500 text-white hover:bg-blue-600', 'card': 'rounded-lg shadow-md p-6 bg-white', }, } satisfies TsCssOptions ```Use shortcuts like any other utility:```html
Card content
``` ## Philosophy ts-css is built on several core principles: 1.**Performance First**- Built with Bun for maximum speed 2.**Developer Experience**- TypeScript-first, fully typed APIs 3.**Utility-First**- Compose complex components from simple utilities 4.**On-Demand Only**- Never ship unused CSS 5.**Tailwind & UnoCSS-Compatible**- Leverage existing knowledge and tools 6.**Extensible**- Customize everything via configuration 7.**Production-Ready**- Optimizations like class compilation and minification ## Next Steps Now that you understand what ts-css is and how it works, explore: - [Installation Guide](./install.md) - Set up ts-css in your project - [Configuration Guide](./config.md) - Customize ts-css to your needs - [Usage Guide](./usage.md) - Learn all available utility classes - [CLI Reference](./features/cli.md) - Explore CLI commands and options - [Compile Class Transformer](./features/compile-class.md) - Optimize your HTML ## Community & Support -**GitHub**- [github.com/stacksjs/ts-css](https://github.com/stacksjs/ts-css) -**Discord**- [Join the Stacks Discord](https://stacksjs.com/discord) -**Issues**- [Report bugs or request features](https://github.com/stacksjs/ts-css/issues) -**Discussions**- [Ask questions and share ideas](https://github.com/stacksjs/ts-css/discussions) ## License ts-css is open-source software licensed under the [MIT license](https://github.com/stacksjs/ts-css/blob/main/LICENSE.md).