fix(nav): render the theme toggle with the outline sun/moon face

The top-bar theme switch looked heavier and larger than the icons beside it.
An earlier commit dropped the `far` modifier from fa-toggle-theme, which moved
the glyphs to the Solid face. The reference's glyphs are the outline variants
(FA4's sun-o / moon-o), and in FA5 those live in the Regular face — so the
Solid replacement reads bolder and visually bigger at the same 1em size, while
the neighbouring account icons stay on the lighter Regular-style SVG set.

Restore `fa far fa-toggle-theme` on all three placements: desktop navbar,
mobile header, and the floating rail. The .fa-toggle-theme::before/::after
composite rules only handle positioning and the slide transition, so they are
unaffected by the face swap.

legacy-navigation-contract already asserts `fa far fa-toggle-theme` and passes
again; full suite 999/1000 with the pre-existing frontend-lifecycle failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-03 19:58:54 +08:00
1 parent 6c3c0f7c6d
commit 02246c7ec8
3 files changed
+6 -3

No files matched your search

+2 -1
View File
@@ -63,7 +63,8 @@ if (!function_exists('jio_nav_mobile_content')) :
if (in_array('m_menu', (array) ($ctx['theme_positions'] ?? []), true)) {
$top_btns .= '<a href="javascript:;" class="toggle-theme toggle-radius" id="theme-toggle-mobile" title="'
. esc_attr__('切换亮暗色', 'jio') . '">';
$top_btns .= '<i class="fa fa-toggle-theme" aria-hidden="true"></i>';
// 与桌面端一致:Regular 面才是参考主题的空心太阳/月亮。
$top_btns .= '<i class="fa far fa-toggle-theme" aria-hidden="true"></i>';
$top_btns .= '</a>';
}
if ('center' !== ($ctx['mobile_layout'] ?? 'center')) {
+3 -1
View File
@@ -324,7 +324,9 @@ if (!function_exists('jio_menu_button')) :
if (in_array('pc_nav', (array) ($ctx['theme_positions'] ?? []), true)) {
$utility_buttons .= '<a href="javascript:;" class="toggle-theme toggle-radius" id="theme-toggle-desktop" title="'
. esc_attr__('切换亮暗色', 'jio') . '">';
$utility_buttons .= '<i class="fa fa-toggle-theme" aria-hidden="true"></i>';
// 参考主题的太阳/月亮是空心字形;FA5 对应 Regular 面(far),
// 用 Solid(fa)会变成实心并显得更大更粗。
$utility_buttons .= '<i class="fa far fa-toggle-theme" aria-hidden="true"></i>';
$utility_buttons .= '</a>';
}
if (function_exists('jio_get_translate_language_btn')) {
+1 -1
View File
@@ -168,7 +168,7 @@ if (!function_exists('jio_float_right')) :
switch ($type) {
case 'theme_mode':
$btn .= '<a' . $style . ' class="float-btn toggle-theme hover-show"' . jio_float_btn_tooltip_attr(__('切换主题', 'jio'), $is_mobile) . ' href="javascript:;"><i class="fa fa-toggle-theme"></i></a>';
$btn .= '<a' . $style . ' class="float-btn toggle-theme hover-show"' . jio_float_btn_tooltip_attr(__('切换主题', 'jio'), $is_mobile) . ' href="javascript:;"><i class="fa far fa-toggle-theme"></i></a>';
break;
case 'back_top':