Skip to content

@tailwind base and @tailwind components no longer work in Tailwind v4 #2076

@Amin-baxXx

Description

@Amin-baxXx

I've noticed that in Tailwind CSS v4, the use of @tailwind base and @tailwind components has been deprecated, and the error suggests using @import "tailwindcss/preflight" and @tailwind utilities instead.

While I understand the intention behind these changes, I believe this might confuse users migrating from older versions, especially those who follow outdated tutorials or documentation.

Would it be possible to:

-1 Provide more backward compatibility for these directives?
2- Include a clearer migration guide for this specific change in the official documentation?

@import "tailwindcss";
@tailwind base;
@tailwind components;
@tailwind utilities;
Build the CSS using CLI with the command tailwindcss build.
Observe the errors in the build output.
Environment:
Tailwind CSS version: 4.x
Build tool: CLI
IDE: WebStorm 2024
Node.js version: v22.13.0
Operating System: Windows 11 (version 24H2)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions