Registered custom colors not rendering on extension startup

I’m trying to have the colors in an extension change according to the current theme, which in my case is limited to either ‘dark’ or ‘light’. I followed this thread and implemented ColorContribution to register my custom colors then used css vars (prefixed with --theia) to refer to those colors.

On strartup, the custom colors in my extension are not there. The only appear when I manually change the theme.

@sefeki thank you for the discussion, it is difficult to identify the issue without looking at the code.
We have some examples in the framework if they are helpful to you such as: https://github.com/eclipse-theia/theia/blob/32766c051397218643552993c5d98a3f8bf9db1e/packages/scm/src/browser/scm-contribution.ts#L282.

I see that onStart there is some handling as to how to handle the registered colors (which may clarify some things for you):

 onStart(): void {
        for (const contribution of this.colorContributions.getContributions()) {
            contribution.registerColors(this.colors);
        }

        this.updateThemeBackground();
        ThemeService.get().onThemeChange(() => this.updateThemeBackground());

        this.update();
        ThemeService.get().onThemeChange(() => this.update());
        this.colors.onDidChange(() => this.update());
    }