Penpot plugins API
    Preparing search index...

    Interface TokenTheme

    A preset of active TokenSets.

    A theme contains a list of references to TokenSets. When the theme is activated, it sets are activated too. This will not deactivate sets that are not in this theme, because they may have been activated by other themes.

    Themes may be gruped. At any time only one of the themes in a group may be active. But there may be active themes in other groups. This allows to define multiple "axis" for theming (e.g. color scheme, density or brand).

    When a TokenSet is activated or deactivated directly, all themes are disabled (indicating that now there is a "custom" manual theme active).

    interface TokenTheme {
        id: string;
        externalId: string | undefined;
        group: string;
        name: string;
        active: boolean;
        toggleActive(): void;
        activeSets: TokenSet[];
        addSet(tokenSet: TokenSet): void;
        removeSet(tokenSet: TokenSet): void;
        duplicate(): TokenTheme;
        remove(): void;
    }
    Index

    Properties

    id: string

    The unique identifier for this theme, used only internally inside Penpot. This one is not exported or synced with external Design Token sources.

    externalId: string | undefined

    Optional identifier that may exists if the theme was imported from an external tool that uses ids in the json file.

    group: string

    The group name of the theme. Can be empt string.

    name: string

    The name of the theme.

    active: boolean

    Indicates if the theme is currently active.

    activeSets: TokenSet[]

    The sets that will be activated if this theme is activated.

    Methods

    • Toggles the active status of this theme.

      Returns void

    • Removes this theme from the catalog.

      Returns void