tnichols217 / obsidian-columns

GNU General Public License v3.0
207 stars 9 forks source link

[BUG: Internal] Min Width is not updated according to settings. #50

Closed qogoist closed 1 year ago

qogoist commented 1 year ago

Describe the bug

Settings for min-width and default span are not written to the respective CSS variables.

Steps To Reproduce

Go to the settings for this plugin. Change either of the settings.

Expected behavior

The CSS variables "--obsidian-columns-min-width" or "--obsidian-columns-def-span" should change in the ":root" and html.style. However they don't.

Screenshots

image image image

System Info

OS: Windows 11 Obsidian Version: v1.1.16 Plugin Version: v1.4.0

tnichols217 commented 1 year ago

They are currently updated on a per element level when rendered through JavaScript, but putting it on the root element is definitely a better idea. If youd like to make a PR id be happy to merge as I'm swamped currently and finding it hard to make time to maintain this extension. I will get around to it eventually though!

qogoist commented 1 year ago

Uhm, as far as I can tell there is nothing updated on a per-element basis. But that is just me snooping around the elements in the html inspector.

This is what the element css looks like in the inspector: image

Edit: After looking around the code a bit, I think your settings are actually never saved on change. But I might be completely off base.

tnichols217 commented 1 year ago

Ahh i didn't notice you were referring to the call-out syntax, because the codeblock syntax is dynamically generated here: https://github.com/tnichols217/obsidian-columns/blob/main/main.ts#L125

I'm not sure what you mean by never saving, as that's handled by the obsidian-settings submodule

tnichols217 commented 1 year ago

The saving is defined here: https://github.com/tnichols217/obsidian-columns/blob/main/main.ts#L281