Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wangchucheng/hugo-eureka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorWang Chucheng <ccwangchn@gmail.com>2020-11-15 18:48:51 +0300
committerWang Chucheng <ccwangchn@gmail.com>2020-11-15 18:48:51 +0300
commit96741f4b4da8079b96e9c7d342b0b03235f4654b (patch)
treeccfd87e9ec302fddf05b324330ba989996dfe399 /assets
parentafb8813e9b4eb2ad5fcf08e0a49e5991e13d8487 (diff)
fix: toc auto scroll
Diffstat (limited to 'assets')
-rw-r--r--assets/css/site.css2
-rw-r--r--assets/js/eureka.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/assets/css/site.css b/assets/css/site.css
index 817d608..a88e360 100644
--- a/assets/css/site.css
+++ b/assets/css/site.css
@@ -1,5 +1,5 @@
.sticky-toc {
- @apply sticky z-0 ease-in-out duration-300;
+ @apply sticky top-32 z-0 ease-in-out duration-300;
}
.sticky-toc a {
diff --git a/assets/js/eureka.js b/assets/js/eureka.js
index 644b115..923756f 100644
--- a/assets/js/eureka.js
+++ b/assets/js/eureka.js
@@ -42,7 +42,7 @@ function enableStickyToc() {
firstElement.firstChild.classList.add(textColor)
let offset = firstElement.offsetTop - targetPos;
if (offset > 0) {
- document.querySelector(`.sticky-toc`).style.top = `calc( 7rem - ${offset}px)`
+ document.querySelector(`.sticky-toc`).style.top = `calc( 8rem - ${offset}px)`
} else {
document.querySelector(`.sticky-toc`).removeAttribute("style");
}