mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
feat: apply JetBrains Mono font to editor and preview code
- Add custom EditorView.theme for CodeMirror 6 with JetBrains Mono - Update .editor-textarea and #editor font-family to prioritize JetBrains Mono - Update preview code blocks (#preview code, .preview-content code) to use JetBrains Mono - Ensures consistent monospace font across editor source and markdown rendering Amit Haridas
This commit is contained in:
@@ -33,6 +33,19 @@ const {
|
||||
} = require('@codemirror/language');
|
||||
const { oneDark } = require('@codemirror/theme-one-dark');
|
||||
|
||||
// Custom theme for JetBrains Mono font
|
||||
const jetBrainsMonoTheme = EditorView.theme({
|
||||
'&': {
|
||||
fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Courier New', monospace"
|
||||
},
|
||||
'.cm-content': {
|
||||
fontFamily: 'inherit'
|
||||
},
|
||||
'.cm-scroller': {
|
||||
fontFamily: 'inherit'
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a CodeMirror 6 editor instance.
|
||||
*
|
||||
@@ -64,6 +77,7 @@ function createEditor(parentElement, options = {}) {
|
||||
highlightSelectionMatches(),
|
||||
autocompletion(),
|
||||
foldGutter(),
|
||||
jetBrainsMonoTheme,
|
||||
keymap.of([
|
||||
...defaultKeymap,
|
||||
...historyKeymap,
|
||||
|
||||
Reference in New Issue
Block a user