I'm starting to use karma in an Angular app and would like to change the browser theme to be dark. I wanted to know if there was anywhere in the configuration file I can just inject simple css or use add a js file to inject these styles.
e.g. karma-styles.js
var css = `
html * {
background-color: black !important;
color: white !important;
}
.html-reporter .failures .spec-detail .description {
background-color: #b03911 !important;
}
`,
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
I've tried adding the file in karma config: // list of files / patterns to load in the browser files: [ './karma-styles.js', ],
but can't seem to get it to work or am not sure if this is the appropriate place to add this file.
Does anyone know how I can get custom styles with karma for dark themes or plugins that can do this?