mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +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>
102 lines
2.8 KiB
Vue
102 lines
2.8 KiB
Vue
<template>
|
|
<div
|
|
:class="
|
|
cn(
|
|
'task-div group/task-card relative grid min-h-52 max-w-48',
|
|
isLoading && 'opacity-75'
|
|
)
|
|
"
|
|
>
|
|
<Card
|
|
:class="
|
|
cn(
|
|
'relative h-full max-w-48 overflow-hidden',
|
|
runner.state !== 'error' && 'opacity-65'
|
|
)
|
|
"
|
|
:pt="cardPt"
|
|
v-bind="(({ onClick, ...rest }) => rest)($attrs)"
|
|
>
|
|
<template #header>
|
|
<i
|
|
v-if="runner.state === 'error'"
|
|
class="pi pi-exclamation-triangle absolute top-0 -right-14 m-2 text-red-500 opacity-15"
|
|
style="font-size: 10rem"
|
|
/>
|
|
<img
|
|
v-if="task.headerImg"
|
|
:src="task.headerImg"
|
|
class="h-full w-full object-contain px-4 pt-4 opacity-25"
|
|
/>
|
|
</template>
|
|
<template #title>
|
|
{{ task.name }}
|
|
</template>
|
|
<template #content>
|
|
{{ description }}
|
|
</template>
|
|
<template #footer>
|
|
<div class="mt-1 flex gap-4">
|
|
<Button
|
|
:icon="task.button?.icon"
|
|
:label="task.button?.text"
|
|
class="w-full"
|
|
raised
|
|
icon-pos="right"
|
|
:loading="isExecuting"
|
|
@click="(event) => $emit('execute', event)"
|
|
/>
|
|
</div>
|
|
</template>
|
|
</Card>
|
|
|
|
<i
|
|
v-if="!isLoading && runner.state === 'OK'"
|
|
class="pi pi-check pointer-events-none absolute -right-4 -bottom-4 col-span-full row-span-full z-10 text-[4rem] text-green-500 opacity-100 transition-opacity group-hover/task-card:opacity-20 [text-shadow:0.25rem_0_0.5rem_black]"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
import Card from 'primevue/card'
|
|
import { computed } from 'vue'
|
|
|
|
import { useMaintenanceTaskStore } from '@/stores/maintenanceTaskStore'
|
|
import type { MaintenanceTask } from '@/types/desktop/maintenanceTypes'
|
|
import { cn } from '@/utils/tailwindUtil'
|
|
import { useMinLoadingDurationRef } from '@/utils/refUtil'
|
|
|
|
const taskStore = useMaintenanceTaskStore()
|
|
const runner = computed(() => taskStore.getRunner(props.task))
|
|
|
|
// Properties
|
|
const props = defineProps<{
|
|
task: MaintenanceTask
|
|
}>()
|
|
|
|
// Events
|
|
defineEmits<{
|
|
execute: [event: MouseEvent]
|
|
}>()
|
|
|
|
// Bindings
|
|
const description = computed(() =>
|
|
runner.value.state === 'error'
|
|
? (props.task.errorDescription ?? props.task.shortDescription)
|
|
: props.task.shortDescription
|
|
)
|
|
|
|
// Use a minimum run time to ensure tasks "feel" like they have run
|
|
const reactiveLoading = computed(() => !!runner.value.refreshing)
|
|
const reactiveExecuting = computed(() => !!runner.value.executing)
|
|
|
|
const isLoading = useMinLoadingDurationRef(reactiveLoading, 250)
|
|
const isExecuting = useMinLoadingDurationRef(reactiveExecuting, 250)
|
|
|
|
const cardPt = {
|
|
header: { class: 'z-0' },
|
|
body: { class: 'z-[1] grow justify-between' }
|
|
}
|
|
</script>
|