Skip to content

8/16/2025

自定义样式

所有自定义css文件都放在<库名>/.obsidian/snippets文件夹中

ReadingProgress

控制目录宽度,使用非px单位

css
.rht-toc-content {
  width: 20vw !important;
}

在特定的页面控制阅读进度

已合并进插件中 代码片段来源于@[Moy](https://github.com/Moyf)
css
.show-rht-toc ~ .rht-reading-progress .rht-toc-list {
    opacity: 1 !important;
    visibility: visible !important;
}
css
.hide-rht-toc ~ .rht-reading-progress .rht-toc-list {
    opacity: 0 !important;
    visibility: hidden !important;
}

使用方法

在obsidian的文档属性cssclasses(推荐使用)或cssClass中添加 show-rht-tochide-rht-toc 类,即可控制阅读进度条的显示。

modal框中打开文件,阅读进度位置修复

已合并进插件中

代码片段来源于@primary-theme

css
.workspace-leaf-content:has(.rht-reading-progress) {
  container-type: inline-size;
}

在特定页面控制标题自动编号

已合并进插件中
css
.view-content:has(> .markdown-source-view.hide-rht-heading-number)

  .rht-toc-item-number,
.view-content:has(> div:not([style*="display: none"]).hide-rht-heading-number)
  .rht-toc-item-number {
  display: none !important;
}
css
.view-content:has(> .markdown-source-view.show-rht-heading-number)
  .rht-toc-item-number,
.view-content:has(> div:not([style*="display: none"]).show-rht-heading-number)
  .rht-toc-item-number {
  display: inline !important;
}

使用方法

在obsidian的文档属性cssclasses(推荐使用)或cssClass中添加 hide-rht-heading-numbershow-rht-heading-number,即可隐藏或显示标题自动编号。

Released under the GPL-3.0 license.