Members
(static, constant) changeSignal
Emitted whenever the theme is changed. Handlers are called with the following parameters:
theme: String, the new theme
Methods
(static) afterTransition(func, elementopt, nullable) → {Number}
Call a function after a timeout equal to a transition duration,
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
func |
function | function to run |
|
element |
jQuery |
<optional> <nullable> |
an optional HTML element whose visibility will be tested; if element is not currently
visible, |
Returns:
a timeout handle
- Type
- Number
(static) afterTransitionPromise(elementopt, nullable) → {Promise}
Create a promise that resolves after a timeout equal to a transition duration,
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
jQuery |
<optional> <nullable> |
an optional HTML element whose visibility will be tested; if element is not currently visible, promise is resolved asap |
Returns:
- Type
- Promise
(static) disableEffects()
Disable transitions, animations, blur filters and other effects. Use qui.theme.enableEffects to re-enable
effects.
(static) enableEffects()
Enable transitions, animations, blur filters and other effects. Use this function to re-enable effects disabled by
qui.theme.disableEffects.
(static) getAvailable() → {Object.<String, String>}
Return the available themes.
Returns:
a dictionary with theme names as keys and display names as values
- Type
- Object.<String, String>
(static) getColor(color) → {String}
Resolve a color name and normalize it using qui.utils.colors.normalize.
A color name can be an HTML color (e.g. teal) or a color theme variable name starting with an @ (e.g.
@background-color).
If a color is given, it will be normalized and returned right away. If the given color name cannot be resolved, the
@foreground-color is returned.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
String | a color or a color name |
Returns:
- Type
- String
(static) getCurrent() → {String}
Tell the current theme.
Returns:
- Type
- String
(static) getTransitionDuration() → {Number}
Return the default transition duration, in milliseconds.
Returns:
- Type
- Number
(static) getVar(name, defopt) → {String}
Return the value of a theme variable.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
String | the variable name |
|
def |
String |
<optional> |
a default value if the variable is not found or not set |
Returns:
- Type
- String
(static) init() → {Promise}
Initialize the theme subsystem.
Returns:
a promise that is resolved when theme subsystem has been initialized
- Type
- Promise
(static) setCurrent(theme) → {Promise}
Change the theme.
Parameters:
| Name | Type | Description |
|---|---|---|
theme |
String |
Returns:
a promise that resolves as soon as the theme has been set
- Type
- Promise