-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththeme.js
More file actions
45 lines (43 loc) · 1.59 KB
/
theme.js
File metadata and controls
45 lines (43 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const fs = require('fs').promises
module.exports = {
setDark: function(mainWindow) {
if (!mainWindow || !mainWindow.webContents) return
fs.readFile(__dirname + '/styles/dark/messages.css', 'utf-8')
.then(style => {
style = style.replace(/\s{2,10}/g, ' ').trim()
mainWindow.webContents.insertCSS(style)
return fs.readFile(__dirname + '/styles/dark/home.css', 'utf-8')
})
.then(style => {
style = style.replace(/\s{2,10}/g, ' ').trim()
mainWindow.webContents.insertCSS(style)
return fs.readFile(
__dirname + '/styles/dark/search.css',
'utf-8'
)
})
.then(style => {
style = style.replace(/\s{2,10}/g, ' ').trim()
mainWindow.webContents.insertCSS(style)
return fs.readFile(
__dirname + '/styles/dark/activity.css',
'utf-8'
)
})
.then(style => {
style = style.replace(/\s{2,10}/g, ' ').trim()
mainWindow.webContents.insertCSS(style)
return fs.readFile(
__dirname + '/styles/dark/profile.css',
'utf-8'
)
})
.then(style => {
style = style.replace(/\s{2,10}/g, ' ').trim()
mainWindow.webContents.insertCSS(style)
})
.catch(err => {
console.log(err)
})
},
}