Skip to content

Redundant classname utilities — both classnames and clsx are installed #27

@mahdirajaee

Description

@mahdirajaee

Description

The project installs both classnames (^2.5.1) and clsx (^2.1.1). These packages serve the same purpose — conditional CSS class string composition.

Having both adds unnecessary bundle weight and creates confusion about which one to use when contributing.

Recommendation

Keep clsx only. It is smaller (~330B vs ~600B gzipped), faster, and already works with tailwind-merge via the common cn() utility pattern:

import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

Then remove classnames from package.json and replace any imports throughout the codebase.

This is a small cleanup, but for a starter template it helps set the right convention from the start.

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