-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy paththemes.js
More file actions
25 lines (21 loc) · 791 Bytes
/
themes.js
File metadata and controls
25 lines (21 loc) · 791 Bytes
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
const path = require('node:path')
const fs = require('node:fs')
const pkg = require('./package.json')
const rootDir = path.resolve(__dirname)
module.exports = (RED) => {
const themes = fs.readdirSync(`${rootDir}/themes`)
for (const themeName of themes) {
const themePath = `themes/${themeName}`
RED.plugins.registerPlugin(themeName, {
type: 'node-red-theme',
css: [`${themePath}/${themeName}.min.css`],
mermaid: {
theme: require(`./${themePath}/${themeName}-mermaid.min.json`)
},
monacoOptions: {
theme: require(`./${themePath}/${themeName}-monaco.min.json`)
}
})
}
RED.log.info(`Node-RED Contrib Theme Collection version: v${pkg.version}`)
}