aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/darkmode.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/darkmode.js')
-rw-r--r--src/webview/darkmode.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/webview/darkmode.js b/src/webview/darkmode.js
index ab629435c..7435d6404 100644
--- a/src/webview/darkmode.js
+++ b/src/webview/darkmode.js
@@ -1,7 +1,7 @@
1/* eslint no-bitwise: ["error", { "int32Hint": true }] */ 1/* eslint no-bitwise: ["error", { "int32Hint": true }] */
2 2
3import path from 'path'; 3import { join } from 'path';
4import fs from 'fs-extra'; 4import { pathExistsSync, readFileSync } from 'fs-extra';
5 5
6const debug = require('debug')('Ferdi:DarkMode'); 6const debug = require('debug')('Ferdi:DarkMode');
7 7
@@ -10,9 +10,9 @@ const chars = [...'abcdefghijklmnopqrstuvwxyz'];
10const ID = [...Array(20)].map(() => chars[Math.random() * chars.length | 0]).join``; 10const ID = [...Array(20)].map(() => chars[Math.random() * chars.length | 0]).join``;
11 11
12export function injectDarkModeStyle(recipePath) { 12export function injectDarkModeStyle(recipePath) {
13 const darkModeStyle = path.join(recipePath, 'darkmode.css'); 13 const darkModeStyle = join(recipePath, 'darkmode.css');
14 if (fs.pathExistsSync(darkModeStyle)) { 14 if (pathExistsSync(darkModeStyle)) {
15 const data = fs.readFileSync(darkModeStyle); 15 const data = readFileSync(darkModeStyle);
16 const styles = document.createElement('style'); 16 const styles = document.createElement('style');
17 styles.id = ID; 17 styles.id = ID;
18 styles.innerHTML = data.toString(); 18 styles.innerHTML = data.toString();