diff --git a/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts b/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts index 5ab2ee2613..d7d41c1dea 100644 --- a/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts +++ b/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts @@ -93,134 +93,120 @@ export class HaCardConditionEditor extends LitElement { if (!condition) return nothing; return html` - +

- ${ - this.hass.localize( - `ui.panel.lovelace.editor.condition-editor.condition.${condition.condition}.label` - ) || condition.condition - } + ${this.hass.localize( + `ui.panel.lovelace.editor.condition-editor.condition.${condition.condition}.label` + ) || condition.condition}

- + - - + - - ${this.hass.localize( - "ui.panel.lovelace.editor.condition-editor.test" - )} - - + + ${this.hass.localize( + "ui.panel.lovelace.editor.condition-editor.test" + )} + + - - ${this.hass.localize( - "ui.panel.lovelace.editor.edit_card.edit_ui" - )} - ${ - !this._yamlMode - ? html` - - ` - : `` - } - - - - ${this.hass.localize( - "ui.panel.lovelace.editor.edit_card.edit_yaml" - )} - ${ - this._yamlMode - ? html` - - ` - : `` - } - - -
  • - - - ${this.hass!.localize("ui.common.delete")} - - -
    -
    - ${ - !this._uiAvailable - ? html` - - ${this._uiWarnings!.length > 0 && - this._uiWarnings![0] !== undefined - ? html` - - ` - : nothing} - ${this.hass.localize( - "ui.errors.config.edit_in_yaml_supported" - )} - - ` - : nothing - } -
    - ${ - this._yamlMode + + ${this.hass.localize( + "ui.panel.lovelace.editor.edit_card.edit_ui" + )} + ${!this._yamlMode ? html` - + ` - : html` - ${dynamicElement( - `ha-card-condition-${condition.condition}`, - { - hass: this.hass, - condition: condition, - } - )} + : ``} + + + + ${this.hass.localize( + "ui.panel.lovelace.editor.edit_card.edit_yaml" + )} + ${this._yamlMode + ? html` + ` - } + : ``} + + +
  • + + + ${this.hass!.localize("ui.common.delete")} + + + + ${!this._uiAvailable + ? html` + + ${this._uiWarnings!.length > 0 && + this._uiWarnings![0] !== undefined + ? html` +
      + ${this._uiWarnings!.map( + (warning) => html`
    • ${warning}
    • ` + )} +
    + ` + : nothing} + ${this.hass.localize( + "ui.errors.config.edit_in_yaml_supported" + )} +
    + ` + : nothing} +
    + ${this._yamlMode + ? html` + + ` + : html` + ${dynamicElement(`ha-card-condition-${condition.condition}`, { + hass: this.hass, + condition: condition, + })} + `}
    - ${ - this._testingResult + ${this._testingResult + ? this.hass.localize( + "ui.panel.lovelace.editor.condition-editor.testing_pass" + ) + : this._testingResult === false ? this.hass.localize( - "ui.panel.lovelace.editor.condition-editor.testing_pass" + "ui.panel.lovelace.editor.condition-editor.testing_error" ) - : this._testingResult === false - ? this.hass.localize( - "ui.panel.lovelace.editor.condition-editor.testing_error" - ) - : nothing - } + : nothing}
    - +
    `; } @@ -313,7 +297,6 @@ export class HaCardConditionEditor extends LitElement { ha-button-menu { --mdc-theme-text-primary-on-background: var(--primary-text-color); } - ha-expansion-panel { --expansion-panel-summary-padding: 0 0 0 8px; --expansion-panel-content-padding: 0; @@ -372,6 +355,11 @@ export class HaCardConditionEditor extends LitElement { .testing.pass { background-color: var(--success-color); } + .container { + position: relative; + border-radius: var(--ha-card-border-radius, 12px); + border: 1px solid var(--divider-color); + } `, ]; }