fix(ui): 深色模式下补齐卡片与弹层的层次感
- 深色里沿用浅色那套低透明度黑色阴影没有对比度(黑投影落在 zinc-950 上), 悬停和弹层都看不出「浮起来」,本次为深色单独配一套阴影与状态色 - 卡片:静止态改「近距投影 + 顶部内高光」;悬停改「外扩暗晕 + 极淡白光晕 + 内高光 12%」,同时底色提亮一档(zinc-900 → zinc-800)、边框提到 zinc-600, 位移补偿到 2px —— 暗底上 1px 的移动肉眼看不出来 - 弹层:新增 shadow-pop-dark / shadow-panel-dark 标记类,只挂给深色底面的 下拉与抽屉;toast 在深色下仍是亮色块(dark:bg-zinc-100),保留原黑色投影, 避免亮块套白光晕发脏 - 抽屉补 dark:border-l:它在深色下既无边框又无可视阴影,与背景糊成一片 - 实现说明:Tailwind v4 会把 @theme 的阴影值内联进 --tw-shadow,覆盖 CSS 变量 对已生成的工具类无效,因此直接重写 box-shadow;规则不放进 @layer 以便稳定 压过原子类,且选择器需按 hover: 变体转义后的类名书写 验证:vue-tsc -b 与 eslint src 干净;TaskCard / SideDrawer / TagFilter / TagInput / BatchSelectionBar 共 114 例单测通过;另用 Playwright 采样像素亮度 与 getComputedStyle 确认深浅两套阴影各自命中。
This commit is contained in:
@@ -236,7 +236,7 @@ function onDueChange(value: string | null): void {
|
||||
|
||||
<div
|
||||
v-if="dueOpen"
|
||||
class="absolute top-full left-0 z-30 mt-1.5 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-pop dark:border-zinc-700 dark:bg-zinc-900"
|
||||
class="absolute top-full left-0 z-30 mt-1.5 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-pop shadow-pop-dark dark:border-zinc-700 dark:bg-zinc-900"
|
||||
>
|
||||
<DatePicker
|
||||
:model-value="batchDue"
|
||||
|
||||
@@ -108,7 +108,7 @@ onBeforeUnmount(stopListening)
|
||||
|
||||
<aside
|
||||
ref="panelRef"
|
||||
class="absolute inset-y-0 right-0 flex w-full max-w-md flex-col bg-white shadow-panel outline-none dark:bg-zinc-900"
|
||||
class="absolute inset-y-0 right-0 flex w-full max-w-md flex-col bg-white shadow-panel shadow-panel-dark outline-none dark:border-l dark:border-zinc-800 dark:bg-zinc-900"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
:aria-label="title"
|
||||
|
||||
@@ -86,7 +86,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<div
|
||||
v-if="open"
|
||||
class="absolute top-full left-0 z-20 mt-1.5 w-56 rounded-lg border border-slate-200 bg-white p-1.5 shadow-pop dark:border-zinc-700 dark:bg-zinc-900"
|
||||
class="absolute top-full left-0 z-20 mt-1.5 w-56 rounded-lg border border-slate-200 bg-white p-1.5 shadow-pop shadow-pop-dark dark:border-zinc-700 dark:bg-zinc-900"
|
||||
>
|
||||
<p v-if="tags.length === 0" class="px-2 py-3 text-center text-xs text-slate-400 dark:text-zinc-500">
|
||||
还没有任何标签
|
||||
|
||||
@@ -169,7 +169,7 @@ function onBlur(): void {
|
||||
id="tag-suggestions"
|
||||
role="listbox"
|
||||
aria-label="已有标签"
|
||||
class="absolute top-full left-0 z-20 mt-1 max-h-44 w-full overflow-y-auto rounded-lg border border-slate-200 bg-white p-1 shadow-pop dark:border-zinc-700 dark:bg-zinc-900"
|
||||
class="absolute top-full left-0 z-20 mt-1 max-h-44 w-full overflow-y-auto rounded-lg border border-slate-200 bg-white p-1 shadow-pop shadow-pop-dark dark:border-zinc-700 dark:bg-zinc-900"
|
||||
>
|
||||
<li
|
||||
v-for="(tag, index) in candidates"
|
||||
|
||||
@@ -98,7 +98,7 @@ const cardClass = computed(() => {
|
||||
}
|
||||
return isDone.value
|
||||
? 'border-slate-200 bg-white opacity-60 dark:border-zinc-800 dark:bg-zinc-900'
|
||||
: 'border-slate-200 bg-white hover:-translate-y-px hover:border-slate-300 hover:shadow-card-hover dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-700'
|
||||
: 'border-slate-200 bg-white hover:-translate-y-px hover:border-slate-300 hover:shadow-card-hover dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600 dark:hover:bg-zinc-800'
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user