themeInfoChanged

Updated:

Subscribe to active theme info changes.

Description

Subscribes to changes in the active theme name and aesthetic.

Signature

tecton.sources.themeInfoChanged(callback: (info: ThemeInfo) => void): () => void;
export interface ThemeInfo {
    themeName: string;
    aesthetic: string|null;
}

Usage

Get theme info change broadcasts from Tecton sources

const unsubscribe = tecton.sources.themeInfoChanged?.(themeInfo => {
    console.log(themeInfo.themeName, themeInfo.aesthetic);
});

Additional Information

When using the themeInfoChanged source, there are important details to keep in mind.

Feature Detection

themeInfoChanged may not exist in older platform environments. Even if your extension is built against a newer Tecton SDK, the host UUX version it runs in may not advertise the capability and it will return undefined. When the capability is not available, your extension can fall back to themeChanged, which remains supported in older environments. Note that the broadcast payloads differ: themeInfoChanged fires with { themeName, aesthetic }, while themeChanged fires with the CSS file path of the active theme. The aesthetic value has no equivalent in older platforms.

Parameters

callback

Platform Support

UUX

Changelog

The changelog provides a detailed history of new features, improvements, and bug fixes going back to Tecton 1.30.0. If the button is disabled, it indicates there have been no detectable changes since then.

Show changelog (1)