Forked from vii33/obsidian-vii-adjustable-readable-line-length.css
Last active
May 15, 2023 06:33
-
-
Save hector6872/8589fa497aee559e2cfe0fc1bc0aa311 to your computer and use it in GitHub Desktop.
Changes the readable line length in Obsidian Notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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