eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.99k stars 2.5k forks source link

Allow fine-grained CSS control for theming #11063

Closed msujew closed 2 years ago

msujew commented 2 years ago

Feature Description:

VSCode allows fine-grained CSS control using the registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => void) method. In particular, it allows to set/change CSS rules depending on the currently selected theme colors.

I believe that this is a missing piece in our framework to implement https://github.com/eclipse-theia/theia/issues/6743. In a recent PR I encountered an CSS outline property, which would only work if the currently selected theme is a high contrast theme. In every other case it would lead to unexpected effects. So we definitely have a need to be able to control CSS rules in a more fine-grained way than currently possible.

In the spirit of DI and extensibility, my proposal would be to have something like a ThemingParticipant contribution provider which fulfills the same purpose as VSCode's registerThemingParticipant. However, I would like to hear the opinions of other contributors on that matter.

colin-grant-work commented 2 years ago

I'm strongly in favor. I believe that we could implement high-contrast theming without this, but doing so would require creating separate CSS files for all HC theme effects and dynamically loading and unloading them (we have a similar mechanism in place in our variables-light.useable.css and variables-dark.useable.css), but I believe that this style of contribution would be much more flexible and transparent.