mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Move line styles to theme
This commit is contained in:
parent
46186d8d23
commit
d8ebee26e8
1 changed files with 9 additions and 14 deletions
|
|
@ -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<UnifiedDiffViewProps> = ({
|
|||
"&.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]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue