From 03d02ad405ed58906426d8e5cd8a401e6ce1c851 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 22 Jul 2018 17:46:42 +0300 Subject: [PATCH] use codemirror theme in usercss installer page --- install-usercss/install-usercss.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index 27f233ef..5b04d870 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -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);