Improve background-editor background-attachment alignment (#23615)

This commit is contained in:
Wendelin 2025-01-07 14:48:28 +01:00 committed by GitHub
parent e137e695ec
commit 6e90afc5bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 2 deletions

View File

@ -75,8 +75,10 @@ export class HaButtonToggleGroup extends LitElement {
direction: ltr; direction: ltr;
} }
mwc-button { mwc-button {
flex: 1;
--mdc-shape-small: 0; --mdc-shape-small: 0;
--mdc-button-outline-width: 1px 0 1px 1px; --mdc-button-outline-width: 1px 0 1px 1px;
--mdc-button-outline-color: var(--primary-color);
} }
ha-icon-button { ha-icon-button {
border: 1px solid var(--primary-color); border: 1px solid var(--primary-color);
@ -94,7 +96,7 @@ export class HaButtonToggleGroup extends LitElement {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
background-color: currentColor; background-color: var(--primary-color);
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
content: ""; content: "";
@ -104,12 +106,22 @@ export class HaButtonToggleGroup extends LitElement {
} }
ha-icon-button[active]::before, ha-icon-button[active]::before,
mwc-button[active]::before { mwc-button[active]::before {
opacity: var(--mdc-icon-button-ripple-opacity, 0.12); opacity: 1;
}
ha-icon-button[active] {
--icon-primary-color: var(--text-primary-color);
}
mwc-button[active] {
--mdc-theme-primary: var(--text-primary-color);
} }
ha-icon-button:first-child, ha-icon-button:first-child,
mwc-button:first-child { mwc-button:first-child {
--mdc-shape-small: 4px 0 0 4px; --mdc-shape-small: 4px 0 0 4px;
border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;
--mdc-button-outline-width: 1px;
}
mwc-button:first-child::before {
border-radius: 4px 0 0 4px;
} }
ha-icon-button:last-child, ha-icon-button:last-child,
mwc-button:last-child { mwc-button:last-child {
@ -118,6 +130,9 @@ export class HaButtonToggleGroup extends LitElement {
--mdc-shape-small: 0 4px 4px 0; --mdc-shape-small: 0 4px 4px 0;
--mdc-button-outline-width: 1px; --mdc-button-outline-width: 1px;
} }
mwc-button:last-child::before {
border-radius: 0 4px 4px 0;
}
ha-icon-button:only-child, ha-icon-button:only-child,
mwc-button:only-child { mwc-button:only-child {
--mdc-shape-small: 4px; --mdc-shape-small: 4px;

View File

@ -87,6 +87,16 @@ export class HaButtonToggleSelector extends LitElement {
static styles = css` static styles = css`
:host { :host {
position: relative; position: relative;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
align-items: center;
}
@media all and (max-width: 600px) {
ha-button-toggle-group {
flex: 1;
}
} }
`; `;
} }

View File

@ -54,6 +54,7 @@ export class HuiViewBackgroundEditor extends LitElement {
}, },
{ {
name: "size", name: "size",
required: true,
selector: { selector: {
select: { select: {
translation_key: translation_key:
@ -65,6 +66,7 @@ export class HuiViewBackgroundEditor extends LitElement {
}, },
{ {
name: "alignment", name: "alignment",
required: true,
selector: { selector: {
select: { select: {
translation_key: translation_key:
@ -86,6 +88,7 @@ export class HuiViewBackgroundEditor extends LitElement {
}, },
{ {
name: "repeat", name: "repeat",
required: true,
selector: { selector: {
select: { select: {
translation_key: translation_key: