From 98d3da3d3a1aeca2e3bb6402574f44447c2caaa4 Mon Sep 17 00:00:00 2001 From: QQ Date: Tue, 3 Nov 2026 14:21:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20=E6=9C=80=E8=BF=91=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E7=9A=84=E5=A4=B4=E5=83=8F=E8=B4=B4=E5=88=B0=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E8=BE=B9=E6=A1=86=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gitea 1.21 的动态流用的是 .flex-list / .flex-item,不是老版 .ui.feed, 我之前的 .qq-dash-feed .ui.feed 选择器线上根本没命中,于是 .flex-item 保持 官方的 padding:10px 0 —— 左右零内边距,头像直接压在卡片左边框上。 - 改为 .qq-dash-feed .flex-item{padding:10px 16px} - 首条去掉 border-top(面板头已有下边框,避免双线) - 正文字号 13px / 行高 1.55 - 预览页 mock 同步换成 flex-list 结构,样式表 ?v=11 --- custom/public/assets/css/qq-pages.css | 22 +++++++++++-- custom/templates/custom/header.tmpl | 6 ++-- preview/dashboard.html | 28 ++++++++--------- preview/preview.css | 45 +++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 20 deletions(-) diff --git a/custom/public/assets/css/qq-pages.css b/custom/public/assets/css/qq-pages.css index 69971b2..3abe4d5 100644 --- a/custom/public/assets/css/qq-pages.css +++ b/custom/public/assets/css/qq-pages.css @@ -573,13 +573,29 @@ box-shadow: 0 4px 16px rgb(0 0 0 / 12%) !important; } -.qq-dash-feed .ui.feed { - padding: 10px 16px 16px; +/* 动态流:Gitea 1.21 用的是 .flex-list / .flex-item(不是老的 .ui.feed), + 它默认 padding:10px 0 —— 没有左右内边距,头像会贴到卡片边框上。 */ +.qq-dash-feed .flex-list { margin: 0; + padding: 0; } -.qq-dash-feed .ui.feed .event { +.qq-dash-feed .flex-item { + padding: 10px 16px; + border-top: 1px solid var(--color-secondary); +} + +.qq-dash-feed .flex-item:first-child { + border-top: 0; +} + +.qq-dash-feed .flex-item-main { font-size: 13px; + line-height: 1.55; +} + +.qq-dash-feed .flex-item-leading img { + border-radius: 50%; } /* 右栏 */ diff --git a/custom/templates/custom/header.tmpl b/custom/templates/custom/header.tmpl index 84291c3..cfb4371 100644 --- a/custom/templates/custom/header.tmpl +++ b/custom/templates/custom/header.tmpl @@ -4,9 +4,9 @@ 注意:只做外观增强,不引入任何外部依赖,全部资源随 custom/ 一起发布 */}} - - - + + + diff --git a/preview/dashboard.html b/preview/dashboard.html index 663be8e..fcb445c 100644 --- a/preview/dashboard.html +++ b/preview/dashboard.html @@ -106,27 +106,27 @@
最近动态
-
-
-
Q
-
+
+
+
Q
+
3 分钟前 -
qq 推送了 qq/gitea-font 的 main 分支
-
feat(fx): 首页与登录页动效层
+
qq 推送了 qq/gitea-font 的 main 分支
+
feat(fx): 首页与登录页动效层
-
-
Q
-
+
+
Q
+
2 小时前 -
新建仓库 qq/materials-notes
+
新建仓库 qq/materials-notes
-
-
Q
-
+
+
Q
+
昨天 -
在 qq/neovim-config 创建了标签 v3.1
+
在 qq/neovim-config 创建了标签 v3.1
diff --git a/preview/preview.css b/preview/preview.css index a72178f..01e3da5 100644 --- a/preview/preview.css +++ b/preview/preview.css @@ -385,3 +385,48 @@ body { .ui.feed .summary { font-size: 13px; } + +/* 动态流:与线上 Gitea 1.21 的 .flex-list/.flex-item 对齐(预览页复刻) */ +.flex-list { + margin: 0; + padding: 0; + list-style: none; +} + +.flex-item { + display: flex; + align-items: flex-start; + gap: 10px; + padding: 10px 16px; + border-top: 1px solid var(--color-secondary); +} + +.flex-item:first-child { + border-top: 0; +} + +.flex-item-leading .avatar { + display: inline-flex; + align-items: center; + justify-content: center; + width: 24px; + height: 24px; + font-size: 11px; + border-radius: 50%; + background: color-mix(in srgb, var(--color-primary) 18%, var(--color-box-body)); + color: var(--color-primary); +} + +.flex-item-main { + flex: 1 1 auto; + min-width: 0; + font-size: 13px; + line-height: 1.55; +} + +.flex-item-main .date { + display: block; + margin-bottom: 2px; + font-size: 11px; + color: var(--color-text-light-2); +}