Merge pull request 'fix(header): use single adaptive logo like Zibll' (#99) from worktree-fix-footer-dual-logo into main

Reviewed-on: CYL/wordpress-theme-aksrt#99
This commit is contained in:
2026-07-13 07:59:48 +08:00
2 changed files with 27 additions and 9 deletions
+17 -1
View File
@@ -195,7 +195,23 @@ body.dark-theme .site-nav--blur.is-scrolled {
white-space: nowrap;
}
/* Light/dark logo toggle */
/* Light/dark logo: single adaptive img (white-src/dark-src via theme.js) */
.navbar-logo > img,
.navbar-logo .site-brand__logo-img,
.site-brand .site-brand__logo-img,
.site-brand__logo-img,
.site-brand .navbar-logo img {
height: 36px !important;
width: auto !important;
max-width: min(180px, 40vw) !important;
max-height: 36px !important;
padding: 0 !important;
object-fit: contain !important;
display: inline-block;
vertical-align: middle;
}
/* Legacy dual-img classes (if any remain elsewhere) */
.site-brand__logo-img--dark {
display: none;
}
+10 -8
View File
@@ -170,15 +170,17 @@ if (!empty($aksrt_bg_styles)) {
$aksrt_nav_styles[] = '--nav-max-width:' . (int) $aksrt_header_settings['max_width'] . 'px';
}
$aksrt_logo_parts = [];
if ($aksrt_logo_url !== '') {
$aksrt_logo_parts[] = '<img class="site-brand__logo-img site-brand__logo-img--light" src="' . esc_url($aksrt_logo_url) . '" alt="' . esc_attr($aksrt_brand_name) . '"' . ($aksrt_logo_width > 0 ? ' style="height:36px;width:auto;max-width:' . max(36, (int) $aksrt_logo_width) . 'px"' : '') . '>';
$aksrt_brand_logo_src = $aksrt_logo_url;
}
if ($aksrt_logo_dark_url !== '') {
$aksrt_logo_parts[] = '<img class="site-brand__logo-img site-brand__logo-img--dark" src="' . esc_url($aksrt_logo_dark_url) . '" alt="' . esc_attr($aksrt_brand_name) . '"' . ($aksrt_logo_width > 0 ? ' style="height:36px;width:auto;max-width:' . max(36, (int) $aksrt_logo_width) . 'px"' : '') . '>';
if ($aksrt_brand_logo_src === '') {
$aksrt_brand_logo_src = $aksrt_logo_dark_url;
if ($aksrt_logo_url !== '' || $aksrt_logo_dark_url !== '') {
$aksrt_logo_more = $aksrt_logo_width > 0
? 'style="height:36px;width:auto;max-width:' . max(36, (int) $aksrt_logo_width) . 'px"'
: 'style="height:36px;width:auto"';
$aksrt_logo_html = function_exists('aksrt_get_adaptive_theme_img')
? aksrt_get_adaptive_theme_img($aksrt_logo_url, $aksrt_logo_dark_url, $aksrt_brand_name, $aksrt_logo_more)
: '';
if ($aksrt_logo_html !== '') {
$aksrt_logo_parts[] = $aksrt_logo_html;
}
$aksrt_brand_logo_src = $aksrt_logo_url !== '' ? $aksrt_logo_url : $aksrt_logo_dark_url;
}
$aksrt_has_brand_logo = !empty($aksrt_logo_parts);
if ($aksrt_has_brand_logo) {