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:
2026-03-15 08:39:53 +05:30
parent d1c2c1c109
commit 95ea870039
2 changed files with 17 additions and 3 deletions
+14
View File
@@ -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,