mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-28 01:28:12 +00:00
default cm5 theme back
This commit is contained in:
@@ -22,7 +22,10 @@ import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
||||
import { autocompleteEmoji } from './autocompleteEmoji.js';
|
||||
import { searchKeymap, search } from '@codemirror/search';
|
||||
|
||||
import * as themes from '@uiw/codemirror-themes-all';
|
||||
import * as themesImport from '@uiw/codemirror-themes-all';
|
||||
import { defaultCM5Theme } from '@themes/codeMirror/customThemes/default.js';
|
||||
|
||||
const themes = { default: defaultCM5Theme, ...themesImport };
|
||||
const themeCompartment = new Compartment();
|
||||
const highlightCompartment = new Compartment();
|
||||
|
||||
@@ -170,11 +173,11 @@ const CodeEditor = forwardRef(
|
||||
openText : '▾',
|
||||
closedText : '▸'
|
||||
}),
|
||||
themeCompartment.of(themeExtension),
|
||||
|
||||
highlightActiveLine(),
|
||||
highlightActiveLineGutter(),
|
||||
highlightCompartment.of(combinedHighlight),
|
||||
themeCompartment.of(themeExtension),
|
||||
autocompleteEmoji,
|
||||
search(),
|
||||
];
|
||||
|
||||
@@ -24,6 +24,20 @@
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.cm-gutterElement span {
|
||||
font-family : inherit;
|
||||
font-weight : 600;
|
||||
color : grey;
|
||||
text-shadow : none;
|
||||
}
|
||||
|
||||
.cm-foldGutter {
|
||||
cursor : pointer;
|
||||
border-left : 1px solid #EEEEEE;
|
||||
transition : background 0.1s;
|
||||
&:hover { background : #DDDDDD; }
|
||||
}
|
||||
|
||||
/* Flash animation for source moves */
|
||||
.sourceMoveFlash .cm-line {
|
||||
animation-name: sourceMoveAnimation;
|
||||
|
||||
@@ -228,7 +228,8 @@ export function tokenizeCustomMarkdown(text) {
|
||||
}
|
||||
|
||||
export const customHighlightStyle = HighlightStyle.define([
|
||||
{ tag: tags.heading1, color: '#000', fontWeight: '700' },
|
||||
{ tag: tags.heading, class: 'cm-header' },
|
||||
{ tag: tags.heading1, class: 'cm-header cm-header-1' },
|
||||
{ tag: tags.keyword, color: '#07a' }, // example for your markdown headings
|
||||
{ tag: customTags.pageLine, color: '#f0a' },
|
||||
{ tag: customTags.snippetLine, class: 'cm-snippetLine', color: '#0af' },
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
background : white;
|
||||
.codeEditor {
|
||||
height : calc(100% - 25px);
|
||||
.cm-editor { height : 100%; }
|
||||
.cm-editor { height : 100%;
|
||||
outline:none !important;
|
||||
}
|
||||
&.brewSnippets .cm-snippetLine {
|
||||
background : #33333328;
|
||||
border-top : #333399 solid 1px;
|
||||
|
||||
@@ -24,7 +24,10 @@ const ThemeSnippets = {
|
||||
};
|
||||
|
||||
//import EditorThemes from '../../../../build/homebrew/codeMirror/editorThemes.json';
|
||||
import * as themes from '@uiw/codemirror-themes-all';
|
||||
import * as themesImport from '@uiw/codemirror-themes-all';
|
||||
import { defaultCM5Theme } from '@themes/codeMirror/customThemes/default.js';
|
||||
|
||||
const themes = { default: defaultCM5Theme, ...themesImport };
|
||||
|
||||
const EditorThemes = Object.entries(themes)
|
||||
.filter(([name, value]) =>
|
||||
|
||||
Reference in New Issue
Block a user