forked from zhongyidian/yx-react-template
- 移除旧的 CSS 文件,改用 Tailwind CSS 进行样式管理 - 更新 tsconfig 和 Vite 配置以支持路径别名 - 添加 Node 类型定义以增强 TypeScript 支持
11 lines
315 B
TypeScript
11 lines
315 B
TypeScript
import { twMerge } from "tailwind-merge";
|
|
|
|
/**
|
|
* 合并 Tailwind CSS 类名,自动处理冲突
|
|
* @param classes - 要合并的类名
|
|
* @returns 合并后的类名字符串
|
|
*/
|
|
export function cn(...classes: (string | undefined | null | false)[]): string {
|
|
return twMerge(classes.filter(Boolean).join(" "));
|
|
}
|