Module: theme/Theme

Members

(static, constant) Theme

A facade to the underlying theming system that supports different storage implementations.

Source:

Methods

(inner) current() → {null|string}

Get the name of the current applied theme in DOM

Source:
Returns:
Type
null | string

(async, inner) init(options) → {Promise.<{from: string, name: string}>}

Auto-detects stored decision for the theme and falls back to system level preference. Otherwise, uses light theme.

Parameters:
Name Type Description
options object
Properties
Name Type Description
storage ThemeStorage
useStorage boolean
usePreferred boolean
Source:
Returns:

the name of the decision used for the theme.

Type
Promise.<{from: string, name: string}>

(inner) is(name) → {boolean}

Check if current applied theme (in DOM) is the theme of the given name

Parameters:
Name Type Description
name string
Source:
Returns:
Type
boolean

(async, inner) remove() → {Promise.<*>}

Removes the current theme from DOM

Source:
Returns:
Type
Promise.<*>

(async, inner) update(name) → {Promise.<*>}

Updates the current theme by given value, if supported (light, dark)

Parameters:
Name Type Description
name string
Source:
Returns:
Type
Promise.<*>