mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-30 12:59:55 +00:00
## Summary Align color names and organize style.css some more ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6337-Style-Token-renaming-and-style-organization-29a6d73d365081b69f25ce1298c67fdc) by [Unito](https://www.unito.io)
32 lines
749 B
Markdown
32 lines
749 B
Markdown
# @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)
|
|
<div :class="cn('transition-opacity', { 'opacity-75': !isHovered })" />
|
|
|
|
// Use with conditional classes (ternary)
|
|
<button
|
|
:class="cn('px-4 py-2', isActive ? 'bg-blue-500' : 'bg-smoke-500')"
|
|
/>
|
|
```
|
|
|
|
## Installation
|
|
|
|
This package is part of the ComfyUI Frontend monorepo and is automatically available to all workspace packages.
|
|
|
|
```json
|
|
{
|
|
"dependencies": {
|
|
"@comfyorg/tailwind-utils": "workspace:*"
|
|
}
|
|
}
|
|
```
|