mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Add Option to wrap or scroll section header badges (#24709)
This commit is contained in:
parent
7a617600ad
commit
078209d154
17
public/static/images/form/view_header_badges_wrap_scroll.svg
Normal file
17
public/static/images/form/view_header_badges_wrap_scroll.svg
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<svg width="94" height="24" viewBox="0 0 94 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_1349_5726)">
|
||||||
|
<rect width="94" height="24" rx="8" fill="white"/>
|
||||||
|
<path d="M8 12C8 14.2091 9.79086 16 12 16H16C18.2091 16 20 14.2091 20 12C20 9.79086 18.2091 8 16 8H12C9.79086 8 8 9.79086 8 12Z" fill="black" fill-opacity="0.32"/>
|
||||||
|
<path d="M24.5 13C24.5 14.6569 25.8431 16 27.5 16H33.5C35.1569 16 36.5 14.6569 36.5 13V11C36.5 9.34315 35.1569 8 33.5 8H27.5C25.8431 8 24.5 9.34315 24.5 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M41 13C41 14.6569 42.3431 16 44 16H50C51.6569 16 53 14.6569 53 13V11C53 9.34315 51.6569 8 50 8H44C42.3431 8 41 9.34315 41 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M57.5 13C57.5 14.6569 58.8431 16 60.5 16H66.5C68.1569 16 69.5 14.6569 69.5 13V11C69.5 9.34315 68.1569 8 66.5 8H60.5C58.8431 8 57.5 9.34315 57.5 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M74 13C74 14.6569 75.3431 16 77 16H83C84.6569 16 86 14.6569 86 13V11C86 9.34315 84.6569 8 83 8H77C75.3431 8 74 9.34315 74 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M90 13C90 14.6569 91.3431 16 93 16H99C100.657 16 102 14.6569 102 13V11C102 9.34315 100.657 8 99 8H93C91.3431 8 90 9.34315 90 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
</g>
|
||||||
|
<rect x="0.5" y="0.5" width="93" height="23" rx="7.5" stroke="black" stroke-opacity="0.12" stroke-dasharray="4 4"/>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_1349_5726">
|
||||||
|
<rect width="94" height="24" rx="8" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,17 @@
|
|||||||
|
<svg width="94" height="24" viewBox="0 0 94 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_1349_5798)">
|
||||||
|
<path d="M0 8C0 3.58172 3.58172 0 8 0H86C90.4183 0 94 3.58172 94 8V16C94 20.4183 90.4183 24 86 24H8C3.58172 24 0 20.4183 0 16V8Z" fill="#1C1C1C"/>
|
||||||
|
<path d="M8 12C8 14.2091 9.79086 16 12 16H16C18.2091 16 20 14.2091 20 12C20 9.79086 18.2091 8 16 8H12C9.79086 8 8 9.79086 8 12Z" fill="white" fill-opacity="0.48"/>
|
||||||
|
<path d="M24.5 12C24.5 14.2091 26.2909 16 28.5 16H32.5C34.7091 16 36.5 14.2091 36.5 12C36.5 9.79086 34.7091 8 32.5 8H28.5C26.2909 8 24.5 9.79086 24.5 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M41 12C41 14.2091 42.7909 16 45 16H49C51.2091 16 53 14.2091 53 12C53 9.79086 51.2091 8 49 8H45C42.7909 8 41 9.79086 41 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M57.5 12C57.5 14.2091 59.2909 16 61.5 16H65.5C67.7091 16 69.5 14.2091 69.5 12C69.5 9.79086 67.7091 8 65.5 8H61.5C59.2909 8 57.5 9.79086 57.5 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M74 12C74 14.2091 75.7909 16 78 16H82C84.2091 16 86 14.2091 86 12C86 9.79086 84.2091 8 82 8H78C75.7909 8 74 9.79086 74 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M90 12C90 14.2091 91.7909 16 94 16H98C100.209 16 102 14.2091 102 12V12C102 9.79086 100.209 8 98 8H94C91.7909 8 90 9.79086 90 12V12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
</g>
|
||||||
|
<path d="M1.34748 20.4449C0.772837 19.5866 0.359906 18.6109 0.152272 17.5613L0.642766 17.4643C0.549158 16.9911 0.5 16.5015 0.5 16V14H0V10H0.5V8C0.5 7.49847 0.549158 7.00892 0.642766 6.53574L0.152272 6.4387C0.359906 5.38915 0.772837 4.41341 1.34748 3.55508L1.76296 3.83324C2.31067 3.01513 3.01513 2.31067 3.83323 1.76296L3.55507 1.34748C4.41341 0.772837 5.38915 0.359906 6.4387 0.152272L6.53574 0.642766C7.00892 0.549158 7.49847 0.5 8 0.5H9.94999V0H13.85V0.5H17.75V0H21.65V0.5H25.55V0H29.45V0.5H33.35V0H37.25V0.5H41.15V0H45.05V0.5H48.95V0H52.85V0.5H56.75V0H60.65V0.5H64.55V0H68.45V0.5H72.35V0H76.25V0.5H80.15V0H84.05V0.5H86C86.5015 0.5 86.9911 0.549158 87.4643 0.642766L87.5613 0.152273C88.6108 0.359907 89.5866 0.772837 90.4449 1.34747L90.1668 1.76296C90.9849 2.31067 91.6893 3.01513 92.237 3.83323L92.6525 3.55507C93.2272 4.41341 93.6401 5.38915 93.8477 6.4387L93.3572 6.53574C93.4508 7.00892 93.5 7.49847 93.5 8V10H94V14H93.5V16C93.5 16.5015 93.4508 16.9911 93.3572 17.4643L93.8477 17.5613C93.6401 18.6109 93.2272 19.5866 92.6525 20.4449L92.237 20.1668C91.6893 20.9849 90.9849 21.6893 90.1668 22.237L90.4449 22.6525C89.5866 23.2272 88.6108 23.6401 87.5613 23.8477L87.4643 23.3572C86.9911 23.4508 86.5015 23.5 86 23.5H84.05V24H80.15V23.5H76.25V24H72.35V23.5H68.45V24H64.55V23.5H60.65V24H56.75V23.5H52.85V24H48.95V23.5H45.05V24H41.15V23.5H37.25V24H33.35V23.5H29.45V24H25.55V23.5H21.65V24H17.75V23.5H13.85V24H9.95V23.5H8C7.49847 23.5 7.00892 23.4508 6.53574 23.3572L6.4387 23.8477C5.38915 23.6401 4.41341 23.2272 3.55507 22.6525L3.83323 22.237C3.01513 21.6893 2.31067 20.9849 1.76296 20.1668L1.34748 20.4449Z" stroke="white" stroke-opacity="0.24" stroke-dasharray="4 4"/>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_1349_5798">
|
||||||
|
<path d="M0 8C0 3.58172 3.58172 0 8 0H86C90.4183 0 94 3.58172 94 8V16C94 20.4183 90.4183 24 86 24H8C3.58172 24 0 20.4183 0 16V8Z" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
11
public/static/images/form/view_header_badges_wrap_wrap.svg
Normal file
11
public/static/images/form/view_header_badges_wrap_wrap.svg
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<svg width="94" height="40" viewBox="0 0 94 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="94" height="40" rx="8" fill="white"/>
|
||||||
|
<rect x="0.5" y="0.5" width="93" height="39" rx="7.5" stroke="black" stroke-opacity="0.12" stroke-dasharray="4 4"/>
|
||||||
|
<path d="M8 12C8 14.2091 9.79086 16 12 16H16C18.2091 16 20 14.2091 20 12C20 9.79086 18.2091 8 16 8H12C9.79086 8 8 9.79086 8 12Z" fill="black" fill-opacity="0.32"/>
|
||||||
|
<path d="M24.5 13C24.5 14.6569 25.8431 16 27.5 16H33.5C35.1569 16 36.5 14.6569 36.5 13V11C36.5 9.34315 35.1569 8 33.5 8H27.5C25.8431 8 24.5 9.34315 24.5 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M41 13C41 14.6569 42.3431 16 44 16H50C51.6569 16 53 14.6569 53 13V11C53 9.34315 51.6569 8 50 8H44C42.3431 8 41 9.34315 41 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M57.5 13C57.5 14.6569 58.8431 16 60.5 16H66.5C68.1569 16 69.5 14.6569 69.5 13V11C69.5 9.34315 68.1569 8 66.5 8H60.5C58.8431 8 57.5 9.34315 57.5 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M74 13C74 14.6569 75.3431 16 77 16H83C84.6569 16 86 14.6569 86 13V11C86 9.34315 84.6569 8 83 8H77C75.3431 8 74 9.34315 74 11V13Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M8 29C8 30.6569 9.34315 32 11 32H17C18.6569 32 20 30.6569 20 29V27C20 25.3431 18.6569 24 17 24H11C9.34315 24 8 25.3431 8 27V29Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
<path d="M24.5 29C24.5 30.6569 25.8431 32 27.5 32H33.5C35.1569 32 36.5 30.6569 36.5 29V27C36.5 25.3431 35.1569 24 33.5 24H27.5C25.8431 24 24.5 25.3431 24.5 27V29Z" fill="black" fill-opacity="0.12"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,11 @@
|
|||||||
|
<svg width="94" height="40" viewBox="0 0 94 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M0 8C0 3.58172 3.58172 0 8 0H86C90.4183 0 94 3.58172 94 8V32C94 36.4183 90.4183 40 86 40H8C3.58172 40 0 36.4183 0 32V8Z" fill="#1C1C1C"/>
|
||||||
|
<path d="M1.34748 36.4449C0.772837 35.5866 0.359906 34.6109 0.152272 33.5613L0.642766 33.4643C0.549158 32.9911 0.5 32.5015 0.5 32V30H0V26H0.5V22H0V18H0.5V14H0V10H0.5V8C0.5 7.49847 0.549158 7.00892 0.642766 6.53574L0.152272 6.4387C0.359906 5.38915 0.772837 4.41341 1.34748 3.55508L1.76296 3.83324C2.31067 3.01513 3.01513 2.31067 3.83323 1.76296L3.55507 1.34748C4.41341 0.772837 5.38915 0.359906 6.4387 0.152272L6.53574 0.642766C7.00892 0.549158 7.49847 0.5 8 0.5H9.94999V0H13.85V0.5H17.75V0H21.65V0.5H25.55V0H29.45V0.5H33.35V0H37.25V0.5H41.15V0H45.05V0.5H48.95V0H52.85V0.5H56.75V0H60.65V0.5H64.55V0H68.45V0.5H72.35V0H76.25V0.5H80.15V0H84.05V0.5H86C86.5015 0.5 86.9911 0.549158 87.4643 0.642766L87.5613 0.152273C88.6108 0.359907 89.5866 0.772837 90.4449 1.34747L90.1668 1.76296C90.9849 2.31067 91.6893 3.01513 92.237 3.83323L92.6525 3.55507C93.2272 4.41341 93.6401 5.38915 93.8477 6.4387L93.3572 6.53574C93.4508 7.00892 93.5 7.49847 93.5 8V10H94V14H93.5V18H94V22H93.5V26H94V30H93.5V32C93.5 32.5015 93.4508 32.9911 93.3572 33.4643L93.8477 33.5613C93.6401 34.6109 93.2272 35.5866 92.6525 36.4449L92.237 36.1668C91.6893 36.9849 90.9849 37.6893 90.1668 38.237L90.4449 38.6525C89.5866 39.2272 88.6108 39.6401 87.5613 39.8477L87.4643 39.3572C86.9911 39.4508 86.5015 39.5 86 39.5H84.05V40H80.15V39.5H76.25V40H72.35V39.5H68.45V40H64.55V39.5H60.65V40H56.75V39.5H52.85V40H48.95V39.5H45.05V40H41.15V39.5H37.25V40H33.35V39.5H29.45V40H25.55V39.5H21.65V40H17.75V39.5H13.85V40H9.95V39.5H8C7.49847 39.5 7.00892 39.4508 6.53574 39.3572L6.4387 39.8477C5.38915 39.6401 4.41341 39.2272 3.55508 38.6525L3.83323 38.237C3.01513 37.6893 2.31067 36.9849 1.76296 36.1668L1.34748 36.4449Z" stroke="white" stroke-opacity="0.24" stroke-dasharray="4 4"/>
|
||||||
|
<path d="M8 12C8 14.2091 9.79086 16 12 16H16C18.2091 16 20 14.2091 20 12C20 9.79086 18.2091 8 16 8H12C9.79086 8 8 9.79086 8 12Z" fill="white" fill-opacity="0.48"/>
|
||||||
|
<path d="M24.5 12C24.5 14.2091 26.2909 16 28.5 16H32.5C34.7091 16 36.5 14.2091 36.5 12C36.5 9.79086 34.7091 8 32.5 8H28.5C26.2909 8 24.5 9.79086 24.5 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M41 12C41 14.2091 42.7909 16 45 16H49C51.2091 16 53 14.2091 53 12C53 9.79086 51.2091 8 49 8H45C42.7909 8 41 9.79086 41 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M57.5 12C57.5 14.2091 59.2909 16 61.5 16H65.5C67.7091 16 69.5 14.2091 69.5 12C69.5 9.79086 67.7091 8 65.5 8H61.5C59.2909 8 57.5 9.79086 57.5 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M74 12C74 14.2091 75.7909 16 78 16H82C84.2091 16 86 14.2091 86 12C86 9.79086 84.2091 8 82 8H78C75.7909 8 74 9.79086 74 12Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M8 28C8 30.2091 9.79086 32 12 32H16C18.2091 32 20 30.2091 20 28C20 25.7909 18.2091 24 16 24H12C9.79086 24 8 25.7909 8 28Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
<path d="M24.5 28C24.5 30.2091 26.2909 32 28.5 32H32.5C34.7091 32 36.5 30.2091 36.5 28C36.5 25.7909 34.7091 24 32.5 24H28.5C26.2909 24 24.5 25.7909 24.5 28Z" fill="white" fill-opacity="0.24"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
@ -29,6 +29,7 @@ export interface LovelaceViewHeaderConfig {
|
|||||||
card?: LovelaceCardConfig;
|
card?: LovelaceCardConfig;
|
||||||
layout?: "start" | "center" | "responsive";
|
layout?: "start" | "center" | "responsive";
|
||||||
badges_position?: "bottom" | "top";
|
badges_position?: "bottom" | "top";
|
||||||
|
badges_wrap?: "wrap" | "scroll";
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LovelaceBaseViewConfig {
|
export interface LovelaceBaseViewConfig {
|
||||||
|
@ -206,6 +206,14 @@ export class HuiViewBadges extends LitElement {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.badges > * {
|
||||||
|
min-width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badges > *:last-child:not(.add) {
|
||||||
|
padding-right: var(--badges-padding-right, 0);
|
||||||
|
}
|
||||||
|
|
||||||
hui-badge-edit-mode {
|
hui-badge-edit-mode {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -16,6 +16,7 @@ import type {
|
|||||||
import type { HomeAssistant } from "../../../../types";
|
import type { HomeAssistant } from "../../../../types";
|
||||||
import {
|
import {
|
||||||
DEFAULT_VIEW_HEADER_BADGES_POSITION,
|
DEFAULT_VIEW_HEADER_BADGES_POSITION,
|
||||||
|
DEFAULT_VIEW_HEADER_BADGES_WRAP,
|
||||||
DEFAULT_VIEW_HEADER_LAYOUT,
|
DEFAULT_VIEW_HEADER_LAYOUT,
|
||||||
} from "../../views/hui-view-header";
|
} from "../../views/hui-view-header";
|
||||||
import { listenMediaQuery } from "../../../../common/dom/media_query";
|
import { listenMediaQuery } from "../../../../common/dom/media_query";
|
||||||
@ -92,6 +93,30 @@ export class HuiViewHeaderSettingsEditor extends LitElement {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "badges_wrap",
|
||||||
|
selector: {
|
||||||
|
select: {
|
||||||
|
mode: "box",
|
||||||
|
options: ["wrap", "scroll"].map((value) => ({
|
||||||
|
value,
|
||||||
|
label: localize(
|
||||||
|
`ui.panel.lovelace.editor.edit_view_header.settings.badges_wrap_options.${value}`
|
||||||
|
),
|
||||||
|
...(value === "scroll" && {
|
||||||
|
description: localize(
|
||||||
|
`ui.panel.lovelace.editor.edit_view_header.settings.badges_wrap_options.${value}_description`
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
image: {
|
||||||
|
src: `/static/images/form/view_header_badges_wrap_${value}.svg`,
|
||||||
|
src_dark: `/static/images/form/view_header_badges_wrap_${value}_dark.svg`,
|
||||||
|
flip_rtl: true,
|
||||||
|
},
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
] as const satisfies HaFormSchema[]
|
] as const satisfies HaFormSchema[]
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -104,6 +129,7 @@ export class HuiViewHeaderSettingsEditor extends LitElement {
|
|||||||
layout: this.config?.layout || DEFAULT_VIEW_HEADER_LAYOUT,
|
layout: this.config?.layout || DEFAULT_VIEW_HEADER_LAYOUT,
|
||||||
badges_position:
|
badges_position:
|
||||||
this.config?.badges_position || DEFAULT_VIEW_HEADER_BADGES_POSITION,
|
this.config?.badges_position || DEFAULT_VIEW_HEADER_BADGES_POSITION,
|
||||||
|
badges_wrap: this.config?.badges_wrap || DEFAULT_VIEW_HEADER_BADGES_WRAP,
|
||||||
};
|
};
|
||||||
|
|
||||||
const narrow = this.narrow;
|
const narrow = this.narrow;
|
||||||
@ -139,6 +165,7 @@ export class HuiViewHeaderSettingsEditor extends LitElement {
|
|||||||
switch (schema.name) {
|
switch (schema.name) {
|
||||||
case "layout":
|
case "layout":
|
||||||
case "badges_position":
|
case "badges_position":
|
||||||
|
case "badges_wrap":
|
||||||
return this.hass.localize(
|
return this.hass.localize(
|
||||||
`ui.panel.lovelace.editor.edit_view_header.settings.${schema.name}`
|
`ui.panel.lovelace.editor.edit_view_header.settings.${schema.name}`
|
||||||
);
|
);
|
||||||
|
@ -23,6 +23,7 @@ import { showEditCardDialog } from "../editor/card-editor/show-edit-card-dialog"
|
|||||||
|
|
||||||
export const DEFAULT_VIEW_HEADER_LAYOUT = "center";
|
export const DEFAULT_VIEW_HEADER_LAYOUT = "center";
|
||||||
export const DEFAULT_VIEW_HEADER_BADGES_POSITION = "bottom";
|
export const DEFAULT_VIEW_HEADER_BADGES_POSITION = "bottom";
|
||||||
|
export const DEFAULT_VIEW_HEADER_BADGES_WRAP = "wrap";
|
||||||
|
|
||||||
@customElement("hui-view-header")
|
@customElement("hui-view-header")
|
||||||
export class HuiViewHeader extends LitElement {
|
export class HuiViewHeader extends LitElement {
|
||||||
@ -188,6 +189,8 @@ export class HuiViewHeader extends LitElement {
|
|||||||
const layout = this.config?.layout ?? DEFAULT_VIEW_HEADER_LAYOUT;
|
const layout = this.config?.layout ?? DEFAULT_VIEW_HEADER_LAYOUT;
|
||||||
const badgesPosition =
|
const badgesPosition =
|
||||||
this.config?.badges_position ?? DEFAULT_VIEW_HEADER_BADGES_POSITION;
|
this.config?.badges_position ?? DEFAULT_VIEW_HEADER_BADGES_POSITION;
|
||||||
|
const badgesWrap =
|
||||||
|
this.config?.badges_wrap ?? DEFAULT_VIEW_HEADER_BADGES_WRAP;
|
||||||
|
|
||||||
const hasHeading = card !== undefined;
|
const hasHeading = card !== undefined;
|
||||||
const hasBadges = this.badges.length > 0;
|
const hasBadges = this.badges.length > 0;
|
||||||
@ -211,6 +214,7 @@ export class HuiViewHeader extends LitElement {
|
|||||||
class="layout ${classMap({
|
class="layout ${classMap({
|
||||||
[layout]: true,
|
[layout]: true,
|
||||||
[`badges-${badgesPosition}`]: true,
|
[`badges-${badgesPosition}`]: true,
|
||||||
|
[`badges-${badgesWrap}`]: true,
|
||||||
"has-heading": hasHeading,
|
"has-heading": hasHeading,
|
||||||
"has-badges": hasBadges,
|
"has-badges": hasBadges,
|
||||||
})}"
|
})}"
|
||||||
@ -248,7 +252,7 @@ export class HuiViewHeader extends LitElement {
|
|||||||
: nothing}
|
: nothing}
|
||||||
${this.lovelace && (editMode || this.badges.length > 0)
|
${this.lovelace && (editMode || this.badges.length > 0)
|
||||||
? html`
|
? html`
|
||||||
<div class="badges ${badgesPosition}">
|
<div class="badges ${badgesPosition} ${badgesWrap}">
|
||||||
<hui-view-badges
|
<hui-view-badges
|
||||||
.badges=${this.badges}
|
.badges=${this.badges}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -334,6 +338,21 @@ export class HuiViewHeader extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container:not(.edit-mode) .badges.scroll {
|
||||||
|
overflow: auto;
|
||||||
|
max-width: calc(100% - 16px);
|
||||||
|
scrollbar-color: var(--scrollbar-thumb-color) transparent;
|
||||||
|
scrollbar-width: none;
|
||||||
|
mask-image: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
transparent 0%,
|
||||||
|
black 16px,
|
||||||
|
black calc(100% - 16px),
|
||||||
|
transparent 100%
|
||||||
|
);
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
hui-view-badges {
|
hui-view-badges {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -366,11 +385,32 @@ export class HuiViewHeader extends LitElement {
|
|||||||
--badges-aligmnent: center;
|
--badges-aligmnent: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container:not(.edit-mode) .layout.badges-scroll hui-view-badges {
|
||||||
|
--badges-wrap: nowrap;
|
||||||
|
--badges-aligmnent: flex-start;
|
||||||
|
--badges-padding-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:not(.edit-mode) .layout.center.badges-scroll hui-view-badges {
|
||||||
|
--badges-aligmnent: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.layout.responsive.has-heading {
|
.layout.responsive.has-heading {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
.layout.responsive.has-heading .badges.scroll {
|
||||||
|
mask-image: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.container:not(.edit-mode)
|
||||||
|
.layout.responsive.badges-scroll.has-heading
|
||||||
|
hui-view-badges {
|
||||||
|
--badges-wrap: wrap;
|
||||||
|
--badges-aligmnent: flex-end;
|
||||||
|
--badges-padding-right: 0;
|
||||||
|
}
|
||||||
.layout.responsive.has-heading hui-view-badges {
|
.layout.responsive.has-heading hui-view-badges {
|
||||||
--badges-aligmnent: flex-end;
|
--badges-aligmnent: flex-end;
|
||||||
}
|
}
|
||||||
|
@ -6807,6 +6807,12 @@
|
|||||||
"badges_position_options": {
|
"badges_position_options": {
|
||||||
"top": "Top",
|
"top": "Top",
|
||||||
"bottom": "Bottom"
|
"bottom": "Bottom"
|
||||||
|
},
|
||||||
|
"badges_wrap": "Badges behaviour",
|
||||||
|
"badges_wrap_options": {
|
||||||
|
"wrap": "Wrap",
|
||||||
|
"scroll": "Scroll",
|
||||||
|
"scroll_description": "Touchscreen-friendly"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user