Open
Conversation
|
@RHZHZ is attempting to deploy a commit to the tangly1024's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
已知问题
代码折叠体验不佳(全量折叠/全不折叠)
代码块视觉表现不统一
解决方案
基于行数的智能代码折叠(Scheme C)
PrismMac中为每个代码块统计行数CODE_COLLAPSE_MIN_LINES(默认 18 行)CODE_COLLAPSE开关,保持向后兼容通用化的 Mac 风代码块与 S1 极简折叠 UI
public/css/prism-mac-style.css.code-toolbar/.collapse-*作为通用选择器,不依赖具体主题 IDhtml.dark适配全站暗色模式改动收益
更智能的代码折叠体验
CODE_COLLAPSE_MIN_LINES自定义阈值更统一的视觉样式
更利于维护与扩展
PrismMac,样式集中在prism-mac-style.css具体改动
components/PrismMac.jsCODE_COLLAPSE_MIN_LINES配置读取,默认值为 20renderCollapseCode中统计每个代码块的行数,并只对超过阈值的块注入折叠 UITS · 42 linesCODE_COLLAPSE关闭时完全不影响现有行为public/css/prism-mac-style.css.code-toolbar容器.pre-mac三色点pre.notion-code代码排版与内边距.collapse-wrapper/.collapse-panel-wrapper/.collapse-header/.collapse-label/.collapse-chevron/.collapse-panelhtml.dark为暗色模式增加背景、边框和阴影适配(可选)
blog.config.jsCODE_COLLAPSE_MIN_LINES配置项与注释测试确认
CODE_COLLAPSE行为符合预期