Provides reactive observation of the Foundry core theme applied to document.body. There are several stores available to receive updates when the theme changes.

Constructors

Accessors

  • get themeName(): string
  • Returns string

    Current theme name; may be different from the theme token.

  • get themeToken(): string
  • Returns string

    Current theme token - CSS class.

Methods

  • Detect if theming tokens (CSS classes) are present in the given iterable list.

    Parameters

    • tokens: Iterable<string>

      a token list to verify if any theming tokens are included.

    • Optionaloptions: { strict?: boolean }

      Optional parameters.

      • Optionalstrict?: boolean

        When true, all theming tokens required if multiple are verified.

    Returns boolean

    True if theming tokens present.

  • Verify that the given theme name or token (CSS class) is the current platform theme.

    Parameters

    • theme: string

      A theme name or token to verify.

    Returns boolean

    If the requested theme matches the current platform theme.

  • Determine the nearest theme tokens (CSS classes) from the given element.

    Parameters

    • options: {
          element: EventTarget | Element;
          output?: Set<string>;
          override?: boolean;
          strict?: boolean;
      }

      Required options.

      • element: EventTarget | Element

        A DOM element.

      • Optionaloutput?: Set<string>

        An optional source Set of existing tokens.

      • Optionaloverride?: boolean

        When true, override any existing theme tokens.

      • Optionalstrict?: boolean

        When true, ensure all required theming tokens in output.

    Returns Iterable<string>

    Any theming tokens found from the given element.