Files
ComfyUI_frontend/src/components/templates/thumbnails/BaseThumbnail.vue
Christian Byrne 1221756e05 fix: enable enforce-canonical-classes tailwind lint rule (#9427)
## Summary

Enable `better-tailwindcss/enforce-canonical-classes` lint rule and
auto-fix all 611 violations across 173 files. Stacked on #9417.

## Changes

- **What**: Simplify Tailwind classes to canonical forms via `eslint
--fix`:
  - `h-X w-X` → `size-X`
  - `overflow-x-hidden overflow-y-hidden` → `overflow-hidden`
  - and other canonical simplifications
- Enable `enforce-canonical-classes` as `'error'` in eslint config

## Review Focus

Mechanical auto-fix PR — all changes produced by `eslint --fix`. No
visual or behavioral changes; canonical forms are functionally
identical.

**Stack:** #9417 → **this PR** → PR 3 (class order)

Fixes #9300 (partial — 2 of 3 rules)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9427-fix-enable-enforce-canonical-classes-tailwind-lint-rule-31a6d73d365081a49340d7d4640ede45)
by [Unito](https://www.unito.io)
2026-03-05 17:07:46 -08:00

51 lines
1.2 KiB
Vue

<template>
<div
class="relative aspect-square w-full overflow-hidden rounded-t-lg select-none"
>
<div
v-if="!error"
ref="contentRef"
class="size-full transform-gpu transition-transform duration-1000 ease-out"
:style="
isHovered ? { transform: `scale(${1 + hoverZoom / 100})` } : undefined
"
>
<slot />
</div>
<div v-else class="flex size-full items-center justify-center">
<img
src="/assets/images/default-template.png"
draggable="false"
class="size-full transform-gpu object-cover transition-transform duration-300 ease-out"
/>
</div>
</div>
</template>
<script setup lang="ts">
import { useEventListener } from '@vueuse/core'
import { onMounted, ref } from 'vue'
const error = ref(false)
const contentRef = ref<HTMLElement | null>(null)
const { hoverZoom = 4 } = defineProps<{
hoverZoom?: number
isHovered?: boolean
}>()
onMounted(() => {
const images = Array.from(contentRef.value?.getElementsByTagName('img') ?? [])
images.forEach((img) => {
useEventListener(img, 'error', () => {
error.value = true
})
})
})
</script>
<style scoped>
img {
transition: transform 1s cubic-bezier(0.2, 0, 0.4, 1);
}
</style>