How to register VS Code themes

If I understand correctly I can register my custom theme for Theia like here https://github.com/theia-ide/theia-themes/blob/master/themes/src/browser/dracula-theme.ts. I read though that VS code themes are supported, but how do I register one?

[original thread by Hanksha]

No, these old way. The new way is not released yet and only available on next.

Please have a look at latest CHANGELOG. It should explain.

you can also implement a VS Code extension contributing a color theme

[Hanksha]

Ah ok, I tried with next but I’m getting errors, I’ll try again once it’s released.

[Hanksha]

@anton-kosyakov Does that mean ThemeService is deprecated and we should not use it in our extensions or we can still use it for our own custom product that won’t be using VS code extensions?

No, ThemeService is not deprecated. Please have look at CHANGELOG. The main difference that we don’t define css variables anymore in code, but do it pragmatically via ColorContribution, like list.activeSelectionForeground, later css variables are derived from it by prefixing with –theia- and replacing . with -, i.e. –theia-list-activeSelectionForeground.

[Hanksha]

Ok I see, so the theming includes colors, fonts and icons?

colors, file icons for now

fonts and other icons has to be changed with css variables as before

we just discussed it yesterday and theming will change even more later, we will completely transfer to declarative way, keeping some variables in css and some in code causing issues with restoring themes: https://github.com/eclipse-theia/theia/issues/6999

[Hanksha]

Alright thanks for the heads up