web: use ShadowDom for all elements, embed smaller CSS in skeleton

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-16 17:09:52 +01:00
parent 0d9db1b6f2
commit e45bc3834a
6 changed files with 18 additions and 19 deletions

View File

@ -1,4 +1,5 @@
import { customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { COMMON_STYLES } from "../../common/styles";
export interface APIMessage {
level_tag: string;
@ -25,8 +26,8 @@ export class Message extends LitElement {
@property({attribute: false})
onRemove?: (m: APIMessage) => void;
createRenderRoot(): ShadowRoot | Element {
return this;
static get styles(): CSSResult[] {
return COMMON_STYLES;
}
firstUpdated(): void {

View File

@ -1,5 +1,6 @@
import { gettext } from "django";
import { LitElement, html, customElement, TemplateResult, property } from "lit-element";
import { LitElement, html, customElement, TemplateResult, property, CSSResult } from "lit-element";
import { COMMON_STYLES } from "../../common/styles";
import "./Message";
import { APIMessage } from "./Message";
@ -21,8 +22,8 @@ export class MessageContainer extends LitElement {
messageSocket?: WebSocket;
retryDelay = 200;
createRenderRoot(): ShadowRoot | Element {
return this;
static get styles(): CSSResult[] {
return COMMON_STYLES;
}
constructor() {