Fix some dark mode styling
This commit is contained in:
@@ -18,6 +18,7 @@ export class CodeComponent extends EditorNodeContract implements OnInit {
|
||||
public notAvailableOffline = false;
|
||||
|
||||
public editorOptions = {
|
||||
theme: this.isDark() ? 'vs-dark' : 'vs',
|
||||
language: 'javascript',
|
||||
uri: v4(),
|
||||
readOnly: false,
|
||||
@@ -100,6 +101,10 @@ export class CodeComponent extends EditorNodeContract implements OnInit {
|
||||
public readonly api: ApiService,
|
||||
) { super(); }
|
||||
|
||||
public isDark() {
|
||||
return document.body.classList.contains('dark');
|
||||
}
|
||||
|
||||
public isDirty(): boolean | Promise<boolean> {
|
||||
return this.dirty;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="grid-wrapper">
|
||||
<ag-grid-angular
|
||||
style="width: 100%; height: 500px;"
|
||||
class="ag-theme-balham"
|
||||
[ngClass]="isDark() ? 'ag-theme-balham-dark' : 'ag-theme-balham'"
|
||||
[rowData]="rowData"
|
||||
[columnDefs]="columnDefs"
|
||||
suppressMovableColumns="true"
|
||||
|
||||
@@ -33,6 +33,10 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
||||
public notAvailableOffline = false;
|
||||
protected dbId!: string;
|
||||
|
||||
public isDark() {
|
||||
return document.body.classList.contains('dark');
|
||||
}
|
||||
|
||||
public get readonly() {
|
||||
return !this.node || !this.editorService.canEdit();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="container"
|
||||
<div [ngClass]="isDark() ? 'container dark' : 'container'"
|
||||
(dblclick)="onFocusIn($event)">
|
||||
<div class="toolbar-base" *ngIf="isFocused">
|
||||
<button class="toolbar-button" title="Bold" (click)="documentCommand('bold')">
|
||||
|
||||
@@ -34,3 +34,13 @@
|
||||
margin: 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.container.dark {
|
||||
.editable-base.focused {
|
||||
background: #404040 !important;
|
||||
}
|
||||
|
||||
.toolbar-base .toolbar-button:hover {
|
||||
background: #404040;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@ export class NormComponent extends EditorNodeContract implements OnInit {
|
||||
this.savedValue = this.initialValue;
|
||||
}
|
||||
|
||||
public isDark() {
|
||||
return document.body.classList.contains('dark');
|
||||
}
|
||||
|
||||
public isDirty(): boolean | Promise<boolean> {
|
||||
return this.dirtyOverride || this.contents !== this.savedValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user