Closed joekrill closed 7 months ago
Guess this would also be the first step to fix #705
Guess this would also be the first step to fix #705
Yes it would help! If/after this (or something like it) gets merged, I was planning on then putting up a PR for the built-in Markdown plug to handle dark mode and custom styles.
Looks good
Stores the results of loading/parsing
settings.customStyles
inuiOptions
.Motivation
For the treeview plug I'd like to match the main application styles as closely as possible to be consistent. For the best results, we really need to:
The first two are fairly simple to handle in a plug (see here and here). In order to get the custom styles, though, I would have to duplicate the logic of the
loadCustomStyles
function. While relatively straight-forward, it seemed like this might be less error prone, more maintainable, more performant, and allow other plugs can take advantage of the functionality without having to re-implement it. Now a plug can just callawait editor.getUiOption("customStyles")
to get the custom styles.Thoughts? Does this seem like a useful and reasonable change? And is
uiOptions
the right place for this?We could also consider making this functionality the default for all panels created using
showPanel
. I had originally planned on putting up a PR for that, before realizing that it was pretty straight-forward to leave it up to the plug. That also has a lot more implications and would affect any existing plugs (though it did give the Markdown Preview dark mode support!). I guess the real question is: should it be a simple opt-in, simple opt-out, or up to the plug to handle the details?