fix(single): close remaining live gaps vs Zibll demo

Align runtime --sidebar-width (300→311), --main-radius, and
body.nav-fixed 88px reserve; enqueue single-post CSS parts directly;
match Zibll action buttons and author avatar DOM; tighten dual-column
tokens after comparing blog.rutua.cn with demo.zibll.com.
This commit is contained in:
2026-07-16 13:07:42 +08:00
parent 6c354fb086
commit f043d2c1ab
7 changed files with 132 additions and 68 deletions
@@ -43,12 +43,21 @@ class AKSRT_Inline_Style_Builder {
$dark_hover = $this->adjust_hex_color($dark_primary, -0.12);
$dark_active = $this->adjust_hex_color($dark_primary, -0.22);
// Zibll hard-codes 311px dual-column math; keep runtime width aligned to that
// baseline when settings still hold the old 300 default (or empty).
$sidebar_width = (int) ($sidebar_cfg['width'] ?? 311);
if ($sidebar_width <= 0 || $sidebar_width === 300) {
$sidebar_width = 311;
}
$sidebar_width = max(200, min(400, $sidebar_width));
$layout_vars = [
'--content-max' => $content_width,
'--content-no-sidebar-max' => $content_no_sidebar_max,
'--container' => $content_width,
'--container-wide' => $container_wide,
'--sidebar-width' => $sidebar_cfg['width'] . 'px',
'--mian-max-width' => $content_width, // zibll typo token
'--sidebar-width' => $sidebar_width . 'px',
'--color-primary' => $primary_color,
'--color-primary-hover' => $primary_hover,
'--color-primary-active' => $primary_active,
@@ -59,17 +68,21 @@ class AKSRT_Inline_Style_Builder {
'--radius-sm' => $radius_sm . 'px',
'--radius' => $border_radius . 'px',
'--radius-card' => $card_radius . 'px',
'--main-radius' => $card_radius . 'px',
// Zibll --main-radius tracks the base radius (8), not the larger card radius.
'--main-radius' => $border_radius . 'px',
'--radius-btn' => $border_radius . 'px',
'--radius-code' => $border_radius . 'px',
'--radius-lg' => $radius_lg . 'px',
'--radius-xl' => $radius_xl . 'px',
'--shadow-md' => '0 8px 24px rgba(20, 28, 48, 0.10)',
'--main-shadow' => 'rgba(116, 116, 116, 0.08)',
'--font-body' => $font_stacks['body'],
'--font-display' => $font_stacks['display'],
'--font-ui' => $font_stacks['ui'],
'--font-heading' => $font_stacks['ui'],
'--aksrt-logo-width' => $logo_width . 'px',
'--nav-height' => '60px',
'--single-cover-scale' => '35%',
'--posts-list-scale' => (class_exists('AKSRT_Settings') ? AKSRT_Settings::get_post_list_style_settings()['list_scale'] ?? 70 : 70) . '%',
'--posts-card-scale' => (class_exists('AKSRT_Settings') ? AKSRT_Settings::get_post_list_style_settings()['card_scale'] ?? 70 : 70) . '%',
];
@@ -192,6 +192,32 @@ trait AKSRT_Scripts_Part_1b {
// 单篇文章:所有 single 相关样式
if ($is_single_post) {
// Prefer discrete enqueues over CSS @import (cache-bust + parallel load).
$single_parts = [
'zibll-utilities',
'single-post/shell',
'single-post/content',
'single-post/code-blocks',
'single-post/navigation',
'single-post/cover',
'single-post/author-actions',
'single-post/related-toc',
'single-post/hidden-content',
];
$single_dep = $deps[0] ?? $core_dep;
foreach ($single_parts as $part) {
$path = get_template_directory() . '/assets/css/frontend/' . $part . '.css';
if (!file_exists($path)) {
continue;
}
wp_enqueue_style(
'aksrt-' . str_replace('/', '-', $part),
$base_uri . '/assets/css/frontend/' . $part . '.css',
is_string($single_dep) ? [$single_dep] : (array) $deps,
filemtime($path) ?: $version
);
}
// Keep aggregator handle for any third-party deps that target it.
$enqueue_module('single-post');
$enqueue_module('post-card'); // 相关推荐使用 post-card 局部样式
$enqueue_module('comments');