diff --git a/src/views/conflicts-resolution/unified-diff-view.tsx b/src/views/conflicts-resolution/unified-diff-view.tsx index 0104e31..02e54b2 100644 --- a/src/views/conflicts-resolution/unified-diff-view.tsx +++ b/src/views/conflicts-resolution/unified-diff-view.tsx @@ -4,20 +4,6 @@ import { Decoration, EditorView } from "@codemirror/view"; import diff, { DiffChunk } from "./diff"; -const styles = document.createElement("style"); -styles.innerHTML = ` - .cm-changedLine { - background-color: rgba(var(--color-yellow-rgb), 0.1); - } - .cm-addedLine { - background-color: rgba(var(--color-green-rgb), 0.1); - } - .cm-deletedLine { - background-color: rgba(var(--color-red-rgb), 0.1); - } -`; -document.head.appendChild(styles); - interface UnifiedDiffViewProps { initialOldText: string; initialNewText: string; @@ -281,6 +267,15 @@ const UnifiedDiffView: React.FC = ({ "&.cm-focused .cm-cursor": { borderLeftColor: "var(--text-normal)", }, + ".cm-changedLine": { + backgroundColor: "rgba(var(--color-yellow-rgb), 0.1)", + }, + ".cm-addedLine": { + backgroundColor: "rgba(var(--color-green-rgb), 0.1)", + }, + ".cm-deletedLine": { + backgroundColor: "rgba(var(--color-red-rgb), 0.1)", + }, }), ]; }, [initialOldText, initialNewText]);