Class ThemeManager

A class that provides theme management.

Hierarchy

  • ThemeManager

Implements

Constructors

Properties

_base: any
_current: any
_host: any
_incrFontSize: any

Change a font size by a positive or negative increment.

_initOverrideProps: any

Initialize the key -> property dict for the overrides

_links: any
_loadSettings: any

Handle the current settings.

_loadTheme: any

Load the theme.

Notes

This method assumes that the theme exists.

_onError: any

Handle a theme error.

_outstanding: any
_overrideProps: any
_overrides: any
_pending: any
_requests: any
_settings: any
_splash: any
_themeChanged: any
_themes: any
_trans: any
translator: ITranslator

Accessors

  • get darkThemes(): readonly string[]
  • Get the names of the dark themes.

    Returns readonly string[]

  • get lightThemes(): readonly string[]
  • Get the names of the light themes.

    Returns readonly string[]

  • get preferredDarkTheme(): string
  • Get the name of the preferred dark theme.

    Returns string

  • get preferredLightTheme(): string
  • Get the name of the preferred light theme.

    Returns string

  • get preferredTheme(): string
  • Get the name of the preferred theme When adaptive-theme is disabled, get current theme; Else, depending on the system settings, get preferred light or dark theme.

    Returns string

  • get theme(): string
  • Get the name of the current theme.

    Returns string

  • get themeChanged(): ISignal<this, IChangedArgs<string, string, string>>
  • A signal fired when the application theme changes.

    Returns ISignal<this, IChangedArgs<string, string, string>>

  • get themes(): readonly string[]
  • The names of the registered themes.

    Returns readonly string[]

Methods

  • Decrease a font size w.r.t. its current setting or its value in the current theme.

    Parameters

    • key: string

      A Jupyterlab font size CSS variable, without the leading '--jp-'.

    Returns Promise<void>

  • Get the value of a CSS variable from its key.

    Parameters

    • key: string

      A Jupyterlab CSS variable, without the leading '--jp-'.

    Returns string

    value - The current value of the Jupyterlab CSS variable

  • Get the display name of the theme.

    Parameters

    • name: string

    Returns string

  • Increase a font size w.r.t. its current setting or its value in the current theme.

    Parameters

    • key: string

      A Jupyterlab font size CSS variable, without the leading '--jp-'.

    Returns Promise<void>

  • Test whether a given theme is light.

    Parameters

    • name: string

    Returns boolean

  • Test if the system's preferred color scheme is dark

    Returns boolean

  • Test if the user enables adaptive theme.

    Returns boolean

  • Test if the user has scrollbar styling enabled.

    Returns boolean

  • Load a theme CSS file by path.

    Parameters

    • path: string

      The path of the file to load.

    Returns Promise<void>

  • Loads all current CSS overrides from settings. If an override has been removed or is invalid, this function unloads it instead.

    Returns void

  • Register a theme with the theme manager.

    Parameters

    • theme: ITheme

      The theme to register.

    Returns IDisposable

    A disposable that can be used to unregister the theme.

  • Add a CSS override to the settings.

    Parameters

    • key: string
    • value: string

    Returns Promise<void>

  • Set the preferred dark theme.

    Parameters

    • name: string

    Returns Promise<void>

  • Set the preferred light theme.

    Parameters

    • name: string

    Returns Promise<void>

  • Set the current theme.

    Parameters

    • name: string

    Returns Promise<void>

  • Test whether a given theme styles scrollbars, and if the user has scrollbar styling enabled.

    Parameters

    • name: string

    Returns boolean

  • Toggle the adaptive-theme setting.

    Returns Promise<void>

  • Toggle the theme-scrollbars setting.

    Returns Promise<void>

  • Validate a CSS value w.r.t. a key

    Parameters

    • key: string

      A Jupyterlab CSS variable, without the leading '--jp-'.

    • val: string

      A candidate CSS value

    Returns boolean

Generated using TypeDoc