Add ellipsis to ha-button label (#27391)

This commit is contained in:
Wendelin
2025-10-07 15:03:54 +02:00
committed by GitHub
parent ab172abe02
commit 23deab253b
2 changed files with 39 additions and 37 deletions

View File

@@ -223,6 +223,12 @@ export class HaButton extends Button {
.button.has-end { .button.has-end {
padding-inline-end: 8px; padding-inline-end: 8px;
} }
.label {
overflow: hidden;
text-overflow: ellipsis;
padding: var(--ha-space-1) 0;
}
`, `,
]; ];
} }

View File

@@ -770,7 +770,6 @@ export class HaConfigDevicePage extends LitElement {
${firstDeviceAction || actions.length ${firstDeviceAction || actions.length
? html` ? html`
<div class="card-actions" slot="actions"> <div class="card-actions" slot="actions">
<div>
<ha-button <ha-button
href=${ifDefined(firstDeviceAction!.href)} href=${ifDefined(firstDeviceAction!.href)}
rel=${ifDefined( rel=${ifDefined(
@@ -779,9 +778,7 @@ export class HaConfigDevicePage extends LitElement {
appearance="plain" appearance="plain"
target=${ifDefined(firstDeviceAction!.target)} target=${ifDefined(firstDeviceAction!.target)}
class=${ifDefined(firstDeviceAction!.classes)} class=${ifDefined(firstDeviceAction!.classes)}
.variant=${firstDeviceAction!.classes?.includes( .variant=${firstDeviceAction!.classes?.includes("warning")
"warning"
)
? "danger" ? "danger"
: "brand"} : "brand"}
.action=${firstDeviceAction!.action} .action=${firstDeviceAction!.action}
@@ -806,7 +803,6 @@ export class HaConfigDevicePage extends LitElement {
` `
: nothing} : nothing}
</ha-button> </ha-button>
</div>
${actions.length ${actions.length
? html` ? html`