From 8d221ab36eddf172c0eaf0934407892e65bc9c49 Mon Sep 17 00:00:00 2001 From: wait4xx Date: Mon, 2 Nov 2026 16:39:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(home):=20=E5=88=86=E8=BD=A8=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E8=B4=B4=E5=B7=A6=E2=80=94=E2=80=94space-between=20?= =?UTF-8?q?=E6=8A=8A=E4=B8=AD=E9=97=B4=E9=A1=B9=E6=8C=A4=E5=88=B0=E6=AD=A3?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 分轨标题行有三个 flex 子项(::before 灰点 + 「阅读/技术」文本 + 右侧 「全部文章 →」),justify-content: space-between 会把中间的标题文本 挤到正中(用户实测"阅读/技术居中了")。改为 flex-start 贴左 + 链接 margin-left:auto 右推。实测标题距容器左缘 18px(灰点+间距),链接贴右。 验证: pnpm astro build 46 页 exit 0;playwright 实测两段标题 titleLeft=18 linkRight=0 Spec: none (单点样式修复) Co-authored-by: GLM-5.3 --- src/components/PostList.astro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/PostList.astro b/src/components/PostList.astro index e44267e..ca23a24 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -286,6 +286,7 @@ const byMonth = (list: CollectionEntry<'posts'>[]) => { color: var(--accent); border-bottom: 1px solid transparent; } + .more-link { margin-left: auto; } .more-link:hover { border-bottom-color: var(--accent); } /* ---- 首页分轨形态(perTrack):阅读/技朮两段,各段自带更多出口 ---- */ @@ -294,7 +295,10 @@ const byMonth = (list: CollectionEntry<'posts'>[]) => { display: flex; align-items: baseline; gap: 0.35rem; - justify-content: space-between; + /* 不能用 space-between:本行有三个 flex 子项(::before 灰点 + 标题文本 + + 右侧「全部文章 →」),space-between 会把中间的标题挤到正中(用户实测 + "阅读/技术居中了")。改为贴左,链接自行右推。 */ + justify-content: flex-start; margin: 0 0 var(--space-1); font-size: 13px; font-weight: 600;