Skip to content

Commit

Permalink
custom theme
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Dec 31, 2024
1 parent e2b1127 commit 21be1ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"dependencies": {
"@codemirror/lang-javascript": "^6.1.4",
"@codemirror/language": "^6.10.8",
"@codemirror/state": "^6.2.0",
"@codemirror/theme-one-dark": "^6.1.1",
"@codemirror/view": "^6.9.3",
"@flok-editor/cm-eval": "^1.0.1",
"@flok-editor/session": "^1.1.0",
Expand Down
16 changes: 3 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EditorView, basicSetup } from "codemirror";
import { javascript } from "@codemirror/lang-javascript";
import { oneDark } from "@codemirror/theme-one-dark";
import { EditorState, Prec } from "@codemirror/state";
import { keymap } from "@codemirror/view";
import { yCollab } from "y-codemirror.next";
Expand All @@ -9,6 +8,7 @@ import { flashField, evalKeymap, remoteEvalFlash } from "@flok-editor/cm-eval";
import { UndoManager } from "yjs";
import { highlightExtension } from "@strudel/codemirror";
import { StrudelSession, editorViews } from "./strudel";
import { kabelsalatTheme } from "./theme";

import "./style.css";

Expand Down Expand Up @@ -45,10 +45,10 @@ const createEditor = (doc) => {
doc: doc.content,
extensions: [
basicSetup,
kabelsalatTheme,
flokBasicSetup(doc),
javascript(),
EditorView.lineWrapping,
oneDark,
Prec.highest(
keymap.of([
...stopKeys.map((key) => ({
Expand All @@ -67,7 +67,6 @@ const createEditor = (doc) => {
const view = new EditorView({
state,
parent: editorEl,
// extensions: [kabelsalatTheme],
});
editorViews.set(doc.id, view);

Expand All @@ -80,8 +79,6 @@ const createEditor = (doc) => {
doc.session.on(`change-target:${doc.id}`, () => {
targetEl.value = doc.target;
});

return [state, view];
};

const handleEvalHydra = (msg) => {
Expand Down
2 changes: 1 addition & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ body {
}

:root {
--foreground: #eeeeee80;
--foreground: #ffffff80;
}

.editor {
Expand Down

0 comments on commit 21be1ec

Please sign in to comment.