From 6fd80be2437607400f811a5bc38807633a79d47b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Oct 2026 16:58:01 +0800 Subject: [PATCH] fix(frontend): match the reference check-in icon weight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 签到按钮的图标改成参考主题的字重。参考主题用的是 fa fa-calendar-check-o,即 FA4 的轮廓版日历勾选;之前换成了 FA5 的 fas fa-calendar-check,那是实心填充的,观感不一样。现在改成 fa far fa-calendar-check,走 FA5 的 regular 字重恢复轮廓外观,同时仍然满足全局 FA5+ 图标系统的要求。 间距也跟着对齐:弹窗里的两个分支去掉 mr6,改回参考的做法,由 .but > .fa:not(.fa-angle-right) 的 0.25em 外边距加上图标后面的一个空格来撑开。用户卡片徽章分支保留 ml3 mr6,因为它不是 .but,拿不到那条外边距。 改之前核对了字体:解析 fa-regular-400.woff 的 cmap 表,确认 calendar-check(U+F274)确实在 regular 字重里,否则图标会直接消失不见。顺便把卡片用到的全部图标逐个比对了 solid 与 regular 的覆盖情况,包括之前修过的 gem 水印(U+F3A5),都在。 main.css 里本来就有 .fa.far 的 font-weight 400 规则,不会被 solid 权重盖掉。新增 4 条契约断言锁住图标字重与间距,573 项测试全部通过。 --- inc/helpers/aksrt-header-userbox.php | 8 ++++---- tests/navigation/legacy-navigation-contract.test.cjs | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/inc/helpers/aksrt-header-userbox.php b/inc/helpers/aksrt-header-userbox.php index bc9e52a4..9b1e1cbf 100644 --- a/inc/helpers/aksrt-header-userbox.php +++ b/inc/helpers/aksrt-header-userbox.php @@ -59,13 +59,13 @@ if (!function_exists('aksrt_header_user_checkin_btn')) : // 用户卡片签到书签:保留书签类与 is-done 视觉,仅将行为切换为打开详情弹窗。 return aksrt_get_user_checkin_details_link( $class . ' is-done', - '' + '' . '' . esc_html__('已签到', 'aksrt') . '' ); } return aksrt_get_user_checkin_details_link( 'but block c-yellow is-done', - '' + ' ' . esc_html__('今日已签到', 'aksrt') ); } @@ -77,7 +77,7 @@ if (!function_exists('aksrt_header_user_checkin_btn')) : return '' - . '' + . '' . '' . esc_html__('签到', 'aksrt') . '' . ''; } @@ -85,7 +85,7 @@ if (!function_exists('aksrt_header_user_checkin_btn')) : return '' - . '' + . ' ' . '' . esc_html__('签到领取今日奖励', 'aksrt') . '' . ''; } diff --git a/tests/navigation/legacy-navigation-contract.test.cjs b/tests/navigation/legacy-navigation-contract.test.cjs index 1f1fbece..7990fedd 100644 --- a/tests/navigation/legacy-navigation-contract.test.cjs +++ b/tests/navigation/legacy-navigation-contract.test.cjs @@ -217,6 +217,14 @@ test('the account popover rows match the reference user box structure', () => { // Check-in entry is an anchor with the reference button classes. assert.match(header, /but block c-yellow/); assert.match(header, /data-signin-done-label[\s\S]{0,120}?今日已签到/); + // The reference renders fa-calendar-check-o, an outline glyph; FA5 keeps that + // look through the regular weight rather than the solid one. + assert.match(header, /fa far fa-calendar-check/); + assert.doesNotMatch(header, /fas fa-calendar-check/); + // .but already gives its icon a 0.25em margin, so the popover entry carries no + // margin class; the user-card badge keeps its own because it is not a .but. + assert.match(header, /