Skip to content

Commit

Permalink
fix: the toc jump and styling issues (#119)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

解决 TOC 样式以及点击 toc 后的定位问题

#### Which issue(s) this PR fixes:

Fixes #116 

#### Does this PR introduce a user-facing change?
```release-note
解决 TOC 样式及其点击后的定位问题
```
  • Loading branch information
LIlGG authored Oct 13, 2023
1 parent 2240926 commit 81dc882
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"alpinejs": "^3.12.2",
"pupa": "^3.1.0",
"tocbot": "^4.21.0"
"tocbot": "^4.21.2",
"pupa": "^3.1.0"
}
}
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ export function generateToc() {
extraListClasses: "space-y-1 dark:border-slate-500",
extraLinkClasses:
"group flex items-center justify-between rounded py-1 px-1.5 transition-all hover:bg-gray-100 text-sm opacity-80 dark:hover:bg-slate-700 dark:text-slate-50",
activeLinkClass: "is-active-link",
collapseDepth: 6,
headingsOffset: 100,
scrollSmooth: true,
scrollSmoothOffset: -100,
// @ts-ignore
tocScrollOffset: 50,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body {
text-shadow: 2px 2px 10px #000;
}

.is-active-li {
.is-active-link {
@apply rounded bg-gray-100 dark:bg-slate-600;
}

Expand Down
4 changes: 2 additions & 2 deletions templates/assets/dist/main.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/assets/dist/style.css

Large diffs are not rendered by default.

0 comments on commit 81dc882

Please sign in to comment.