I have my solution for you!
/* Reduce spacing between all headings in Reading Mode /
.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4,
.markdown-rendered h5,
.markdown-rendered h6 {
margin-top: 12px !important; / Space above the heading /
margin-bottom: 2px !important; / Space below the heading before text */
}
/* Additionally remove top margin from the very first element in the note */
.markdown-rendered :first-child {
margin-top: 0 !important;
}
/* Remove top margin from paragraphs that immediately follow headings */
.markdown-rendered h1 + p,
.markdown-rendered h2 + p,
.markdown-rendered h3 + p,
.markdown-rendered h4 + p,
.markdown-rendered h5 + p,
.markdown-rendered h6 + p {
margin-top: 0 !important;
}
/* Adjust heading padding in Live Preview (CM6 editor) /
.mod-cm6 .cm-editor .HyperMD-header-1 {
padding-top: 5px;
/ padding-bottom: 5px; */
}
.mod-cm6 .cm-editor .HyperMD-header-2 {
padding-top: 5px;
}
.mod-cm6 .cm-editor .HyperMD-header-3 {
padding-top: 5px;
}
.mod-cm6 .cm-editor .HyperMD-header-4 {
padding-top: 5px;
}
.mod-cm6 .cm-editor .HyperMD-header-5 {
padding-top: 5px;
}
.mod-cm6 .cm-editor .HyperMD-header-6 {
padding-top: 5px;
}
/* 1. Global spacing collapse via variables (Reading Mode) */
.markdown-rendered {
–p-spacing: 0px !important;
–list-spacing: 0px !important;
}
/* 2. Remove paragraph margins completely (Reading Mode) */
.markdown-rendered p {
margin-bottom: 0 !important;
margin-top: 0 !important;
}
/* 3. Compact spacing in Live Preview and Source Mode */
.markdown-source-view.mod-cm6 .cm-content > div {
margin-bottom: 0px !important;
padding-bottom: 0px !important;
}
/* 4. Remove remaining margins from lists */
.markdown-rendered ul,
.markdown-rendered ol {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
/* 5. Remove internal spacing between list items
(can only be further reduced using negative values) */
.markdown-rendered li {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
/* 1. Reduce margins for Callouts and Blockquotes in Reading Mode /
.markdown-rendered .callout,
.markdown-rendered blockquote {
margin-top: 4px !important; / Small top gap /
margin-bottom: 0px !important; / Remove bottom gap */
}
/* 2. Remove top margin from the paragraph immediately following them */
.markdown-rendered .callout + p,
.markdown-rendered blockquote + p {
margin-top: 0px !important;
}
/* 3. Live Preview (editing mode) adjustments */
.markdown-source-view.mod-cm6 .cm-content > .cm-callout,
.markdown-source-view.mod-cm6 .cm-content > .cm-quote {
padding-bottom: 0px !important;
}
/* If a line follows a Callout/Quote in the editor */
.markdown-source-view.mod-cm6 .cm-content > .cm-callout + .cm-line,
.markdown-source-view.mod-cm6 .cm-content > .cm-quote + .cm-line {
padding-top: 0px !important;
}