Tweak style

This commit is contained in:
qingwei.li 2017-01-11 18:41:40 +08:00
commit 458e262a26
2 changed files with 5 additions and 3 deletions

View file

@ -48,7 +48,7 @@ export function scrollActiveSidebar () {
li.classList.add('active') li.classList.add('active')
active = li active = li
!hoveredOverSidebar && sticky.isSticky && active.scrollIntoView() !hoveredOverSidebar && !sticky.noSticky && active.scrollIntoView()
} }
window.removeEventListener('scroll', highlight) window.removeEventListener('scroll', highlight)
@ -125,10 +125,10 @@ export function sticky () {
return (function () { return (function () {
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) { if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
document.body.classList.add('sticky') document.body.classList.add('sticky')
sticky.isSticky = true sticky.noSticky = false
} else { } else {
document.body.classList.remove('sticky') document.body.classList.remove('sticky')
sticky.isSticky = false sticky.noSticky = true
} }
})() })()
} }

View file

@ -96,6 +96,7 @@ nav {
display: inline-block; display: inline-block;
ul { ul {
border-radius: 2px;
background-color: rgba($color-bg, .6); background-color: rgba($color-bg, .6);
border: 1px solid $color-primary; border: 1px solid $color-primary;
opacity: 0; opacity: 0;
@ -160,6 +161,7 @@ nav {
/* main */ /* main */
main { main {
display: block;
size: 100vw 100%; size: 100vw 100%;
position: relative; position: relative;
} }