Skip to content

[Development]: Add a TailwindCSS Class Merger Utility #127

@mohammad-mghn

Description

@mohammad-mghn

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

🪄 describe your feature or idea

Our codebase has frequent Tailwind CSS class merging conflicts, and clsx usage with conditional logic in class strings is cumbersome. I suggest adding a simple utility like cn, which combines clsx and tailwind-merge to streamline Tailwind class management.

We don’t need to install the cn package from SGLara, as it’s a lightweight module we can easily implement ourselves.

Proposed Solution:

  • Create a small cn-like utility function using clsx and tailwind-merge to handle conditional classes and resolve conflicts.
  • Update components to use this utility for cleaner class handling.

Benefits:

  • Reduces class merge conflicts.
  • Simplifies conditional class logic.
  • Improves code readability.

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