1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00

use constants and fix cursor color

This commit is contained in:
Baptiste Augrain
2019-05-05 03:25:29 +02:00
committed by Junyoung Choi
parent 6012fc929e
commit ba913b77e7
2 changed files with 9 additions and 6 deletions

View File

@@ -3,10 +3,13 @@ const fs = require('sander')
const { remote } = require('electron') const { remote } = require('electron')
const { app } = remote 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 isProduction = process.env.NODE_ENV === 'production'
const paths = [ const paths = [
isProduction ? path.join(app.getAppPath(), './node_modules/codemirror/theme') : path.resolve('./node_modules/codemirror/theme'), isProduction ? path.join(app.getAppPath(), CODEMIRROR_THEME_PATH) : path.resolve(CODEMIRROR_THEME_PATH),
isProduction ? path.join(app.getAppPath(), './extra_scripts/codemirror/theme') : path.resolve('./extra_scripts/codemirror/theme') isProduction ? path.join(app.getAppPath(), CODEMIRROR_EXTRA_THEME_PATH) : path.resolve(CODEMIRROR_EXTRA_THEME_PATH)
] ]
const themes = paths const themes = paths
@@ -24,17 +27,17 @@ const themes = paths
themes.splice(themes.findIndex(({ name }) => name === 'solarized'), 1, { themes.splice(themes.findIndex(({ name }) => name === 'solarized'), 1, {
name: 'solarized dark', name: 'solarized dark',
path: 'node_modules/codemirror/theme/solarized.css', path: `${CODEMIRROR_THEME_PATH}/solarized.css`,
className: `cm-s-solarized cm-s-dark` className: `cm-s-solarized cm-s-dark`
}, { }, {
name: 'solarized light', name: 'solarized light',
path: 'node_modules/codemirror/theme/solarized.css', path: `${CODEMIRROR_THEME_PATH}/solarized.css`,
className: `cm-s-solarized cm-s-light` className: `cm-s-solarized cm-s-light`
}) })
themes.splice(0, 0, { themes.splice(0, 0, {
name: 'default', name: 'default',
path: '/node_modules/codemirror/theme/elegant.css', path: `${CODEMIRROR_THEME_PATH}/elegant.css`,
className: `cm-s-default` className: `cm-s-default`
}) })

View File

@@ -2,7 +2,7 @@
.cm-s-nord.CodeMirror { color: #d8dee9; } .cm-s-nord.CodeMirror { color: #d8dee9; }
.cm-s-nord.CodeMirror { background: #2e3440; } .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-activeline-background { background: #434c5e52 !important; }
.cm-s-nord .CodeMirror-selected { background: undefined; } .cm-s-nord .CodeMirror-selected { background: undefined; }
.cm-s-nord .cm-comment { color: #4c566a; } .cm-s-nord .cm-comment { color: #4c566a; }