catppuccin / obsidian

💎 Soothing pastel theme for Obsidian
MIT License
340 stars 15 forks source link

codeblock width in editing mode not 100% #58

Closed KulySocc closed 2 months ago

KulySocc commented 2 months ago

Why is the width of the codeblock in editing mode not 100%? And is there an easy way to tweak it?

editing image

reading image

mbeckrich commented 2 months ago

It's particularly bad in your case because you have numbered lines off, but that's not intended. I have just pushed a fix for this in https://github.com/catppuccin/obsidian/commit/84c6d243e9be7bf4fcbb42933beaebb93bd3b213 (give it a few minutes to make it to Obsidian). Please reopen the issue if it is still broken for you after updating.

As to why, briefly, I used ch as the unit for --file-line-width. Changing it from 65ch back to 700px (the default) fixes this problem. It looks like relative-ish units are having margin-right added to code blocks, because the app's internal css is applying the variable to .markdown-source-view.mod-cm6.is-readable-line-width .cm-content and then again, inside of that, to .markdown-source-view.mod-cm6.is-readable-line-width .cm-line, which I did not catch when making the theme. So, I think relative units are getting applied to themselves.