(Branching from a conversation here: Plugin: 🎨 macOS theme for Joplin - #32 by uxamanda)
I was thinking about the Plugin CSS and how to make it 1) easier for plugin devs 2) more consistent from a design standpoint.
Right now each plugin (that is in an iframe) seems to have a copy of the CSS variables (i.e. --joplin-color-error: red; --joplin-color-warn: #9A5B00; etc).
Having these as named variables is great because then the plugin dev can use the same colors. Looking at a few plugins, they then tend to use them like
body{
background-color: var(--joplin-background-color);
}
This is ok, but wouldn't it be better if there was a css class called .joplin-background
that was already defined with that color variable, and therefore the plugin developer can use the class and be done?
The benefit of this is that if someone making a great theme could override/set the "root" / predefined joplin variables and then it could cascade down to the plugin.
The way it is now, there is no easy way to have the plugins match the theme. Some plugins (i.e. Note Tabs) have advanced preferences that let me manually set each color, but this is not ideal (cannot easily change from dark to light, fragile) and most don't bother exposing them.
Known Issues
Note: Because the plugin's are iFrames, I think that there would still need to be a step somewhere (?) that brings the root CSS variables and/or the classes in, it just seems like that should happen automatically when the app loads, not only when the Plugin is built. (Maybe the dev would include a flag to "include core css"?)
Ideas from other thread:
Anyways, just wanted to bring it up since I am a heavy plugin user, and I love the new theme.