Write styles directly in your JSX components with zero runtime overhead. Powered by Rust for blazing-fast build times. Integrates with all popular bundlers.
Built for Modern Development
Built from the ground up with performance and developer experience in mind.
Zero-Runtime
✨
All styles are processed at build time.
Universal Bundler Support
📦
Works with all popular bundlers. Rollup, Vite, Webpack, and Parcel.
Theming
🎨
Easily create and manage themes with design tokens.
Scoped Styles
🎯
Styles are scoped to the component, no more class name collisions.
Blazing Fast
⚡
Built with Rust for blazing-fast CSS processing, parsing, and optimization.
Preprocessor Support (Soon)
🛠️
Support for popular preprocessors like Sass and Less (coming soon).
Installation
Install the dev dependencies:
npm install @flairjs/core @flairjs/vite-plugin -D
Install the dependencies:
npm install @flairjs/client
Note: The client package will be part of your bundle only if you use the utility functions c or cn. These functions are used to forecefully include a class name when flair can't directly infer it.
Add the Vite plugin to your vite.config.ts file:
import { defineConfig } from 'vite';import flair from '@flairjs/vite-plugin';export default defineConfig({ plugins: [react(), flair({ // flair options })],});
Usage
Flair gives you three ways to write CSS.
1. You can write your styles in a Style component as shown below