getStyle method

Note: STABLE.
This API is reliable and breaking changes are unlikely.

qtheme.get.getStyle(basePath, path, attribute)

Retrieves the value of a style attribute in the theme by searching in the JSON structure of the theme.

The search starts at the specified base path and continue upwards until the value is found. If possible, it will get the value of the attribute using the given path

Version history

Introduced Qlik Sense February 2018

Parameters

basePath

Type: String

Defines the base path in the JSON structure of the theme. This is where to start the search.

Specified as a name path separated by dots.

path

Type: String

Expected path for the attribute.

Specified as a name path separated by dots.

attribute

Type: String

Name of the style attribute.

Returns

The style value as a string.

Example

qlik.theme.get('my-theme-id').then(function(qtheme){
  alert('Object title font size: ' + qtheme.getStyle('object', 'title.main', 'fontSize'));
});

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?