getStyleVar (Reading a style property)

Prev Next

Returns the value of any style property. Style properties can be listed and customized in the Styles module.

Tooltip

Syntax: $getStyleVar(varName[,defaultValue])

Parameter

Description

varName

The name of the style property (e.g. primaryColor).

defaultValue

(optional)

The value returned if the specified style property does not exist or returns an undefined value.

Returns the value of the style property with the name 'varName' (parameter).

Example: $getStyleVar(primaryColor) – delivers #980f45

Syntax

$getStyleVar(varName[,defaultValue])

Parameter

Name

Description

varName

The name of the style property (e.g. primaryColor).

defaultValue

(optional)

The value returned if the specified style property does not exist or returns an undefined value.

Return value

The value of the style property named 'varName' (parameter).

Example

Syntax

Result

$getStyleVar(primaryColor)

#980f45

$getStyleVar(buttonBorderRadius)

5px