From 961af8731e523d381c319c8c788f25dc08aa20bc Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Fri, 26 Sep 2025 09:55:21 +1000 Subject: [PATCH] Split Tailwind utility functions out to a shared package (#5777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Split tailwind utils out to a shared package within the monorepo. ## Changes - Creates `@comfyorg/tailwind-utils` package - Does not require export, publishing, etc - Uses `export` to ensure this change does not impact other PRs (many imports to update) - If we _want_ to update all imports, there are two commits ready to be re-applied - e.g. `git revert 80960c2a82c0d1ac06eee1bb83ac333216b2b376` ## Review Focus - Is this pattern desirable? - Should we just include this in a broader design-system split? I kind of vote yes, but also it's a good small, first step. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5777-Split-Tailwind-utility-functions-out-to-a-shared-package-2796d73d3650815f976fc73b4fb86ef3) by [Unito](https://www.unito.io) --- package.json | 3 +-- packages/tailwind-utils/README.md | 31 ++++++++++++++++++++++++ packages/tailwind-utils/package.json | 30 +++++++++++++++++++++++ packages/tailwind-utils/src/index.ts | 8 ++++++ packages/tailwind-utils/tsconfig.json | 8 ++++++ pnpm-lock.yaml | 35 +++++++++++++++++++-------- src/utils/tailwindUtil.ts | 9 +------ 7 files changed, 104 insertions(+), 20 deletions(-) create mode 100644 packages/tailwind-utils/README.md create mode 100644 packages/tailwind-utils/package.json create mode 100644 packages/tailwind-utils/src/index.ts create mode 100644 packages/tailwind-utils/tsconfig.json diff --git a/package.json b/package.json index b441e421f..292ac5a70 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "@alloc/quick-lru": "^5.2.0", "@atlaskit/pragmatic-drag-and-drop": "^1.3.1", "@comfyorg/comfyui-electron-types": "0.4.73-0", + "@comfyorg/tailwind-utils": "workspace:*", "@iconify/json": "^2.2.380", "@primeuix/forms": "0.0.2", "@primeuix/styled": "0.3.2", @@ -130,7 +131,6 @@ "algoliasearch": "^5.21.0", "axios": "^1.8.2", "chart.js": "^4.5.0", - "clsx": "^2.1.1", "dompurify": "^3.2.5", "dotenv": "^16.4.5", "es-toolkit": "^1.39.9", @@ -148,7 +148,6 @@ "primevue": "^4.2.5", "reka-ui": "^2.5.0", "semver": "^7.7.2", - "tailwind-merge": "^3.3.1", "three": "^0.170.0", "tiptap-markdown": "^0.8.10", "vue": "^3.5.13", diff --git a/packages/tailwind-utils/README.md b/packages/tailwind-utils/README.md new file mode 100644 index 000000000..5f315600b --- /dev/null +++ b/packages/tailwind-utils/README.md @@ -0,0 +1,31 @@ +# @comfyorg/tailwind-utils + +Shared Tailwind CSS utility functions for the ComfyUI Frontend monorepo. + +## Usage + +The `cn` function combines `clsx` and `tailwind-merge` to handle conditional classes and resolve Tailwind conflicts. + +```typescript +import { cn } from '@comfyorg/tailwind-utils' + +// Use with conditional classes (object) +
+ +// Use with conditional classes (ternary) +