use codemirror theme in usercss installer page

This commit is contained in:
tophf 2018-07-22 17:46:42 +03:00
parent 67f48d5e60
commit 03d02ad405

View File

@ -40,10 +40,18 @@
port.onDisconnect.addListener(onPortDisconnected);
}
const theme = prefs.get('editor.theme');
const cm = CodeMirror($('.main'), {
readOnly: true,
colorpicker: true,
theme,
});
if (theme !== 'default') {
document.head.appendChild($create('link', {
rel: 'stylesheet',
href: `vendor/codemirror/theme/${theme}.css`
}));
}
let liveReloadPending = Promise.resolve();
window.addEventListener('resize', adjustCodeHeight);