feat(toc): add collapsible table of contents functionality - #112
Open
ljxme wants to merge 2 commits into
Open
Conversation
implement toc collapse feature with smooth transitions and auto-expand behavior when headings are in view
|
@ljxme is attempting to deploy a commit to the cworld Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
🤔感觉实现的还是很生硬。。。,还请大佬指正 |
Owner
|
i18n那边改动较大,为避免冲突(其实是冲突解决太麻烦),先缓一缓吧。等那边合并完后这边再考虑着手处理 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
|
i18n对项目改动确实大,这个pr可以缓缓(待我改个好看点的样式😇 ) |
Owner
|
更建议用 rebase) |
Closed
Contributor
|
我研究了下,借助显示阅读进度功能加的 .highlight ,css 选择器选择下没有的目录项高度边框设置为 0 也可以。 .toc-item.ps-7:not(li:has(.highlight.toc-item) li .toc-item) {
height: 0px;
padding: 0px;
}或者加个动画 /* toc 自动折叠 */
li .toc-item {
max-height: 10rem;
}
.toc-item.ps-7:not(li:has(.highlight.toc-item) li .toc-item) {
/* height: 0px; */
padding-top: 0rem;
padding-bottom: 0rem;
max-height: 0rem;
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
简要描述:
site.config.ts文件中通过tocCollapse来控制是否开启目录折叠功能详见视频:
QQ20251129-225243-HD.mp4