bug 空header

This commit is contained in:
tangly1024
2022-04-29 13:26:52 +08:00
parent 62743e1735
commit 869cd0a3c9

View File

@@ -41,6 +41,9 @@ export default function HeaderArticle({ post, siteInfo }) {
if (!isDarkMode) {
const stickyNavElement = document.getElementById('sticky-nav')
const header = document.querySelector('#header')
if (!header || !stickyNavElement) {
return
}
if (window.scrollY < header.clientHeight) {
stickyNavElement?.classList?.add('dark')
} else {