Add editor theme extension based on theme in App.tsx
This commit is contained in:
23
src/App.tsx
23
src/App.tsx
@@ -381,6 +381,29 @@ export default function App() {
|
||||
const trimmed = ollamaUrl.trim();
|
||||
return (trimmed || DEFAULT_OLLAMA_URL).replace(/\/+$/, "");
|
||||
}, [ollamaUrl]);
|
||||
const editorThemeExtension = useMemo(
|
||||
() =>
|
||||
EditorView.theme(
|
||||
{
|
||||
".cm-content, .cm-scroller": {
|
||||
caretColor: theme === "dark" ? "#f5f5f5" : "#1f1f1f"
|
||||
},
|
||||
"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": {
|
||||
borderLeftColor: theme === "dark" ? "#f5f5f5" : "#1f1f1f",
|
||||
borderLeftWidth: "1.6px"
|
||||
},
|
||||
".cm-dropCursor": {
|
||||
borderLeftColor: theme === "dark" ? "#f5f5f5" : "#1f1f1f",
|
||||
borderLeftWidth: "1.6px"
|
||||
},
|
||||
".cm-fatCursor": {
|
||||
background: theme === "dark" ? "rgba(245, 245, 245, 0.45)" : "rgba(31, 31, 31, 0.28)"
|
||||
}
|
||||
},
|
||||
{ dark: theme === "dark" }
|
||||
),
|
||||
[theme]
|
||||
);
|
||||
|
||||
const folderById = useMemo(() => {
|
||||
const map = new Map<string, Folder>();
|
||||
|
||||
Reference in New Issue
Block a user