Skip to content

Tailwind CSS dark mode variants not working in the newest version #100

@anonymousdplantgit

Description

@anonymousdplantgit

Bug Description

Standard Tailwind CSS dark mode variants are not working with built-in color utilities when using PrimeNG with Tailwind CSS v4.

Expected Behavior

Standard Tailwind dark mode classes should work as expected:

  • bg-blue-50 dark:bg-blue-500 should switch background colors in light/dark mode
  • text-red-600 dark:text-red-100 should switch text colors in light/dark mode

Current Behavior

  • bg-green-50 dark:bg-green-500 - colors do not switch in dark/light mode
  • bg-red-50 dark:bg-red-500 - colors do not switch in dark/light mode
  • text-red-600 dark:text-red-100 - text colors do not switch in dark/light mode

However, PrimeNG surface utilities work correctly:

  • bg-surface-900 dark:bg-surface-0 - ✅ works perfectly

Code example of the code that is not working as before

 <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
    <div class="bg-blue-50 dark:bg-blue-500 p-4 rounded-lg text-center">
        <div class="text-2xl font-bold text-blue-600 dark:text-blue-100">{{ currentFormTypes.length }}</div>
        <div class="text-sm font-medium text-blue-800 dark:text-blue-200">{{ 'typeSoumission.totalForms' | translate }}</div>
    </div>
    <div class="bg-green-50 dark:bg-green-500 p-4 rounded-lg text-center">
        <div class="text-2xl font-bold text-green-600 dark:text-green-100">{{ getActiveFormTypesCount() }}</div>
        <div class="text-sm font-medium text-green-800 dark:text-green-200">{{ 'typeSoumission.activeForms' | translate }}</div>
    </div>
    <div class="bg-red-50 dark:bg-red-500 p-4 rounded-lg text-center">
        <div class="text-2xl font-bold text-red-600 dark:text-red-100">{{ getInactiveFormTypesCount() }}</div>
        <div class="text-sm font-medium text-red-800 dark:text-red-200">{{ 'typeSoumission.inactiveForms' | translate }}</div>
    </div>
</div>

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