Skip to content
Snippets Groups Projects
Commit b712b970 authored by Mathis Neumann's avatar Mathis Neumann
Browse files

allow themes to override single properties and use theme variables for status highlighting

parent 60ddb1ae
No related branches found
No related tags found
No related merge requests found
......@@ -115,10 +115,10 @@ edge {
}
.WARNING {
background-color: yellow;
background-color: ${theme.statusWARNcolor};
}
.FAIL {
background-color: red;
background-color: ${theme.statusFAILcolor};
}
:selected {
......
import Ember from 'ember';
import Themes from '../utils/visualisation-themes';
const { Service, computed } = Ember;
const { Service, computed, copy, merge } = Ember;
/**
* Stores the settings for visualisations for a user.
......@@ -45,12 +45,15 @@ export default Service.extend({ // TODO: load and save to localstorage
/**
* Computed property that returns the CSS style object of the current theme.
* Themes can override each property of the `iObserve` Theme
*
* @property themeStyle
* @type {Object | CytoscapeCSS}
* @readOnly
*/
themeStyle: computed('theme', function() {
return Themes[this.get('theme')];
const defaultCopy = copy(Themes.iObserve);
return merge(defaultCopy, Themes[this.get('theme')]);
}),
/**
* List of available themes.
......
export default {
// this is the default theme, others can override properties, partial overrides are supported
'iObserve': {
nodeGroupTextColor : '#333399',
nodeGroupColor : 'white',
......@@ -11,7 +12,9 @@ export default {
serviceBorderColor : '#AAA',
arrowLineColor : '#AAA',
arrowColor : '#AAA',
arrowLabelColor: '#333399'
arrowLabelColor: '#333399',
statusWARNcolor: 'yellow',
statusFAILcolor: 'red'
},
'arctic': {
nodeGroupTextColor: '#3399CC',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment