Obsidian 样式:如何自定义段落前后间距

Obsidian 样式:如何自定义段落前后间距

引言

Obsidian 虽然没有块的概念,但是具有类似文本编辑段落的形式。但有时候这种段落之间的间距,会让我们有点不适应。

如果你希望段落之间能像 Word 一样可视化调整,那么希望下面内容可以帮助你。

Snippets 方法

具体 CSS

body {
    --paragraph-margin-top:10px;
    --paragraph-margin-bottom:5px;
}

div:not(.HyperMD-header,.HyperMD-list-line).cm-line {
    padding-top:var(--paragraph-margin-top) !important;
    padding-bottom:var(--paragraph-margin-bottom) !important;
}

div:not(.HyperMD-header,.HyperMD-list-line).cm-line:has(.cm-fold-indicator) {
    padding-top:unset !important;
    padding-bottom:unset !important;
}
div:not(.HyperMD-header,.HyperMD-list-line).cm-line:has(.cm-hmd-frontmatter) {
    padding-top:unset !important;
    padding-bottom:unset !important;
}

/* @settings
name: Things Theme optimize
id: things-style-optimize
settings:
    -
        id: paragraph
        title: 段落间距调整
        type: heading
        level: 2
        collapsed: true
    -
        id: paragraph-margin-top
        title: 段前间距
        type: variable-text
        default: 5px
    -
        id: paragraph-margin-bottom
        title: 段后间距
        type: variable-text
        default: 5px    
*/


反馈交流

其他渠道

版权声明