Tailwind CSS

c15t works with Tailwind CSS out of the box. Use the slots theme option to apply Tailwind utility classes to any component part.

Setup

Import the standard c15t stylesheet once in your app-level CSS entrypoint:

Keeping the c15t stylesheet in your global CSS entrypoint makes layer and cascade order explicit. JS/TSX side-effect imports can load in a different order across framework and Tailwind tooling, which makes style regressions harder to debug.

With Tailwind v4, keep c15t at the end of the top-level @import block so Fumadocs, tw-animate-css, and other preset imports do not override c15t theme tokens.

Tailwind v4

Tailwind v4 automatically scans your source files. Import Tailwind normally, then keep the c15t stylesheet last in the top-level @import block so Fumadocs, tw-animate-css, or other preset styles load first. c15t component styles join Tailwind's components layer automatically, so no extra c15t-specific layer declaration is needed:

Tailwind v3

Import the Tailwind 3-compatible c15t stylesheet after @tailwind components; and before @tailwind utilities;:

Troubleshooting: Fumadocs Overrides c15t Styles

If c15t components render partially unstyled or lose their theme tokens inside a Fumadocs site, check the order of the imports in app/globals.css.

Cause: Fumadocs preset imports can load after c15t and override the tokens and layer output that c15t components depend on.

Fix: Keep @c15t/nextjs/styles.css at the end of the top-level @import block:

If you use other preset or docs-site stylesheets, apply the same rule: load them first, then import c15t last in the top-level import block.

Using Tailwind with Slots

Apply Tailwind classes via the theme's slots object:

Dark Mode with Tailwind

Combine Tailwind's dark mode with c15t's dark tokens:

Optional: noStyle Mode

If you want Tailwind to own all layout and visual styling, use noStyle: true.

Info

When using noStyle: true with Tailwind, you're responsible for all layout and visual styling. Start with slots first, then switch to noStyle only when you need full control.

For full custom markup (not just styles), see Headless Mode.