Merge pull request #1312 from hgiesel/smalleditorrefactors

Use :host instead of :host-context
This commit is contained in:
Damien Elmes 2021-07-28 13:19:04 +10:00 committed by GitHub
commit 9c1c298426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -26,7 +26,7 @@ p {
} }
} }
:host-context(.nightMode) * { :host(.nightMode) * {
@include scrollbar.night-mode; @include scrollbar.night-mode;
} }

View file

@ -27,6 +27,10 @@ export class EditingArea extends HTMLDivElement {
this.attachShadow({ mode: "open" }); this.attachShadow({ mode: "open" });
this.className = "field"; this.className = "field";
if (document.documentElement.classList.contains("night-mode")) {
this.classList.add("night-mode");
}
const rootStyle = document.createElement("link"); const rootStyle = document.createElement("link");
rootStyle.setAttribute("rel", "stylesheet"); rootStyle.setAttribute("rel", "stylesheet");
rootStyle.setAttribute("href", "./_anki/css/editable.css"); rootStyle.setAttribute("href", "./_anki/css/editable.css");