mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-18 07:56:44 +01:00
Fix stack card scrollbar clipping box-shadows (#30346)
* Fix stack card scrollbar clipping box-shadows * Remove grid options * Remove scrollbar
This commit is contained in:
committed by
Bram Kragten
parent
1a62c7296c
commit
7e085d9b08
@@ -2,18 +2,13 @@ import { LitElement, css, html, nothing } from "lit";
|
|||||||
import { property, state } from "lit/decorators";
|
import { property, state } from "lit/decorators";
|
||||||
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
||||||
import type { LovelaceCardConfig } from "../../../data/lovelace/config/card";
|
import type { LovelaceCardConfig } from "../../../data/lovelace/config/card";
|
||||||
import { haStyleScrollbar } from "../../../resources/styles";
|
|
||||||
import type { HomeAssistant } from "../../../types";
|
import type { HomeAssistant } from "../../../types";
|
||||||
import type {
|
import { createErrorCardElement } from "../create-element/create-element-base";
|
||||||
LovelaceCard,
|
import type { LovelaceCard, LovelaceCardEditor } from "../types";
|
||||||
LovelaceCardEditor,
|
|
||||||
LovelaceGridOptions,
|
|
||||||
} from "../types";
|
|
||||||
import "./hui-card";
|
import "./hui-card";
|
||||||
import type { HuiCard } from "./hui-card";
|
import type { HuiCard } from "./hui-card";
|
||||||
import type { StackCardConfig } from "./types";
|
|
||||||
import { createErrorCardElement } from "../create-element/create-element-base";
|
|
||||||
import type { HuiErrorCard } from "./hui-error-card";
|
import type { HuiErrorCard } from "./hui-error-card";
|
||||||
|
import type { StackCardConfig } from "./types";
|
||||||
|
|
||||||
export abstract class HuiStackCard<T extends StackCardConfig = StackCardConfig>
|
export abstract class HuiStackCard<T extends StackCardConfig = StackCardConfig>
|
||||||
extends LitElement
|
extends LitElement
|
||||||
@@ -44,14 +39,6 @@ export abstract class HuiStackCard<T extends StackCardConfig = StackCardConfig>
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getGridOptions(): LovelaceGridOptions {
|
|
||||||
return {
|
|
||||||
columns: 12,
|
|
||||||
rows: "auto",
|
|
||||||
min_columns: 3,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public setConfig(config: T): void {
|
public setConfig(config: T): void {
|
||||||
if (!config || !config.cards || !Array.isArray(config.cards)) {
|
if (!config || !config.cards || !Array.isArray(config.cards)) {
|
||||||
throw new Error("Invalid configuration");
|
throw new Error("Invalid configuration");
|
||||||
@@ -117,11 +104,7 @@ export abstract class HuiStackCard<T extends StackCardConfig = StackCardConfig>
|
|||||||
${this._config.title
|
${this._config.title
|
||||||
? html`<h1 class="card-header">${this._config.title}</h1>`
|
? html`<h1 class="card-header">${this._config.title}</h1>`
|
||||||
: ""}
|
: ""}
|
||||||
<div
|
<div id="root" dir=${this.hass ? computeRTLDirection(this.hass) : "ltr"}>
|
||||||
id="root"
|
|
||||||
class="ha-scrollbar"
|
|
||||||
dir=${this.hass ? computeRTLDirection(this.hass) : "ltr"}
|
|
||||||
>
|
|
||||||
${this._cards}
|
${this._cards}
|
||||||
${this.preview && this._errorCard ? this._errorCard : nothing}
|
${this.preview && this._errorCard ? this._errorCard : nothing}
|
||||||
</div>
|
</div>
|
||||||
@@ -129,7 +112,6 @@ export abstract class HuiStackCard<T extends StackCardConfig = StackCardConfig>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static sharedStyles = [
|
static sharedStyles = [
|
||||||
haStyleScrollbar,
|
|
||||||
css`
|
css`
|
||||||
.card-header {
|
.card-header {
|
||||||
color: var(--ha-card-header-color, var(--primary-text-color));
|
color: var(--ha-card-header-color, var(--primary-text-color));
|
||||||
|
|||||||
Reference in New Issue
Block a user