Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daniel-wojahn/be9b42161022173d48fec7912b800ed3 to your computer and use it in GitHub Desktop.
Save daniel-wojahn/be9b42161022173d48fec7912b800ed3 to your computer and use it in GitHub Desktop.
Changes the readable line length in Obsidian Notes. Tested in Obsidian v0.14.6
/* Changes the readable line length in Obsidian Notes. Tested in Obsidian v0.14.6
See also: https://forum.obsidian.md/t/adjustable-readable-line-length/7564/6
Note: For this the "readable line length" property in settings has to be enabled
(as expected). 700px width is the application's default, adjust all numbers below.
Pixel (or percentage) as a unit enables a width independent from the number of characters
(good when adjusting zoom level / font size). For fixed amount of characters use rem */
/* Width in preview / read mode */
.markdown-preview-view.is-readable-line-width .markdown-preview-sizer,
.markdown-source-view.is-readable-line-width .cm-content {
max-width: 800px;
}
/* Widths in editor mode */
.markdown-source-view.mod-cm6.is-readable-line-width.is-rtl .cm-contentContainer {
max-width: 800px;
margin-left: auto;
}
.markdown-source-view.mod-cm6.is-readable-line-width:not(.is-rtl) .cm-contentContainer {
max-width: 800px;
margin-right: auto;
}
.markdown-source-view.mod-cm6.is-line-wrap.is-readable-line-width .cm-line:not(.HyperMD-table-row) {
max-width: 800px;
}
.markdown-source-view.mod-cm6.is-line-wrap.is-readable-line-width .cm-content {
max-width: 800px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment