mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Rtl fixes feb23 (#15487)
This commit is contained in:
parent
7adb49c772
commit
658ce80801
@ -3,6 +3,7 @@ import { customElement } from "lit/decorators";
|
|||||||
import "../../../../src/components/ha-tip";
|
import "../../../../src/components/ha-tip";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import { applyThemesOnElement } from "../../../../src/common/dom/apply_themes_on_element";
|
import { applyThemesOnElement } from "../../../../src/common/dom/apply_themes_on_element";
|
||||||
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
|
|
||||||
const tips: (string | TemplateResult)[] = [
|
const tips: (string | TemplateResult)[] = [
|
||||||
"Test tip",
|
"Test tip",
|
||||||
@ -18,7 +19,11 @@ export class DemoHaTip extends LitElement {
|
|||||||
<div class=${mode}>
|
<div class=${mode}>
|
||||||
<ha-card header="ha-tip ${mode} demo">
|
<ha-card header="ha-tip ${mode} demo">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
${tips.map((tip) => html`<ha-tip>${tip}</ha-tip>`)}
|
${tips.map(
|
||||||
|
(tip) => html`<ha-tip .hass=${provideHass(this)}
|
||||||
|
>${tip}</ha-tip
|
||||||
|
>`
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,15 +1,24 @@
|
|||||||
import { mdiLightbulbOutline } from "@mdi/js";
|
import { mdiLightbulbOutline } from "@mdi/js";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { property, customElement } from "lit/decorators";
|
||||||
|
import { HomeAssistant } from "../types";
|
||||||
|
|
||||||
import "./ha-svg-icon";
|
import "./ha-svg-icon";
|
||||||
|
|
||||||
@customElement("ha-tip")
|
@customElement("ha-tip")
|
||||||
class HaTip extends LitElement {
|
class HaTip extends LitElement {
|
||||||
public render() {
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
|
public render(): TemplateResult {
|
||||||
|
if (!this.hass) {
|
||||||
|
return html``;
|
||||||
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-svg-icon .path=${mdiLightbulbOutline}></ha-svg-icon>
|
<ha-svg-icon .path=${mdiLightbulbOutline}></ha-svg-icon>
|
||||||
<span class="prefix">Tip!</span>
|
<span class="prefix"
|
||||||
|
>${this.hass.localize("ui.panel.config.tips.tip")}</span
|
||||||
|
>
|
||||||
<span class="text"><slot></slot></span>
|
<span class="text"><slot></slot></span>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -21,7 +30,10 @@ class HaTip extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
direction: var(--direction);
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
|
margin-inline-start: 2px;
|
||||||
|
margin-inline-end: initial;
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,9 @@ export class QuickBar extends LitElement {
|
|||||||
: ""}
|
: ""}
|
||||||
</mwc-list>
|
</mwc-list>
|
||||||
`}
|
`}
|
||||||
${this._hint ? html`<ha-tip>${this._hint}</ha-tip>` : ""}
|
${this._hint
|
||||||
|
? html`<ha-tip .hass=${this.hass}>${this._hint}</ha-tip>`
|
||||||
|
: ""}
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -333,15 +333,21 @@ export class HaTabsSubpageDataTable extends LitElement {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 2px 2px 2px 8px;
|
padding: 2px 2px 2px 8px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
margin-inline-start: 4px;
|
||||||
|
margin-inline-end: initial;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
cursor: initial;
|
cursor: initial;
|
||||||
|
direction: var(--direction);
|
||||||
}
|
}
|
||||||
.active-filters ha-svg-icon {
|
.active-filters ha-svg-icon {
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
}
|
}
|
||||||
.active-filters mwc-button {
|
.active-filters mwc-button {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
|
margin-inline-start: 8px;
|
||||||
|
margin-inline-end: initial;
|
||||||
|
direction: var(--direction);
|
||||||
}
|
}
|
||||||
.active-filters::before {
|
.active-filters::before {
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
|
@ -275,7 +275,7 @@ class HaConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
)}
|
)}
|
||||||
></ha-config-navigation>
|
></ha-config-navigation>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
<ha-tip>${this._tip}</ha-tip>
|
<ha-tip .hass=${this.hass}>${this._tip}</ha-tip>
|
||||||
</ha-config-section>
|
</ha-config-section>
|
||||||
</ha-app-layout>
|
</ha-app-layout>
|
||||||
`;
|
`;
|
||||||
|
@ -114,6 +114,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
direction: rtl;
|
direction: rtl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host([rtl]) .filters {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
.entities tr {
|
.entities tr {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
@ -190,7 +194,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
|||||||
on-change="entityIdChanged"
|
on-change="entityIdChanged"
|
||||||
allow-custom-entity
|
allow-custom-entity
|
||||||
></ha-entity-picker>
|
></ha-entity-picker>
|
||||||
<ha-tip>[[localize('ui.tips.key_e_hint')]]</ha-tip>
|
<ha-tip hass="[[hass]]">[[localize('ui.tips.key_e_hint')]]</ha-tip>
|
||||||
<ha-textfield
|
<ha-textfield
|
||||||
label="[[localize('ui.panel.developer-tools.tabs.states.state')]]"
|
label="[[localize('ui.panel.developer-tools.tabs.states.state')]]"
|
||||||
required
|
required
|
||||||
|
@ -186,6 +186,9 @@ export class HuiDialogSelectView extends LitElement {
|
|||||||
ha-select {
|
ha-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
mwc-radio-list-item {
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user