Skip to content

PostCSS + TailwindCSS 4 throws error on important! and ! modifiers #18570

@LZL0

Description

@LZL0

What version of Tailwind CSS are you using?
Tailwind: 4.1.11
PostCSS: 8.5.6
NextJS: 15.4.1
Node: 22.x

Describe your issue

./apps/next/src/styles/tailwind.scss

Error evaluating Node.js code
Error: expected ";".
    ╷
111 │   @apply text-black dark:text-white !important;
./apps/next/src/styles/tailwind.scss

Error evaluating Node.js code
Error: expected ";".
    ╷
111 │   @apply text-black! dark:text-white!;
module.exports = {
  plugins: {
    "@tailwindcss/postcss": {},
  },
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions