Installation
Which NibCSS package you need for your stack, how to install it, and what it requires.
NibCSS is split into small packages so you install only what your stack uses. All of them share one
engine (@nibcss/core) and one config file (nibcss.config.ts), so output is identical everywhere.
Which package do I need?#
You want to… | Install |
|---|---|
Add a |
|
Use Vite, SvelteKit, Astro, Solid, Qwik, Remix |
|
Use Next.js |
|
Use Nuxt 3 |
|
Use React hooks ( |
|
Use Vue ( |
|
Use Angular ( |
|
Use Svelte ( |
|
Style Rails / Django / Laravel / PHP templates |
|
Build your own integration |
|
@nibcss/devtools — the error overlay — is installed and wired automatically by @nibcss/unplugin in development.
Parses attributes, resolves tokens and recipes, generates CSS. Runs anywhere.
Scan your source and write a static stylesheet before the page ever loads.
Style dynamic values and elements created in the browser.
Install#
The most common setup — a bundler plus a framework adapter:
npm i -D @nibcss/unplugin
npm i @nibcss/runtime @nibcss/reactReplace @nibcss/react with @nibcss/vue, @nibcss/angular or @nibcss/svelte for your framework.
Build-time packages (unplugin, next, nuxt, cli) are dev dependencies; the runtime and adapters ship to the browser.
From a CDN#
jsDelivr and unpkg mirror every npm release. Pin a major version in development and an exact version in production:
<!-- latest 1.x -->
<script src="https://cdn.jsdelivr.net/npm/@nibcss/runtime@1"></script>
<!-- pinned, with Subresource Integrity (hash from jsDelivr's file page) -->
<script
src="https://cdn.jsdelivr.net/npm/@nibcss/runtime@1.1.1"
integrity="sha384-…"
crossorigin="anonymous"></script>The CDN build is a single self-contained file (~23 kB, engine included) that exposes window.Nib.
Requirements#
Node.js (build tools, CLI) | 18 or newer |
Browsers (runtime) | Evergreen browsers — Chrome, Edge, Firefox, Safari. Uses |
TypeScript | Optional. Types ship with every package. |
Frameworks | React 17+, Vue 3.3+, Angular 16+, Svelte 4 & 5, Next.js, Nuxt 3 |
The config file#
Every tool looks for a config at the project root, in this order:
nibcss.config.ts, .mts, .js, .mjs, .cjs, then the same names with nib.config.
npx @nibcss/cli init — or the build plugin on its first run — writes a starter file in which every option is documented.