Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

Tailwind CSS v4: Pick the Right Plugin and Verify Your Styles

Use @tailwindcss/vite for Vite projects or @tailwindcss/postcss for a PostCSS pipeline. Then update the CSS entry and inspect configuration, browser support, and changed styles.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a Vite project, migrate to Tailwind CSS v4 with the dedicated @tailwindcss/vite plugin. For a project already built around PostCSS, use @tailwindcss/postcss instead. Either way, replace the old Tailwind directives in your CSS entry file with @import "tailwindcss";, then review the migration changes and test the rendered site—not just whether the build succeeds.

Choose the integration that matches your build pipeline

Tailwind’s upgrade guide recommends its dedicated Vite plugin for Vite projects, describing it as the more seamless integration for several Vite-based frameworks. It specifically recommends moving from the PostCSS plugin to the Vite plugin when using Vite. If your framework has its own Tailwind instructions, follow those as well.

As an Amazon Associate I earn from qualifying purchases.

Project pipeline Tailwind integration CSS entry
Vite @tailwindcss/vite @import "tailwindcss";
PostCSS-driven integration that is not using Vite’s recommended plugin path @tailwindcss/postcss, with postcss @import "tailwindcss";

In v4, the PostCSS integration lives in its own package. A v3 configuration that used tailwindcss itself as the PostCSS plugin must be updated.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the migration

  1. Check browser requirements. Tailwind’s upgrade guide says v4 is designed for Safari 16.4 or later, Chrome 111 or later, and Firefox 128 or later. These are the minimum browser targets stated by Tailwind’s current guidance, not general browser-market statistics. If your project must support older browsers, the guide recommends staying on v3.4.
  2. Create a branch. Keep the migration isolated so you can review changes and revert if necessary.
  3. Run the upgrade tool for a typical v3-to-v4 migration. Use npx @tailwindcss/upgrade. Tailwind states that this tool requires Node.js 20 or higher; that requirement applies to the upgrade tool, not necessarily to every Tailwind v4 project.
  4. Inspect the diff. The tool can update dependencies, move configuration into CSS, and change templates, but project-specific changes may still need manual work.

Configure the Vite integration

Install tailwindcss and @tailwindcss/vite, register the Tailwind plugin in your Vite configuration, and import Tailwind in the CSS entry file. The example below shows the relevant shape of a TypeScript Vite configuration; retain any other plugins and settings your project needs.

import { defineConfig } from "vite"
import tailwindcss from "@tailwindcss/vite"

export default defineConfig({
  plugins: [
    tailwindcss(),
  ],
})

In the CSS file your app loads, replace the old Tailwind directives with:

@import "tailwindcss";

If your project uses a framework-specific Vite setup, check its Tailwind instructions before applying a generic configuration.

Configure the PostCSS integration

For a PostCSS pipeline, install tailwindcss, @tailwindcss/postcss, and postcss. Configure the dedicated Tailwind PostCSS plugin in your project’s PostCSS configuration. For example, a JavaScript PostCSS config can use:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
export default {
  plugins: {
    "@tailwindcss/postcss": {},
  },
}

Then put @import "tailwindcss"; in the CSS entry file processed by that pipeline. The exact configuration-file format depends on the project; preserve other PostCSS plugins that the application still needs.

Replace v3 CSS directives and review configuration

The v3 entry pattern used separate directives. In v4, replace them with a regular CSS import:

/* v3 */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* v4 */
@import "tailwindcss";

JavaScript configuration files remain supported for backward compatibility, but Tailwind no longer detects them automatically. If you still rely on one, load it explicitly with @config. Also check for legacy options: corePlugins, safelist, and separator are not supported in v4.

Tailwind v4 handles imports and vendor prefixing automatically, so the upgrade guide says postcss-import and autoprefixer can be removed from the described setup. Before removing them, check whether other parts of your build use those shared plugins.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Inspect styles affected by changed defaults

A successful build does not establish that the migrated site looks or behaves the same. Review styles that depend on v3 defaults and ordering, including these documented changes:

  • Border color: The default changed from the configured gray-200 behavior in v3 to currentColor in v4. Add explicit border colors where the old appearance is required, or use Tailwind’s documented compatibility CSS if intentionally preserving that default.
  • Stacked variants: Their order changed from right-to-left to left-to-right. Check combinations whose result depends on variant order.
  • Utility names and defaults: Some shadow, radius, blur, and outline utilities changed. Use the full upgrade guide to identify affected utilities; these examples are not an exhaustive list.
  • CSS preprocessors: Tailwind v4 is not designed for Sass, Less, or Stylus preprocessing. Projects relying on those preprocessors need to account for that compatibility constraint.

Verify the migration in the browser

Review the official breaking-change list, then exercise representative pages and states in a browser. Include pages that use custom configuration, stacked variants, borders, shadows, radii, blur, and outlines. Check responsive and interactive states as well as the initial page view. Resolve visual or functional differences before treating the migration as complete.

Tailwind’s guidance calls for reviewing the upgrade changes and testing in a browser. The upgrade tool automates parts of the work; it does not guarantee a correct visual result.

Official migration references

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.