Explorar o código

feat: set CodeMirror theme to eclipse

partially fix violentmonkey/violentmonkey#76
Gerald %!s(int64=9) %!d(string=hai) anos
pai
achega
0c0548aadc
Modificáronse 2 ficheiros con 25 adicións e 0 borrados
  1. 2 0
      src/options/views/editor.js
  2. 23 0
      src/public/lib/CodeMirror/theme/eclipse.css

+ 2 - 0
src/options/views/editor.js

@@ -37,6 +37,7 @@ function addCSS(data) {
 function initCodeMirror() {
   addCSS([
     {href: '/lib/CodeMirror/lib/codemirror.css'},
+    {href: '/lib/CodeMirror/theme/eclipse.css'},
     {href: '/mylib/CodeMirror/fold.css'},
     {href: '/mylib/CodeMirror/search.css'},
   ]);
@@ -86,6 +87,7 @@ module.exports = {
         styleActiveLine: true,
         foldGutter: true,
         gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
+        theme: 'eclipse',
       });
       _this.readonly && editor.setOption('readOnly', _this.readonly);
       editor.on('change', function () {

+ 23 - 0
src/public/lib/CodeMirror/theme/eclipse.css

@@ -0,0 +1,23 @@
+.cm-s-eclipse span.cm-meta { color: #FF1717; }
+.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
+.cm-s-eclipse span.cm-atom { color: #219; }
+.cm-s-eclipse span.cm-number { color: #164; }
+.cm-s-eclipse span.cm-def { color: #00f; }
+.cm-s-eclipse span.cm-variable { color: black; }
+.cm-s-eclipse span.cm-variable-2 { color: #0000C0; }
+.cm-s-eclipse span.cm-variable-3 { color: #0000C0; }
+.cm-s-eclipse span.cm-property { color: black; }
+.cm-s-eclipse span.cm-operator { color: black; }
+.cm-s-eclipse span.cm-comment { color: #3F7F5F; }
+.cm-s-eclipse span.cm-string { color: #2A00FF; }
+.cm-s-eclipse span.cm-string-2 { color: #f50; }
+.cm-s-eclipse span.cm-qualifier { color: #555; }
+.cm-s-eclipse span.cm-builtin { color: #30a; }
+.cm-s-eclipse span.cm-bracket { color: #cc7; }
+.cm-s-eclipse span.cm-tag { color: #170; }
+.cm-s-eclipse span.cm-attribute { color: #00c; }
+.cm-s-eclipse span.cm-link { color: #219; }
+.cm-s-eclipse span.cm-error { color: #f00; }
+
+.cm-s-eclipse .CodeMirror-activeline-background { background: #e8f2ff; }
+.cm-s-eclipse .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }