import {loadCSSVariablesFallback, replaceColors, Theme} from '@datorama/themify/utils';
import palette from 'path_to_my_json_pallete';
/** fallback for CSS variables support */
const themeCSSFallback = 'path/theme_fallback.css';
const themeJSONFallback = 'path/theme_fallback.json';
export class MyThemeService {
constructor(){
/**
* load the CSS fallback file, in case the browser do not support CSS Variables.
* Required only if you set screwIE11 option to false.
*
* callback - load event for the CSS file
*/
loadCSSVariablesFallback(themeCSSFallback, callback);
}
/**
* Replace the theme colors at runtime
* @param partialTheme a partial theme configuration.
*/
setColors(partialTheme: Theme){
replaceColors(themeJSONFallback, partialTheme, palette);
}
}