Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add clsx for dynamic className management #92

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MehdiRaash
Copy link
Contributor

@MehdiRaash MehdiRaash commented Nov 10, 2024

why using clsx

clsx is a tiny lib, allowing to combine multiple class names conditionally without complex logic, string concatenation, or handling falsy values manually.

Benefits are as follows:

  • Conditionally add or omit class names based on boolean expressions.
  • Use arrays or objects to manage multiple classes flexibly.
  • Avoid including null, undefined, or false values in the class list, as clsx automatically filters them out.

Note: there’s no benefit to using clsx for a single class name, but I applied it throughout the repo for consistency sake.

changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant