Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

⬆️ Upgrade tailwind-merge to v3 and remove text-wrap workaround (#2927)

Luke Vella296eb7ba5c57
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 574adde3c..4627cfe34 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -49,7 +49,7 @@
"rehype-sanitize": "^6.0.0",
"remark-breaks": "^4.0.0",
"sonner": "^2.0.6",
- "tailwind-merge": "^1.12.0"
+ "tailwind-merge": "^3.6.0"
},
"devDependencies": {
"@rallly/tsconfig": "workspace:*",
diff --git a/packages/ui/src/lib/utils.test.ts b/packages/ui/src/lib/utils.test.ts
new file mode 100644
index 000000000..59fd8630e
--- /dev/null
+++ b/packages/ui/src/lib/utils.test.ts
@@ -0,0 +1,19 @@
+import { describe, expect, it } from "vitest";
+import { cn } from "./utils";
+
+describe("cn", () => {
+ it("resolves conflicts between viewport-unit and standard sizing utilities", () => {
+ expect(cn("min-h-svh", "min-h-full")).toBe("min-h-full");
+ });
+
+ it("does not treat text-wrap utilities as text colors", () => {
+ expect(cn("text-pretty", "text-muted-foreground")).toBe(
+ "text-pretty text-muted-foreground",
+ );
+ });
+
+ it("resolves conflicts within the same class group", () => {
+ expect(cn("text-balance", "text-pretty")).toBe("text-pretty");
+ expect(cn("text-sm", "text-base")).toBe("text-base");
+ });
+});
diff --git a/packages/ui/src/lib/utils.ts b/packages/ui/src/lib/utils.ts
index 0b170cd6a..73803b0ce 100644
--- a/packages/ui/src/lib/utils.ts
+++ b/packages/ui/src/lib/utils.ts
@@ -1,15 +1,6 @@
import type { ClassValue } from "clsx";
import clsx from "clsx";
-import { extendTailwindMerge } from "tailwind-merge";
-
-// tailwind-merge v1 predates the text-wrap utilities and misclassifies them
-// as text colors, so `cn("text-pretty text-muted-foreground")` would drop
-// `text-pretty`. Remove this once tailwind-merge is upgraded to v2+.
-const twMerge = extendTailwindMerge({
- classGroups: {
- "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }],
- },
-});
+import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 883a5ac9a..f2ea37af4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -94,7 +94,7 @@ importers:
version: 8.1.0([email protected])
'@vercel/analytics':
specifier: ^1.5.0
dayjs:
specifier: ^1.11.13
version: 1.11.19
@@ -133,7 +133,7 @@ importers:
version: 6.0.0(@types/[email protected])([email protected])
next-seo:
specifier: ^6.1.0
pg:
specifier: ^8.17.1
version: 8.18.0
@@ -858,8 +858,8 @@ importers:
specifier: ^2.0.6
tailwind-merge:
- specifier: ^1.12.0
- version: 1.14.0
+ specifier: ^3.6.0
+ version: 3.6.0
devDependencies:
'@rallly/tsconfig':
specifier: workspace:*
@@ -10950,8 +10950,8 @@ packages:
resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==}
engines: {node: '>=20'}
- resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==}
+ resolution: {integrity: sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==}
resolution: {integrity: sha512-wAQiIxAPqk0MNTPptVe/xoyWi27y+NRGnTwvn4PQnbvB9kp8QUBiGl/wsfoVBHnQxTmhXJSNt9NHTmcz9EivFA==}
@@ -18359,7 +18359,7 @@ snapshots:
dependencies:
uncrypto: 0.1.3
optionalDependencies:
react: 19.2.6
@@ -22111,7 +22111,7 @@ snapshots:
react: 19.2.6
react-dom: 19.2.6([email protected])
dependencies:
react: 19.2.6
@@ -24138,7 +24138,7 @@ snapshots:
dependencies: