Adjustable "Readable Line Length"

There’s a solution that doesn’t require digging into classes. Obsidian and CodeMirror use CSS variables. I’ve successfully used the following CSS snippet:

:root {
  --line-width: 50rem;
}

@arathunku: Doesn’t work for me. The variable is actually:

body {
	--file-line-width: 750px;
}
3 Likes

This is great to hear! My solution worked with the most recent version at the time. I assume --file-line-width is now for 1.0.0?

I’ve just spent a silly amount of time bouncing between different threads trying to work out what I’m doing wrong, and trying numerous bits of code along the way only to find that I should have read the rest of the thread to find the code that does work (and then, for some reason, doesn’t work for me still).

I am starting to think I must have a plugin overriding the functionality.

I am using the Full Screen Mode Plugin to make the currently selected document exclusively full screen. I have tried with Minimal and Default themes. Maybe Style Settings or Minimal Theme Settings? Neither have exposed this variable for adjusting as far as I can see though, but I’m still new.

Ideally, when using non full screen mode, I want to either turn off readable line length or adjust it to fit a percentage of most of the size of the window.

When using full screen mode (wide screen monitor), I want to limit the width of the text and hide the scroll bar (only in this single document mode, ideally).

The simplest way to achieve this is to set the width of the text to what I want in full screen mode, and just be happy with that being the same maximum size when working in regular mode - and that probably would be fine, too.

I am able to enable, load and refresh CSS snippets in the .obsidian\snippets folder, but none of the snippets I find on here seem to function for this.

Has anyone got this reliably working now, and if so, pretty please let me know how?

Edit: Once again I’m a noob. Somehow I turned off Readable Line Length and didn’t check it while testing CSS for the past hour. Yeesh! But for some reason, none of the code is still working. I am trying to figure out what other nooby things I am still doing wrong.

Edit 2: The only code that seems to work for me now is:

body {
–file-line-width: 750px;
}

But the Minimal Theme or Minimal Theme Settings override this somehow.

1 Like

Can also confirm I am triple the goose after not being able to figure this out for the past hour:

If you make sure to enable Readable Line Length and don’t somehow turn it off by accident, Minimal Theme Settings has several ‘Line Width’ settings that do all this work for me.

Love this place, not so much a fan of how I stumble over my own feet, but hey XD

The only thing that worked for me:

body {
    --line-width-adaptive: 60rem;
}