Custom themingDecember 18, 2019 at 12:46am
Does anyone have experience making a custom theme?
I'm playing around with trying to access the ThemeManager from an extension, but what I'm seeing at runtime is a subset of the class defined here: https://github.com/eclipse-theia/theia/blob/master/packages/core/src/browser/theming.ts (using ThemeService.get()). Specifically the "register" method isn't there. I also tried creating a new ThemeService, as that seems like it'll override the existing one, but the constructor is protected. Maybe there's an example out there where someone has done this?
December 18, 2019 at 9:07am
We are reworking the theming at the moment. You should closely follow https://github.com/eclipse-theia/theia/pull/6475.
December 18, 2019 at 4:44pm
December 19, 2019 at 9:54am
I will write down in CHANGELOG how to register new color themes. For file icon themes one has to use VS Code extensions for now.
here is a summary of how custom color theme can be registered: https://github.com/eclipse-theia/theia/pull/6475/files/411af02907cbe5efea41370b53394c80f7c15c34#diff-4ac32a78649ca5bdd8e0ba38b7006a1eR26 Does it answer your question? Do you want to customize something else expect colors?
Thanks this totally answers my question. I'm also customizing the top menu, but that's already possible with a MenuContribution. We also make some layout changes, but are doing that just fine now by requiring a css file from our extension, since this gets loaded last by style-loader we can override things pretty easily. That is somewhat brittle cuz it'll break if we take an update of theia in which css class names on the DOM change, but once we have the this change it'll boil down to just a couple sizing/spacing css rules for us and we're willing to re-write the selectors if need be on a version bump. So all in all this gets us really close to where we need to be in a very native way, and we still have a path for those edge cases.