Skip to content

Commit

Permalink
web: replace codemirror theme
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed Dec 30, 2024
1 parent 07cc922 commit 2287586
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
39 changes: 26 additions & 13 deletions web/package-lock.json

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

3 changes: 2 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"@codecov/rollup-plugin": "^1.6.0",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/legacy-modes": "^6.4.2",
"@codemirror/theme-one-dark": "^6.1.2",
"@fsegurai/codemirror-theme-vscode-dark": "^6.1.1",
"@fsegurai/codemirror-theme-vscode-light": "^6.1.1",
"@patternfly/patternfly": "^6.1.0",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-json": "^6.1.0",
Expand Down
14 changes: 4 additions & 10 deletions web/src/elements/CodeMirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {
} from "@codemirror/language";
import * as yamlMode from "@codemirror/legacy-modes/mode/yaml";
import { Compartment, EditorState, Extension } from "@codemirror/state";
import { oneDark } from "@codemirror/theme-one-dark";
import { EditorView, drawSelection, keymap, lineNumbers } from "@codemirror/view";
import { vsCodeDark } from "@fsegurai/codemirror-theme-vscode-dark";
import { vsCodeLight } from "@fsegurai/codemirror-theme-vscode-light";
import YAML from "yaml";

import { customElement, property } from "lit/decorators.js";
Expand Down Expand Up @@ -80,15 +81,8 @@ export class CodeMirrorTextarea extends AKElement {
constructor() {
super();
this.theme = new Compartment();
this.themeLight = EditorView.theme(
{
"&": {
backgroundColor: "var(--pf-global--BackgroundColor--light-300)",
},
},
{ dark: false },
);
this.themeDark = oneDark;
this.themeLight = vsCodeLight;
this.themeDark = vsCodeDark;
}

private getInnerValue(): string {
Expand Down

0 comments on commit 2287586

Please sign in to comment.