fix(cn): use canonical twMerge(clsx) so class overrides resolve
The local cn() joined classes with filter(Boolean).join(' '), which doesn't
dedupe conflicting Tailwind utilities — consumer className overrides could
silently lose to the component's base classes. Switch to the standard
twMerge(clsx(...)) (clsx + tailwind-merge are already app deps). Behaviour is
unchanged except conflicting overrides now win correctly. Build-verified
(skyai-finance clean; vibespace transforms all modules). Frontend audit rank 4.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import { clsx } from "clsx"
|
||||||
|
import { twMerge } from "tailwind-merge"
|
||||||
// PURPOSE: Personal-records primitives — kind-typed record cards, group
|
// PURPOSE: Personal-records primitives — kind-typed record cards, group
|
||||||
// sections with privacy framing, field tables and spec-driven
|
// sections with privacy framing, field tables and spec-driven
|
||||||
// field inputs, tier badges, the record→Markdown renderer, and a
|
// field inputs, tier badges, the record→Markdown renderer, and a
|
||||||
@@ -47,7 +49,7 @@ import {
|
|||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
function cn(...classes: (string | false | null | undefined)[]): string {
|
function cn(...classes: (string | false | null | undefined)[]): string {
|
||||||
return classes.filter(Boolean).join(" ");
|
return twMerge(clsx(classes))
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|||||||
Reference in New Issue
Block a user