Skip to content

@apply dark: in pseudo class selectors does not work #19302

@lemonCMS

Description

@lemonCMS

What version of Tailwind CSS are you using?

v4.1.17

What build tool (or framework if it abstracts the build tool) are you using?

For example: postcss-cli 11.0.0, Next.js 15.1.7, Vite 6.1.0

What version of Node.js are you using?

v24.2

** What browswer**
Chrome

For example: Chrome, Safari, or N/A

What operating system are you using?

Windows

Reproduction URL
https://play.tailwindcss.com/PtV9UI3TBW

Describe your issue

Darkmode in pseudo classes do not work, se the reproduction url.

.card:after {
  @apply absolute left-10 h-10 w-10 content-[""];
  @apply bg-white dark:bg-red-400;
}

When the site is in dark mode, then the dark:bg-red-400 is not being applied.

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