refactor: adjust css

pull/131/head
Evan You 4 years ago
parent 061ad3ff32
commit f180083219

@ -170,7 +170,8 @@ export function useRoute(): Route {
}
function scrollTo(el: HTMLElement, hash: string, smooth = false) {
const pageOffset = document.getElementById('app')!.offsetTop
const pageOffset = (document.querySelector('.navbar') as HTMLElement)
.offsetHeight
const target = el.classList.contains('.header-anchor')
? el
: document.querySelector(decodeURIComponent(hash))

@ -36,7 +36,8 @@ export function useActiveSidebarLinks() {
sidebarLinks.some((sidebarLink) => sidebarLink.hash === anchor.hash)
) as HTMLAnchorElement[]
const pageOffset = document.getElementById('app')!.offsetTop
const pageOffset = (document.querySelector('.navbar') as HTMLElement)
.offsetHeight
const scrollTop = window.scrollY
const getAnchorTop = (anchor: HTMLAnchorElement): number =>

@ -95,8 +95,8 @@ body {
}
.theme main {
margin-top: var(--header-height);
margin-left: var(--sidebar-width);
padding-top: var(--header-height);
padding-left: var(--sidebar-width);
}
@media screen and (min-width: 720px) {

Loading…
Cancel
Save