QTheme
This API is reliable and breaking changes are unlikely.
Class
QTheme()
An object that encapsulates a theme. The object is identical to the original theme.json file but with calculated styling values and helper methods for the theme.
Functions, variables and fallback logic are computed to return a final value that can be used for styling. For example, the original value for "color" can be a variable like "@B80", whereas the calculated value then might be "#CCCCCC".
Version history
Version state | Details |
---|---|
Introduced | Qlik Sense February 2018 |
Returned properties
id
Type: String
Theme ID.
properties
Type: Object
Theme properties tree structure with calculated styling values.
Functions, variables and inheritance have been computed from the original theme JSON file.
Example of returned properties
QTheme {
id: "my-theme",
properties: {
"color": "#000",
"fontSize": "12px",
"backgroundColor": "#999",
"object" : {
"title": {
"main": {
"fontSize" : "13px"
}
},
"pieChart": {
"title": {
"main": {
"fontSize" : "16px"
}
}
}
}
}
}
Example
app.theme.get('my-theme-id').then(function(qtheme){
alert('Theme background color: ' + qtheme.properties.backgroundColor);
});