mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 12:42:01 +00:00
## Summary Remove Tailwind `@apply` from Vue styles across `src/` and `apps/desktop-ui/src/` to align with Tailwind v4 guidance, replacing usages with template utilities or native CSS while preserving behavior. ## Changes - **What**: - Batch 1: migrated low-risk template/style utility bundles out of `@apply`. - Batch 2: converted PrimeVue/`:deep()` override `@apply` blocks to native CSS declarations. - Batch 3: converted `src/components/node/NodeHelpContent.vue` markdown styling from `@apply` to native CSS/token-based declarations. - Batch 4: converted final desktop pseudo-element `@apply` styles and removed stale `@reference` directives no longer required. - Verified `rg -n "^\s*@apply\b" src apps -g "*.vue"` has no real CSS `@apply` directives remaining (only known template false-positive event binding in `NodeSearchContent.vue`). ## Review Focus - Visual parity in components that previously depended on `@apply` in `:deep()` selectors and markdown content: - topbar tabs/popovers, dialogs, breadcrumb, terminal overrides - desktop install/dialog/update/maintenance surfaces - node help markdown rendering - Confirm no regressions from removal of now-unneeded `@reference` directives. ## Screenshots (if applicable) - No new screenshots included in this PR. - Screenshot Playwright suite was run with `--grep="@screenshot"` and reports baseline diffs in this environment (164 passed, 39 failed, 3 skipped) plus a teardown `EPERM` restore error on local path `C:\Users\DrJKL\ComfyUI\LTXV\user`. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9146-fix-eradicate-tailwind-apply-usage-in-vue-styles-3116d73d3650813d8642e0bada13df32) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
65 lines
1.9 KiB
Vue
65 lines
1.9 KiB
Vue
<template>
|
|
<div
|
|
ref="containerRef"
|
|
:class="
|
|
cn(
|
|
'comfy-vue-side-bar-container group/sidebar-tab flex h-full flex-col',
|
|
props.class
|
|
)
|
|
"
|
|
>
|
|
<div class="comfy-vue-side-bar-header flex flex-col gap-2">
|
|
<Toolbar
|
|
class="min-h-16 bg-transparent rounded-none border-x-0 border-t-0 px-2 2xl:px-4"
|
|
:pt="sidebarPt"
|
|
>
|
|
<template #start>
|
|
<span class="truncate font-bold" :title="props.title">
|
|
{{ props.title }}
|
|
</span>
|
|
<slot name="alt-title" />
|
|
</template>
|
|
<template #end>
|
|
<div
|
|
class="touch:w-auto touch:opacity-100 [&_.p-button]:py-1 2xl:[&_.p-button]:py-2 flex flex-row overflow-hidden transition-all duration-200 motion-safe:w-0 motion-safe:opacity-0 motion-safe:group-focus-within/sidebar-tab:w-auto motion-safe:group-focus-within/sidebar-tab:opacity-100 motion-safe:group-hover/sidebar-tab:w-auto motion-safe:group-hover/sidebar-tab:opacity-100"
|
|
>
|
|
<slot name="tool-buttons" />
|
|
</div>
|
|
</template>
|
|
</Toolbar>
|
|
<slot name="header" />
|
|
</div>
|
|
<!-- h-0 to force scrollpanel to grow -->
|
|
<ScrollPanel class="comfy-vue-side-bar-body h-0 grow">
|
|
<slot name="body" />
|
|
</ScrollPanel>
|
|
<slot name="footer" />
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import type { InjectionKey, Ref } from 'vue'
|
|
|
|
export const SidebarContainerKey: InjectionKey<Ref<HTMLElement | null>> =
|
|
Symbol('SidebarContainer')
|
|
</script>
|
|
|
|
<script setup lang="ts">
|
|
import ScrollPanel from 'primevue/scrollpanel'
|
|
import Toolbar from 'primevue/toolbar'
|
|
import { provide, ref } from 'vue'
|
|
|
|
import { cn } from '@/utils/tailwindUtil'
|
|
|
|
const props = defineProps<{
|
|
title: string
|
|
class?: string
|
|
}>()
|
|
const sidebarPt = {
|
|
start: 'min-w-0 flex-1 overflow-hidden'
|
|
}
|
|
|
|
const containerRef = ref<HTMLElement | null>(null)
|
|
provide(SidebarContainerKey, containerRef)
|
|
</script>
|