Learn how to use Tailwind CSS v4 in your Bini.js application with zero configuration.
Tailwind CSS v4 is the default styling option in Bini.js. It is already set up with the official Vite plugin, so there is no PostCSS configuration to manage.
@tailwindcss/vite plugin. There is no postcss.config.js and no tailwind.config.js to write.When you create a new Bini.js project with Tailwind, everything is configured for you. Use the --tailwind flag:
Or run the interactive prompt and choose Tailwind CSS for styling:
Tailwind is the default, so you can also just run:
With TypeScript + Tailwind:
All of the following is set up for you:
Everything Tailwind related lives in one file, globals.css. It is imported once in the root layout, so the theme, base styles, and custom utilities apply to every route:
@import 'tailwindcss' at the top of the file. The sections below show each part of this file in more detail.Use Tailwind's utility classes directly in your components:
| Feature | Description |
|---|---|
| Vite Plugin | Native Vite integration - no PostCSS config needed |
| CSS-first config | Configure via CSS variables instead of JS |
| Faster builds | Uses Lightning CSS for faster builds |
| Simpler setup | Just @import "tailwindcss" - that is it |
Tailwind v4 uses CSS variables for theming. Every token you declare in @theme becomes a utility:
Add a breakpoint prefix such as sm: or lg: to make a class apply from that screen width and up:
| Breakpoint | Min Width |
|---|---|
| sm | 640px |
| md | 768px |
| lg | 1024px |
| xl | 1280px |
| 2xl | 1536px |
Use the dark: variant to apply a class only in dark mode:
Create your own utility classes with @utility:
Plain CSS in Bini.js.
Scoped class names with .module.css.
Where to import globals.css in the app directory.
Where everything lives in a Bini.js app.
Learn how to use Tailwind CSS v4 in your Bini.js application with zero configuration.
Tailwind CSS v4 is the default styling option in Bini.js. It is already set up with the official Vite plugin, so there is no PostCSS configuration to manage.
@tailwindcss/vite plugin. There is no postcss.config.js and no tailwind.config.js to write.When you create a new Bini.js project with Tailwind, everything is configured for you. Use the --tailwind flag:
Or run the interactive prompt and choose Tailwind CSS for styling:
Tailwind is the default, so you can also just run:
With TypeScript + Tailwind:
All of the following is set up for you:
Everything Tailwind related lives in one file, globals.css. It is imported once in the root layout, so the theme, base styles, and custom utilities apply to every route:
@import 'tailwindcss' at the top of the file. The sections below show each part of this file in more detail.Use Tailwind's utility classes directly in your components:
| Feature | Description |
|---|---|
| Vite Plugin | Native Vite integration - no PostCSS config needed |
| CSS-first config | Configure via CSS variables instead of JS |
| Faster builds | Uses Lightning CSS for faster builds |
| Simpler setup | Just @import "tailwindcss" - that is it |
Tailwind v4 uses CSS variables for theming. Every token you declare in @theme becomes a utility:
Add a breakpoint prefix such as sm: or lg: to make a class apply from that screen width and up:
| Breakpoint | Min Width |
|---|---|
| sm | 640px |
| md | 768px |
| lg | 1024px |
| xl | 1280px |
| 2xl | 1536px |
Use the dark: variant to apply a class only in dark mode:
Create your own utility classes with @utility:
Plain CSS in Bini.js.
Scoped class names with .module.css.
Where to import globals.css in the app directory.
Where everything lives in a Bini.js app.