mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-11 08:46:20 +00:00
use constants and fix cursor color
This commit is contained in:
committed by
Junyoung Choi
parent
6012fc929e
commit
ba913b77e7
@@ -3,10 +3,13 @@ const fs = require('sander')
|
||||
const { remote } = require('electron')
|
||||
const { app } = remote
|
||||
|
||||
const CODEMIRROR_THEME_PATH = 'node_modules/codemirror/theme'
|
||||
const CODEMIRROR_EXTRA_THEME_PATH = 'extra_scripts/codemirror/theme'
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const paths = [
|
||||
isProduction ? path.join(app.getAppPath(), './node_modules/codemirror/theme') : path.resolve('./node_modules/codemirror/theme'),
|
||||
isProduction ? path.join(app.getAppPath(), './extra_scripts/codemirror/theme') : path.resolve('./extra_scripts/codemirror/theme')
|
||||
isProduction ? path.join(app.getAppPath(), CODEMIRROR_THEME_PATH) : path.resolve(CODEMIRROR_THEME_PATH),
|
||||
isProduction ? path.join(app.getAppPath(), CODEMIRROR_EXTRA_THEME_PATH) : path.resolve(CODEMIRROR_EXTRA_THEME_PATH)
|
||||
]
|
||||
|
||||
const themes = paths
|
||||
@@ -24,17 +27,17 @@ const themes = paths
|
||||
|
||||
themes.splice(themes.findIndex(({ name }) => name === 'solarized'), 1, {
|
||||
name: 'solarized dark',
|
||||
path: 'node_modules/codemirror/theme/solarized.css',
|
||||
path: `${CODEMIRROR_THEME_PATH}/solarized.css`,
|
||||
className: `cm-s-solarized cm-s-dark`
|
||||
}, {
|
||||
name: 'solarized light',
|
||||
path: 'node_modules/codemirror/theme/solarized.css',
|
||||
path: `${CODEMIRROR_THEME_PATH}/solarized.css`,
|
||||
className: `cm-s-solarized cm-s-light`
|
||||
})
|
||||
|
||||
themes.splice(0, 0, {
|
||||
name: 'default',
|
||||
path: '/node_modules/codemirror/theme/elegant.css',
|
||||
path: `${CODEMIRROR_THEME_PATH}/elegant.css`,
|
||||
className: `cm-s-default`
|
||||
})
|
||||
|
||||
|
||||
2
extra_scripts/codemirror/theme/nord.css
vendored
2
extra_scripts/codemirror/theme/nord.css
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
.cm-s-nord.CodeMirror { color: #d8dee9; }
|
||||
.cm-s-nord.CodeMirror { background: #2e3440; }
|
||||
.cm-s-nord .CodeMirror-cursor { color: #d8dee9; }
|
||||
.cm-s-nord .CodeMirror-cursor { color: #d8dee9; border-color: #d8dee9; }
|
||||
.cm-s-nord .CodeMirror-activeline-background { background: #434c5e52 !important; }
|
||||
.cm-s-nord .CodeMirror-selected { background: undefined; }
|
||||
.cm-s-nord .cm-comment { color: #4c566a; }
|
||||
|
||||
Reference in New Issue
Block a user