Fixed logo visibility when the header is hidden

This commit is contained in:
Sodbileg Gansukh 2022-12-16 11:57:59 +08:00
parent ebb2538215
commit cc4d828575
7 changed files with 12 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -303,11 +303,11 @@ production stylesheet in assets/built/screen.css
grid-template-columns: auto 1fr auto; grid-template-columns: auto 1fr auto;
} }
.is-head-left-logo.home-template .gh-head-logo { .is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-logo {
display: none; display: none;
} }
.is-head-left-logo.home-template .gh-head-menu { .is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-menu {
margin-left: -40px; margin-left: -40px;
} }
@ -412,7 +412,7 @@ production stylesheet in assets/built/screen.css
} }
.gh-head-logo.no-image { .gh-head-logo.no-image {
margin-top: -2px; margin-top: -5px;
} }
.has-cover .gh-head-logo { .has-cover .gh-head-logo {

View File

@ -1,7 +1,8 @@
(function () { (function () {
const mediaQuery = window.matchMedia('(max-width: 767px)'); const mediaQuery = window.matchMedia('(max-width: 767px)');
const menu = document.querySelector('.gh-head-menu'); const head = document.querySelector('.gh-head');
const menu = head.querySelector('.gh-head-menu');
const nav = menu.querySelector('.nav'); const nav = menu.querySelector('.nav');
if (!nav) return; if (!nav) return;
@ -68,7 +69,7 @@
}); });
} }
imagesLoaded(logo, function () { imagesLoaded(head, function () {
makeDropdown(); makeDropdown();
}); });

View File

@ -21,10 +21,10 @@
<body class="{{body_class}} is-head-{{#match @custom.navigation_layout "Logo on cover"}}left-logo{{else match @custom.navigation_layout "Logo in the middle"}}middle-logo{{else}}stacked{{/match}}{{#match @custom.title_font "=" "Elegant serif"}} has-serif-title{{/match}}{{#match @custom.body_font "=" "Modern sans-serif"}} has-sans-body{{/match}}{{#if @custom.show_publication_cover}} has-cover{{/if}}"> <body class="{{body_class}} is-head-{{#match @custom.navigation_layout "Logo on cover"}}left-logo{{else match @custom.navigation_layout "Logo in the middle"}}middle-logo{{else}}stacked{{/match}}{{#match @custom.title_font "=" "Elegant serif"}} has-serif-title{{/match}}{{#match @custom.body_font "=" "Modern sans-serif"}} has-sans-body{{/match}}{{#if @custom.show_publication_cover}} has-cover{{/if}}">
<div class="viewport"> <div class="viewport">
<header id="gh-head" class="gh-head outer"> <header id="gh-head" class="gh-head outer{{#match @custom.header_style "Hidden"}} is-header-hidden{{/match}}">
<div class="gh-head-inner inner"> <div class="gh-head-inner inner">
<div class="gh-head-brand"> <div class="gh-head-brand">
<a class="gh-head-logo" href="{{@site.url}}"> <a class="gh-head-logo{{#unless @site.logo}} no-image{{/unless}}" href="{{@site.url}}">
{{#if @site.logo}} {{#if @site.logo}}
<img src="{{@site.logo}}" alt="{{@site.title}}"> <img src="{{@site.logo}}" alt="{{@site.title}}">
{{else}} {{else}}