Markdown editor respects dark mode
This commit is contained in:
parent
c4e236a0bf
commit
f1a34b7d1f
@ -22,6 +22,7 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
|
|||||||
protected hadOneFocusOut = false;
|
protected hadOneFocusOut = false;
|
||||||
|
|
||||||
public editorOptions = {
|
public editorOptions = {
|
||||||
|
theme: this.isDark() ? 'vs-dark' : 'vs',
|
||||||
language: 'markdown',
|
language: 'markdown',
|
||||||
uri: v4(),
|
uri: v4(),
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
@ -37,6 +38,10 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
|
|||||||
this.savedValue = this.initialValue;
|
this.savedValue = this.initialValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isDark() {
|
||||||
|
return document.body.classList.contains('dark');
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.editorService = this.editorService.getEditor(this.editorUUID);
|
this.editorService = this.editorService.getEditor(this.editorUUID);
|
||||||
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
this.editorService.registerNodeEditor(this.nodeId, this).then(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user