fix(toc): fix toc link bug

This commit is contained in:
Dillon
2020-02-21 11:11:56 +08:00
parent 41a14bc2dc
commit a4116f14a7
12 changed files with 183 additions and 177 deletions

View File

@@ -1,6 +1,7 @@
html {
font-family: $global-font-family;
font-size: 16px;
width:100%;
}
/* scrollbar, only support webkit */

View File

@@ -2,8 +2,7 @@
.page {
max-width: 780px;
.post-toc {
width: 300px;
#toc-auto {
margin-left: 800px;
}
}
@@ -13,8 +12,7 @@
.page {
max-width: 680px;
.post-toc {
width: 240px;
#toc-auto {
margin-left: 700px;
}
}
@@ -24,8 +22,7 @@
.page {
max-width: 560px;
.post-toc {
width: 180px;
#toc-auto {
margin-left: 580px;
}
}
@@ -41,11 +38,11 @@
.page {
max-width: 80%;
.post-toc {
#toc-auto {
display: none;
}
.post-toc-mobile {
#toc-static {
display: block;
}
}

View File

@@ -1,25 +1,25 @@
.post-toc {
#toc-auto {
display: block;
position: absolute;
width: 360px;
width: 100%;
margin-left: 1000px;
padding: 0 .8rem;
border-left: 1px solid $global-border-color;
overflow-wrap: break-word;
box-sizing: border-box;
top: $post-toc-top;
top: if($header-normal-mode-desktop, 7rem, 12rem);
.dark-theme & {
border-left: 1px solid $global-border-color-dark;
}
.post-toc-title {
.toc-title {
font-weight: 400;
margin: .8rem 0;
text-transform: uppercase;
}
.post-toc-content {
.toc-content {
&.always-active ul {
display: block;
}
@@ -73,13 +73,13 @@
}
}
.post-toc-mobile {
#toc-static {
display: none;
padding-top: .8rem;
details {
summary {
.post-toc-title {
.toc-title {
display: block;
display: flex;
justify-content: space-between;
@@ -110,7 +110,7 @@
}
}
.post-toc-content {
.toc-content {
border: 2px solid $code-background-color;
>nav>ul {

View File

@@ -62,9 +62,6 @@ $header-position-mobile: if($header-normal-mode-mobile, static, fixed) !default;
$page-padding-top-desktop: if($header-normal-mode-desktop, 1rem, 6rem) !default;
$page-padding-top-mobile: if($header-normal-mode-mobile, 1rem, 6rem) !default;
// Top of the post toc
$post-toc-top: if($header-normal-mode-desktop, 7rem, 12rem) !default;
// Color of the hover header item
$header-hover-color: #161209 !default;
$header-hover-color-dark: #fff !default;