This commit is contained in:
zhongluofeng committed 2026-09-25 18:23:56 +08:00
1 parent 79bded1cd2
commit 9e6d73e191
73 files changed
+6229 -1427

No files matched your search

+38 -1
View File
@@ -1,4 +1,14 @@
@import "tailwindcss";
/* 把 Tailwind 的自动内容检测根**收窄到 src/**,不要从项目根开始扫。
*
* 原因:Tailwind v4 默认以项目根为扫描起点,只读**根目录**的 .gitignore。本仓库的
* Rust 构建产物 src-tauri/target(9.5 万个文件、124 GB)是在 src-tauri/.gitignore 里
* 嵌套忽略的,根 .gitignore 里没有它 —— 结果每次首次编译 CSS 都要把这堆后端产物
* 一并扫描,耗时几秒到几十秒(dev 下表现为「应用启动卡住 30~80 秒」,且随系统缓存
* 状态忽长忽短;release 只在构建期付一次,所以感知不到)。
*
* 前端所有 class 都在 src/ 下,index.html 不含 class,因此生成结果不变。
*/
@import "tailwindcss" source("../src");
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
@@ -21,6 +31,8 @@
--color-subtle: var(--subtle);
--color-hover: var(--hover);
--color-active: var(--active);
--color-row-hover: var(--row-hover);
--color-row-selected: var(--row-selected);
/* ---------- 描边扩展(border 为 shadcn 既有映射,见下方)---------- */
--color-border-strong: var(--border-strong);
@@ -120,6 +132,25 @@
--subtle: #f0f0f2; /* 次级填充:搜索框底、分段控件槽、代码块 */
--hover: #ebebed; /* 中性 hover 底色 */
--active: #e4e4e7; /* 中性 active 底色 */
/* 内容行的 hover / 选中底 —— 不透明面(卡片、面板)用这一对:
中性 hover 给按钮/菜单/表格(通用可点),行高亮给"承载一个对象的列表行"。
用 color-mix 引用 --primary 而不是写死值:用户换主题色时它自动跟随,
不必进 theme.ts 的派生组(行内 --primary 的替换是惰性求值的)。
混到不透明的 --card 而不是 transparent:行如果坐在透明根容器上(剪切板弹窗的
条目自带 --card 底色)就必须是不透明色。
两档必须拉开(8% vs 15%):--primary-soft 约等于 primary 10% 混白,行选中若也用它,
和 8% 的行 hover 只差 2 个色阶,等于看不出选中。 */
--row-hover: color-mix(in srgb, var(--primary) 8%, var(--card));
--row-selected: color-mix(in srgb, var(--primary) 15%, var(--card));
/* mica / acrylic 弹窗的行高亮(快速面板、托盘菜单:弹窗自身无底色,
行直接画在系统糊化层上)。这一对必须用透明度而不是上面那对不透明值:
1) 不透明浅底在壁纸糊化层上会变成一块"贴上去的白块",还盖掉 mica 质感;
2) 半透明与壁纸自然叠合,浅壁纸偏浅、深壁纸偏深 —— 因此这对值
不需要在 .dark 里重写(--primary 本身已经分深浅了)。
百分比明显高于不透明版,因为 8% 的底在壁纸上基本看不见。 */
--row-hover-veil: color-mix(in srgb, var(--primary) 16%, transparent);
--row-selected-veil: color-mix(in srgb, var(--primary) 30%, transparent);
/* ── 描边 ─────────────────────────────────────────────────────────── */
--border: #e4e4e7; /* 卡片外框、输入框 */
@@ -221,6 +252,12 @@
--subtle: #26262b;
--hover: #2c2c32;
--active: #33333a;
/* 深色下中性 hover 的明度差太小(--accent/40 在 #1E1E22 上几乎看不出),
行高亮用强调色调出来的深蓝灰,强度也相应比浅色高(11% vs 8%、26% vs 15%)。
注意 --row-hover-veil / --row-selected-veil 刻意不在这里重写:它们用透明度
叠在壁纸上,深浅由 --primary 自动决定。 */
--row-hover: color-mix(in srgb, var(--primary) 11%, var(--card));
--row-selected: color-mix(in srgb, var(--primary) 26%, var(--card));
--border: #2e2e34;
--border-strong: #3a3a42;