From 5fda10806db3eedeb76b84dabb783e00315e2aee Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Thu, 11 May 2023 11:48:59 +0100 Subject: [PATCH] Fixed tailwindMerge to work with the additional xxs font size --- apps/webapp/app/utils/cn.ts | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/apps/webapp/app/utils/cn.ts b/apps/webapp/app/utils/cn.ts index 8a542890a..0c2e8411f 100644 --- a/apps/webapp/app/utils/cn.ts +++ b/apps/webapp/app/utils/cn.ts @@ -1,12 +1,31 @@ import { clsx, type ClassValue } from "clsx"; -import { twMerge, extendTailwindMerge } from "tailwind-merge"; +import { extendTailwindMerge } from "tailwind-merge"; const customTwMerge = extendTailwindMerge({ - theme: { - fontSize: ["xxs"], + classGroups: { + text: [ + { + text: [ + "xxs", + "xs", + "sm", + "md", + "lg", + "xl", + "2xl", + "3xl", + "4xl", + "5xl", + "6xl", + "7xl", + "8xl", + "9xl", + ], + }, + ], }, }); export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); + return customTwMerge(clsx(inputs)); }