pjeby / pane-relief

Obsidian plugin for per-pane history, pane movement/navigation hotkeys, and more
237 stars 7 forks source link

FR: Optional larger font size in maximized active tab #42

Closed RhvdG closed 1 year ago

RhvdG commented 1 year ago

Tried to fiddle with the css myself, but to no avail, and I think it's a good addition to the plugin's features: when using Maximize Active Tab, optionally have the font size blown up to a user defined extent, for iA Writer-like immersive writing (I'd recommend using the iA Writer Duo font face, too).

pjeby commented 1 year ago

The CSS you're looking for would be something like:

.workspace-leaf.is-maximized {
    /* css to set font variables or sizes here */
}

Since I don't know what exactly you're looking for as to the changed fonts, you'll need to do your own research or perhaps ask someone on the appearance channel on discord for help. If you end up with something suitable for general use I might be willing to test it for consideration of incorporating it into the plugin.

RhvdG commented 1 year ago

Tried this, thanks; no effect. Tried % and px, too.

.workspace-leaf.is-maximized {
font-size: 2em;
}
pjeby commented 1 year ago

If you're on Obsidian 1.x, you have to set the Obsidian theme variables that determine the font size, as there will be lots of more-specific rules that set font-size on individual elements, which the above will not override. You'll need to consult the Obsidian theming guide, or again, ask for help on the appearance channel.

RhvdG commented 1 year ago

If you're on Obsidian 1.x, you have to set the Obsidian theme variables that determine the font size, as there will be lots of more-specific rules that set font-size on individual elements, which the above will not override.

It doesn't work in a virginal sandbox vault, so I doubt that will help. But perhaps something else is amiss: the Simple Sliding Pages feature doesn't work either. Other Pane Relief features do.

pjeby commented 1 year ago

I don't understand what you mean. The theme variables thing will be true in a new sandbox, because they're part of Obsidian's core application CSS.

RhvdG commented 1 year ago

CSS wizard sailKite on Discord kindly solved this:

.workspace-leaf.is-maximized :is(.markdown-source-view .cm-scroller, .markdown-preview-view) {
    font-size: var(--font-ui-large);
} 

.workspace-leaf.is-maximized {
    --line-width-adaptive: 900px;
}

That's for use with the Minimal theme. Other themes might need:

.workspace-leaf.is-maximized :is(.markdown-source-view .cm-scroller, .markdown-preview-view) {
    font-size: var(--font-ui-large);
} 

.workspace-leaf.is-maximized {
    --file-line-width: 900px;
}
pjeby commented 1 year ago

Given that this is both theme and user-preference-specific, and hardcodes sizes, it's not appropriate for inclusion in this plugin. (It's also not really compliant with the theming guidelines -- for example, it should be adjusting the font variables rather than setting font-size directly.)

But at least you've got what you need and anyone needing this can find it here for a CSS snippet of their own, so I'm closing this as resolved now.