CSS
Learn about the different ways to add CSS to your Bini.js application.
Bini.js provides several ways to style your application. You can use Tailwind CSS v4 (default), CSS Modules, or plain CSS — choose what works best for your project.
Styling Options
| Option | Description | Best For |
|---|---|---|
| Tailwind CSS v4 | Utility-first CSS framework with Vite plugin (default) | Rapid development, consistent design |
| CSS Modules | Locally scoped CSS by default | Component-specific styles, avoiding conflicts |
| Global CSS | Traditional stylesheet applied globally | Base styles, resets, utilities |
| None | No styling — bring your own | Custom setups, CSS-in-JS libraries |
Tailwind CSS v4
Tailwind CSS v4 is pre-configured using the official Vite plugin. No PostCSS configuration needed — it just works.
@tailwindcss/vite plugin. Everything is configured automatically — no postcss.config.js or tailwind.config.js required.The global CSS file simply imports Tailwind:
The Vite config includes the Tailwind plugin automatically:
CSS Modules
CSS Modules scope styles locally to avoid naming conflicts. Files must end with .module.css:
Global CSS
Import CSS files directly to apply styles globally:
None Option
Choose --none during project creation for a clean slate:
--none, Vite still handles .css imports natively. You can add any CSS file and it will work.External Stylesheets
Import styles from npm packages or external URLs:
CSS Ordering
CSS is applied in the order you import it:
Sass/SCSS Support
Vite has built-in support for Sass:
CSS-in-JS
Use CSS-in-JS libraries with the --none option:
CSS Variables for Theming
Define CSS variables for consistent theming: