Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ThemeManager

A class that provides theme management.

Hierarchy

  • ThemeManager

Implements

Index

Constructors

constructor

  • Construct a new theme manager.

    Parameters

    Returns ThemeManager

Properties

Private _base

_base: any

Private _current

_current: any

Private _host

_host: any

Private _incrFontSize

_incrFontSize: any

Change a font size by a positive or negative increment.

Private _initOverrideProps

_initOverrideProps: any

Initialize the key -> property dict for the overrides

Private _links

_links: any

Private _loadSettings

_loadSettings: any

Handle the current settings.

Private _loadTheme

_loadTheme: any

Load the theme.

Notes

This method assumes that the theme exists.

Private _onError

_onError: any

Handle a theme error.

Private _outstanding

_outstanding: any

Private _overrideProps

_overrideProps: any

Private _overrides

_overrides: any

Private _pending

_pending: any

Private _requests

_requests: any

Private _settings

_settings: any

Private _splash

_splash: any

Private _themeChanged

_themeChanged: any

Private _themes

_themes: any

Private _trans

_trans: any

Protected translator

translator: ITranslator

Accessors

theme

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

    Returns string | null

themeChanged

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

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

themes

  • get themes(): ReadonlyArray<string>
  • The names of the registered themes.

    Returns ReadonlyArray<string>

Methods

decrFontSize

  • decrFontSize(key: string): Promise<void>
  • 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>

getCSS

  • getCSS(key: string): string
  • 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

getDisplayName

  • getDisplayName(name: string): string
  • Get the display name of the theme.

    Parameters

    • name: string

    Returns string

incrFontSize

  • incrFontSize(key: string): Promise<void>
  • 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>

isLight

  • isLight(name: string): boolean
  • Test whether a given theme is light.

    Parameters

    • name: string

    Returns boolean

isToggledThemeScrollbars

  • isToggledThemeScrollbars(): boolean
  • Test if the user has scrollbar styling enabled.

    Returns boolean

loadCSS

  • loadCSS(path: string): Promise<void>
  • Load a theme CSS file by path.

    Parameters

    • path: string

      The path of the file to load.

    Returns Promise<void>

loadCSSOverrides

  • loadCSSOverrides(): 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

  • register(theme: ITheme): IDisposable
  • 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.

setCSSOverride

  • setCSSOverride(key: string, value: string): Promise<void>
  • Add a CSS override to the settings.

    Parameters

    • key: string
    • value: string

    Returns Promise<void>

setTheme

  • setTheme(name: string): Promise<void>
  • Set the current theme.

    Parameters

    • name: string

    Returns Promise<void>

themeScrollbars

  • themeScrollbars(name: string): boolean
  • Test whether a given theme styles scrollbars, and if the user has scrollbar styling enabled.

    Parameters

    • name: string

    Returns boolean

toggleThemeScrollbars

  • toggleThemeScrollbars(): Promise<void>
  • Toggle the theme-scrollbbars setting.

    Returns Promise<void>

validateCSS

  • validateCSS(key: string, val: string): boolean
  • 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