fix(frontend): match the reference check-in icon weight
签到按钮的图标改成参考主题的字重。参考主题用的是 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 项测试全部通过。
This commit is contained in:
@@ -59,13 +59,13 @@ if (!function_exists('aksrt_header_user_checkin_btn')) :
|
||||
// 用户卡片签到书签:保留书签类与 is-done 视觉,仅将行为切换为打开详情弹窗。
|
||||
return aksrt_get_user_checkin_details_link(
|
||||
$class . ' is-done',
|
||||
'<i class="fa fas fa-calendar-check ml3 mr6" aria-hidden="true"></i>'
|
||||
'<i class="fa far fa-calendar-check ml3 mr6" aria-hidden="true"></i>'
|
||||
. '<span>' . esc_html__('已签到', 'aksrt') . '</span>'
|
||||
);
|
||||
}
|
||||
return aksrt_get_user_checkin_details_link(
|
||||
'but block c-yellow is-done',
|
||||
'<i class="fa fas fa-calendar-check mr6" aria-hidden="true"></i>'
|
||||
'<i class="fa far fa-calendar-check" aria-hidden="true"></i> '
|
||||
. esc_html__('今日已签到', 'aksrt')
|
||||
);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ if (!function_exists('aksrt_header_user_checkin_btn')) :
|
||||
return '<a class="' . esc_attr($class) . '" href="javascript:;" data-signin-btn'
|
||||
. ' data-signin-idle-label="' . esc_attr__('签到', 'aksrt') . '"'
|
||||
. ' data-signin-done-label="' . esc_attr__('已签到', 'aksrt') . '">'
|
||||
. '<i class="fa fas fa-calendar-check ml3 mr6" aria-hidden="true"></i>'
|
||||
. '<i class="fa far fa-calendar-check ml3 mr6" aria-hidden="true"></i>'
|
||||
. '<span data-signin-label>' . esc_html__('签到', 'aksrt') . '</span>'
|
||||
. '</a>';
|
||||
}
|
||||
@@ -85,7 +85,7 @@ if (!function_exists('aksrt_header_user_checkin_btn')) :
|
||||
return '<a class="but block c-yellow" href="javascript:;" data-signin-btn'
|
||||
. ' data-signin-idle-label="' . esc_attr__('签到', 'aksrt') . '"'
|
||||
. ' data-signin-done-label="' . esc_attr__('今日已签到', 'aksrt') . '">'
|
||||
. '<i class="fa fas fa-calendar-check mr6" aria-hidden="true"></i>'
|
||||
. '<i class="fa far fa-calendar-check" aria-hidden="true"></i> '
|
||||
. '<span data-signin-label>' . esc_html__('签到领取今日奖励', 'aksrt') . '</span>'
|
||||
. '</a>';
|
||||
}
|
||||
|
||||
@@ -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, /<i class="fa far fa-calendar-check" aria-hidden="true"><\/i> '/);
|
||||
assert.match(header, /fa far fa-calendar-check ml3 mr6/);
|
||||
|
||||
// Card geometry falls back to the reference .sub-user-box width.
|
||||
assert.match(legacyMainCss, /\.sub-user-box\s*\{\s*width:\s*242px;/s);
|
||||
|
||||
Reference in New Issue
Block a user