phibr0 / obsidian-commander

Commander - Obsidian Plugin | Add Commands to every part of Obsidian's user interface
MIT License
733 stars 36 forks source link

[Bug]: CSS affects spacing of non-Commander items #90

Open pjeby opened 1 year ago

pjeby commented 1 year ago

Describe the bug

Commander's CSS sets margin-right for most status-bar-item and titlebar-button elements, but this affects buttons and status bar items that were not added by Commander, and whose spacing is negatively impacted. For example, on Windows, the minimize, maximize and close buttons (in hidden frame mode) have their spacing changed, which throws a number of things off.

Relevant errors (if available)

No response

Steps to reproduce

Set the button spacing to a very high or low number, and observe effects on:

Expected Behavior

Changing the button spacing in Commander should not affect the window controls or anything else but Commander's own buttons.

Additional context

I would suggest removing the .titlebar-button rule (since as far as I can tell, it is not actually used by Commander), and changing the .status-bar-item rule to only apply to .cmdr elements. That is, replace this:

.titlebar-button:not(:last-child),
.status-bar-item:not(:last-child) {
    margin-right: calc(var(--cmdr-spacing) - 8px);
}

With this:

.cmdr.status-bar-item:not(:last-child) {
    margin-right: calc(var(--cmdr-spacing) - 8px);
}

This should keep the CSS interference to a minimum.

Operating system

Windows

PulseRH commented 1 year ago

bump