mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix dark main-content and split gallery demo (#10675)
This commit is contained in:
parent
45efee28b8
commit
4719636176
@ -1,8 +1,10 @@
|
|||||||
import "../../../src/components/ha-logo-svg";
|
import "@material/mwc-button/mwc-button";
|
||||||
import { html, css, LitElement, TemplateResult } from "lit";
|
import { css, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
|
import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element";
|
||||||
import "../../../src/components/ha-alert";
|
import "../../../src/components/ha-alert";
|
||||||
import "../../../src/components/ha-card";
|
import "../../../src/components/ha-card";
|
||||||
|
import "../../../src/components/ha-logo-svg";
|
||||||
|
|
||||||
const alerts: {
|
const alerts: {
|
||||||
title?: string;
|
title?: string;
|
||||||
@ -130,7 +132,10 @@ const alerts: {
|
|||||||
export class DemoHaAlert extends LitElement {
|
export class DemoHaAlert extends LitElement {
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<ha-card header="ha-alert demo">
|
${["light", "dark"].map(
|
||||||
|
(mode) => html`
|
||||||
|
<div class=${mode}>
|
||||||
|
<ha-card header="ha-alert ${mode} demo">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
${alerts.map(
|
${alerts.map(
|
||||||
(alert) => html`
|
(alert) => html`
|
||||||
@ -146,13 +151,41 @@ export class DemoHaAlert extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
)}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstUpdated(changedProps) {
|
||||||
|
super.firstUpdated(changedProps);
|
||||||
|
applyThemesOnElement(
|
||||||
|
this.shadowRoot!.querySelector(".dark"),
|
||||||
|
{
|
||||||
|
default_theme: "default",
|
||||||
|
default_dark_theme: "default",
|
||||||
|
themes: {},
|
||||||
|
darkMode: false,
|
||||||
|
},
|
||||||
|
"default",
|
||||||
|
{ dark: true }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static get styles() {
|
static get styles() {
|
||||||
return css`
|
return css`
|
||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.dark,
|
||||||
|
.light {
|
||||||
|
display: block;
|
||||||
|
background-color: var(--primary-background-color);
|
||||||
|
padding: 0 50px;
|
||||||
|
}
|
||||||
ha-card {
|
ha-card {
|
||||||
max-width: 600px;
|
|
||||||
margin: 24px auto;
|
margin: 24px auto;
|
||||||
}
|
}
|
||||||
ha-alert {
|
ha-alert {
|
||||||
|
@ -113,9 +113,9 @@ class HaAlert extends LitElement {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
.action {
|
.action {
|
||||||
|
z-index: 1;
|
||||||
width: min-content;
|
width: min-content;
|
||||||
--mdc-theme-primary: var(--primary-text-color);
|
--mdc-theme-primary: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user