Skip to content

Tailwindcss (v4) dark mode no working as expected #408

@pangeaos

Description

@pangeaos

The only way I found to get tailwindcss dark mode working is forcing the class Names.

layout.tsx
<Toaster position="top-center" toastOptions={{ className: '!bg-gray-900 dark:!bg-white !text-white dark:!text-secondary', }} />

global.css
@import "tailwindcss"; @import "tw-animate-css"; @custom-variant dark (&:where(.dark, .dark *));

According to the attached image it seems that this class is overwriting the taildwind classes.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions