For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Tailwind CSS v4

Frakment requires Tailwind v4. Setup notes, migration, and common errors.

Frakment requires Tailwind v4. The theme block uses @theme inline, @utility, and @custom-variant — none of these exist in Tailwind v3. This page covers how to verify, migrate, and troubleshoot.

Prerequisites

  • Tailwind CSS 4.0 or newer
  • PostCSS 8 (if you use the PostCSS pipeline)
  • A CSS entry file that contains @import "tailwindcss";

Verify the version

npm ls tailwindcss

Output must show tailwindcss@^4. If it shows ^3, follow the migration below.

What Frakment uses from v4

FeatureUsed inv3 equivalent
@theme inlineToken mappingNone
@utilityno-scrollbar, scroll-fade, container, stepplugin()
@custom-variantdark, data-* variantsaddVariant()
@applyComponent classesSame

None of the first three work in v3. There is no shim — the theme block is v4-only.

Migrating from v3

Install v4 packages

$ npm install tailwindcss@latest @tailwindcss/postcss
npm uninstall tailwindcss@3 postcss autoprefixer

Update PostCSS config

postcss.config.mjs
export default {
  plugins: {
    "@tailwindcss/postcss": {},
  },
};

Remove tailwindcss and autoprefixer from the plugin list.

Delete tailwind.config.js

Tailwind v4 does not need a config file for Frakment. Everything lives in CSS.

Replace @tailwind directives

In your CSS entry file:

css
/* v3 */
@tailwind base;
@tailwind components;
@tailwind utilities;
 
/* v4 */
@import "tailwindcss";

Reinstall Frakment components

$ npx frakment@latest add <component> --overwrite

v4 registry files use @theme, @utility, and @custom-variant.

Theme block placement

The Frakment theme block must come after @import "tailwindcss"; and after any other imports. If it comes first, token resolution fails:

css
@import "tailwindcss";
 
/* ==== FRAKMENT THEME START ==== */
/* ... tokens, @theme, @utility ... */
/* ==== FRAKMENT THEME END ==== */

npx frakment init handles this automatically.

Common errors

Tailwind v3 is installed. Upgrade: npm install tailwindcss@latest.

Your CSS entry file is missing the import. Add @import "tailwindcss"; at the top, before the Frakment theme block.

The theme block is placed before @import "tailwindcss";. Move it after all imports. Tailwind cannot resolve tokens declared before the import.

Check postcss.config.mjs. Only @tailwindcss/postcss should be registered. Old tailwindcss and autoprefixer plugins must be removed.

Next