Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrules6872/8589fa497aee559e2cfe0fc1bc0aa311 to your computer and use it in GitHub Desktop.
Save hrules6872/8589fa497aee559e2cfe0fc1bc0aa311 to your computer and use it in GitHub Desktop.
Changes the readable line length in Obsidian Notes
/* Changes the readable line length in Obsidian Notes. Tested in Obsidian v0.15.9
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 */
:root {
--custom_line_width: 900px;
}
/* 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: var(--custom_line_width);;
}
/* Widths in editor mode */
.markdown-source-view.mod-cm6.is-readable-line-width.is-rtl .cm-contentContainer {
max-width: var(--custom_line_width);;
margin-left: auto;
}
.markdown-source-view.mod-cm6.is-readable-line-width:not(.is-rtl) .cm-contentContainer {
max-width: var(--custom_line_width);;
margin-right: auto;
}
.markdown-source-view.mod-cm6.is-line-wrap.is-readable-line-width .cm-line:not(.HyperMD-table-row) {
max-width: var(--custom_line_width);;
}
.markdown-source-view.mod-cm6.is-line-wrap.is-readable-line-width .cm-content {
max-width: var(--custom_line_width);;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment