efemkay / obsidian-modular-css-layout

CSS Layout hack for Obsidian.md
https://efemkay.github.io/obsidian-modular-css-layout/
GNU General Public License v3.0
901 stars 73 forks source link

Width control for codeblocks? #84

Open ramarivera opened 5 months ago

ramarivera commented 5 months ago

I noticed I cannot control the width of codeblocks with this great snippet :D

Is it possible to implement, or rather, was it not implemented because some particular reason?

I could try to open a PR to implement it, with some guidance, if time is an issue :)

efemkay commented 1 month ago

hey there. sorry for delayed response. only managed to go through all messages recently.

i never attempted to control the width of code block before. since i don't have the use case and so far, you're the only person requesting it. but there's one limitation of handling code blocks in obsidian - the live preview (editing mode) does not render the code block as good as the reading view especially when you have wide single line code. in live preview it doesn't have scroll or if we put a scroll bar, it will be line by line basis (and not code block basis)

i welcome you to open a PR. do let me know whenever u need guidance. i won't be personally attempting this for now as i'm focusing on stabilising the MCL performance a bit