Turning off readable line length for singe notes

Hi all,

I am trying to use the obsidian-gallery plug in to recreate Pinterest style functionality. It is working wonderfully, and I am very excited; I just have one little hiccup that I can’t quite get ironed out.

Things I have tried

I read that you can create custom CSS classes, and then create a CSS snippet to alter any notes which call for the custom class in their YAML front matter.

I added the following to the note with the gallery:

 ---
 cssclass: pinboard
 ---

I then created a CSS snippet gallery-view-widener.css:

 .markdown-reading-view.pinboard {
 min-width: 1000px;
 }

This doesn’t appear to do anything. I have substituted different values, and I have also tried width instead of min-width. I have enabled CSS snippets, and restarted Obsidian each time I have made changes.

It seems to me that something like this ought to work, but I don’t know what I am doing wrong. My CSS knowledge is minimal at best.

What I’m trying to do

I would like to be able to turn off readable line length only on those notes that I want to create galleries in.

1 Like

obsidian controls the readable line length by controlling the max-width parameter instead of the min. the way i set it is to select one div deeper (using css class of .markdown-preview-sizer). so ur css snippet should be as follows

.pinboard.markdown-preview-view.is-readable-line-width .markdown-preview-sizer {
	max-width: 1000px;
}

additional info

u would have to include selectors at the beginning (.markdown-preview-view.is-readable-line-width) for the css specificity or else the default theme will take priority

1 Like

This worked perfectly. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.