From e4fd521c124ac1b643b91a7064bb2be7f7602757 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 25 Feb 2018 16:19:08 -0500 Subject: [PATCH] feat: cm editor theme --- client/components/editor-code.vue | 5 +- client/scss/app.scss | 1 + client/scss/components/editor-code.scss | 79 +++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 client/scss/components/editor-code.scss diff --git a/client/components/editor-code.vue b/client/components/editor-code.vue index ba91e3c2..427cf403 100644 --- a/client/components/editor-code.vue +++ b/client/components/editor-code.vue @@ -93,9 +93,6 @@ import _ from 'lodash' import { codemirror } from 'vue-codemirror' import 'codemirror/lib/codemirror.css' -// Theme -import 'codemirror/theme/base16-dark.css' - // Language import 'codemirror/mode/markdown/markdown.js' @@ -168,7 +165,7 @@ export default { cmOptions: { tabSize: 2, mode: 'text/markdown', - theme: 'base16-dark', + theme: 'wikijs-dark', lineNumbers: true, lineWrapping: true, line: true, diff --git a/client/scss/app.scss b/client/scss/app.scss index 67f0454d..c4a02dc6 100644 --- a/client/scss/app.scss +++ b/client/scss/app.scss @@ -5,6 +5,7 @@ @import "../libs/animate/animate"; @import 'components/button'; +@import 'components/editor-code'; @import 'components/markdown-content'; @import 'components/navigator'; @import 'components/panel'; diff --git a/client/scss/components/editor-code.scss b/client/scss/components/editor-code.scss new file mode 100644 index 00000000..bb28508e --- /dev/null +++ b/client/scss/components/editor-code.scss @@ -0,0 +1,79 @@ +.cm-s-wikijs-dark.CodeMirror { + background: darken(mc('grey','900'), 3%); + color: #e0e0e0; +} +.cm-s-wikijs-dark div.CodeMirror-selected { + background: mc('blue','800'); +} +.cm-s-wikijs-dark .cm-matchhighlight { + background: mc('blue','800'); +} +.cm-s-wikijs-dark .CodeMirror-line::selection, .cm-s-wikijs-dark .CodeMirror-line > span::selection, .cm-s-wikijs-dark .CodeMirror-line > span > span::selection { + background: mc('red', '500'); +} +.cm-s-wikijs-dark .CodeMirror-line::-moz-selection, .cm-s-wikijs-dark .CodeMirror-line > span::-moz-selection, .cm-s-wikijs-dark .CodeMirror-line > span > span::-moz-selection { + background: mc('red', '500'); +} +.cm-s-wikijs-dark .CodeMirror-gutters { + background: darken(mc('grey','900'), 6%); + border-right: 1px solid mc('grey','900'); +} +.cm-s-wikijs-dark .CodeMirror-guttermarker { + color: #ac4142; +} +.cm-s-wikijs-dark .CodeMirror-guttermarker-subtle { + color: #505050; +} +.cm-s-wikijs-dark .CodeMirror-linenumber { + color: mc('grey','800'); +} +.cm-s-wikijs-dark .CodeMirror-cursor { + border-left: 1px solid #b0b0b0; +} +.cm-s-wikijs-dark span.cm-comment { + color: mc('orange','800'); +} +.cm-s-wikijs-dark span.cm-atom { + color: #aa759f; +} +.cm-s-wikijs-dark span.cm-number { + color: #aa759f; +} +.cm-s-wikijs-dark span.cm-property, .cm-s-wikijs-dark span.cm-attribute { + color: #90a959; +} +.cm-s-wikijs-dark span.cm-keyword { + color: #ac4142; +} +.cm-s-wikijs-dark span.cm-string { + color: #f4bf75; +} +.cm-s-wikijs-dark span.cm-variable { + color: #90a959; +} +.cm-s-wikijs-dark span.cm-variable-2 { + color: #6a9fb5; +} +.cm-s-wikijs-dark span.cm-def { + color: #d28445; +} +.cm-s-wikijs-dark span.cm-bracket { + color: #e0e0e0; +} +.cm-s-wikijs-dark span.cm-tag { + color: #ac4142; +} +.cm-s-wikijs-dark span.cm-link { + color: #aa759f; +} +.cm-s-wikijs-dark span.cm-error { + background: #ac4142; + color: #b0b0b0; +} +.cm-s-wikijs-dark .CodeMirror-activeline-background { + background: mc('grey','900'); +} +.cm-s-wikijs-dark .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +}