diff options
Diffstat (limited to 'src/webview/darkmode.js')
-rw-r--r-- | src/webview/darkmode.js | 10 |
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 | ||
3 | import path from 'path'; | 3 | import { join } from 'path'; |
4 | import fs from 'fs-extra'; | 4 | import { pathExistsSync, readFileSync } from 'fs-extra'; |
5 | 5 | ||
6 | const debug = require('debug')('Ferdi:DarkMode'); | 6 | const debug = require('debug')('Ferdi:DarkMode'); |
7 | 7 | ||
@@ -10,9 +10,9 @@ const chars = [...'abcdefghijklmnopqrstuvwxyz']; | |||
10 | const ID = [...Array(20)].map(() => chars[Math.random() * chars.length | 0]).join``; | 10 | const ID = [...Array(20)].map(() => chars[Math.random() * chars.length | 0]).join``; |
11 | 11 | ||
12 | export function injectDarkModeStyle(recipePath) { | 12 | export 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(); |