From 6bfedd60f4d8bb40cb16ed39e6775706dcddfacd Mon Sep 17 00:00:00 2001 From: Kinyoo Date: Wed, 15 Jul 2026 10:36:32 +0800 Subject: [PATCH] fix(client): register semantic font-size tokens in tailwind-merge (cn) extendTailwindMerge teaches cn() the custom text-caption/body/h1... tokens as a font-size group (v1.x config shape) so a size + a color in the same cn() call no longer drop the size; gallery Modal/ConfirmDialog sections + kit updates. Co-Authored-By: Claude Opus 4.8 --- .../client/src/pages/_gallery/GalleryApp.tsx | 2 +- .../src/pages/_gallery/components/kit.tsx | 8 ++-- .../sections/ConfirmDialogSection.tsx | 35 +++++++++------ .../pages/_gallery/sections/ModalSection.tsx | 45 +++++++++---------- src/frontend/client/src/utils/cn.ts | 25 ++++++++++- 5 files changed, 71 insertions(+), 44 deletions(-) diff --git a/src/frontend/client/src/pages/_gallery/GalleryApp.tsx b/src/frontend/client/src/pages/_gallery/GalleryApp.tsx index dce03c0a5..3d35a0a35 100644 --- a/src/frontend/client/src/pages/_gallery/GalleryApp.tsx +++ b/src/frontend/client/src/pages/_gallery/GalleryApp.tsx @@ -77,7 +77,7 @@ export default function GalleryApp() { key={p.id} onClick={() => setActiveId(p.id)} className={cn( - 'flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-body-sm transition-colors', + 'flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-body transition-colors', activeId === p.id ? 'bg-blue-500/[0.08] font-medium text-text-primary' : 'text-muted-foreground hover:bg-muted/60', diff --git a/src/frontend/client/src/pages/_gallery/components/kit.tsx b/src/frontend/client/src/pages/_gallery/components/kit.tsx index db113c73b..4c4e4e6d1 100644 --- a/src/frontend/client/src/pages/_gallery/components/kit.tsx +++ b/src/frontend/client/src/pages/_gallery/components/kit.tsx @@ -49,7 +49,7 @@ export function ComponentPage({

何时使用 / 规则