mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 23:07:20 +00:00
RTL fixes (#12367)
This commit is contained in:
parent
4f13db3178
commit
3b8b6eb315
@ -250,6 +250,18 @@ export class HaComboBox extends LitElement {
|
|||||||
top: -7px;
|
top: -7px;
|
||||||
right: 36px;
|
right: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host-context([style*="direction: rtl;"]) .toggle-button {
|
||||||
|
left: 12px;
|
||||||
|
right: auto;
|
||||||
|
top: -10px;
|
||||||
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) .clear-button {
|
||||||
|
--mdc-icon-size: 20px;
|
||||||
|
top: -7px;
|
||||||
|
left: 36px;
|
||||||
|
right: auto;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,10 @@ export class HaDialog extends DialogBase {
|
|||||||
margin-left: 40px;
|
margin-left: 40px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) .dialog-actions {
|
||||||
|
left: 0px !important;
|
||||||
|
right: auto !important;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Fab } from "@material/mwc-fab";
|
import { Fab } from "@material/mwc-fab";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
|
import { css } from "lit";
|
||||||
|
|
||||||
@customElement("ha-fab")
|
@customElement("ha-fab")
|
||||||
export class HaFab extends Fab {
|
export class HaFab extends Fab {
|
||||||
@ -7,6 +8,17 @@ export class HaFab extends Fab {
|
|||||||
super.firstUpdated(changedProperties);
|
super.firstUpdated(changedProperties);
|
||||||
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)");
|
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static override styles = Fab.styles.concat([
|
||||||
|
css`
|
||||||
|
:host-context([style*="direction: rtl;"])
|
||||||
|
.mdc-fab--extended
|
||||||
|
.mdc-fab__icon {
|
||||||
|
margin-left: 12px !important;
|
||||||
|
margin-right: calc(12px - 20px) !important;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@ -176,10 +176,24 @@ export class HaFileUpload extends LitElement {
|
|||||||
.mdc-text-field__icon--leading {
|
.mdc-text-field__icon--leading {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"])
|
||||||
|
.mdc-text-field__icon--leading {
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
.mdc-text-field--filled .mdc-floating-label--float-above {
|
.mdc-text-field--filled .mdc-floating-label--float-above {
|
||||||
transform: scale(0.75);
|
transform: scale(0.75);
|
||||||
top: 8px;
|
top: 8px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) .mdc-floating-label {
|
||||||
|
left: initial;
|
||||||
|
right: 16px;
|
||||||
|
}
|
||||||
|
:host-context([style*="direction: rtl;"])
|
||||||
|
.mdc-text-field--filled
|
||||||
|
.mdc-floating-label {
|
||||||
|
left: initial;
|
||||||
|
right: 48px;
|
||||||
|
}
|
||||||
.dragged:before {
|
.dragged:before {
|
||||||
position: var(--layout-fit_-_position);
|
position: var(--layout-fit_-_position);
|
||||||
top: var(--layout-fit_-_top);
|
top: var(--layout-fit_-_top);
|
||||||
|
@ -47,6 +47,10 @@ export class HaSelect extends SelectBase {
|
|||||||
.mdc-select__anchor {
|
.mdc-select__anchor {
|
||||||
width: var(--ha-select-min-width, 200px);
|
width: var(--ha-select-min-width, 200px);
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) .mdc-floating-label {
|
||||||
|
right: 16px !important;
|
||||||
|
left: initial !important;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -616,6 +616,10 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
|
|||||||
opacity: var(--light-disabled-opacity);
|
opacity: var(--light-disabled-opacity);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) .mdc-chip__icon {
|
||||||
|
margin-right: -14px !important;
|
||||||
|
margin-left: 4px !important;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,19 @@ export class HaTextField extends TextFieldBase {
|
|||||||
.mdc-text-field {
|
.mdc-text-field {
|
||||||
overflow: var(--text-field-overflow);
|
overflow: var(--text-field-overflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host-context([style*="direction: rtl;"]) .mdc-floating-label {
|
||||||
|
right: 10px !important;
|
||||||
|
left: initial !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host-context([style*="direction: rtl;"])
|
||||||
|
.mdc-text-field--with-leading-icon.mdc-text-field--filled
|
||||||
|
.mdc-floating-label {
|
||||||
|
max-width: calc(100% - 48px);
|
||||||
|
right: 48px !important;
|
||||||
|
left: initial !important;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import { fireEvent, HASSDomEvent } from "../../common/dom/fire_event";
|
import { fireEvent, HASSDomEvent } from "../../common/dom/fire_event";
|
||||||
import { computeRTL } from "../../common/util/compute_rtl";
|
|
||||||
import "../../components/ha-circular-progress";
|
import "../../components/ha-circular-progress";
|
||||||
import "../../components/ha-dialog";
|
import "../../components/ha-dialog";
|
||||||
import "../../components/ha-icon-button";
|
import "../../components/ha-icon-button";
|
||||||
@ -261,7 +260,6 @@ class DataEntryFlowDialog extends LitElement {
|
|||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
.label=${this.hass.localize("ui.common.help")}
|
.label=${this.hass.localize("ui.common.help")}
|
||||||
.path=${mdiHelpCircle}
|
.path=${mdiHelpCircle}
|
||||||
?rtl=${computeRTL(this.hass)}
|
|
||||||
>
|
>
|
||||||
</ha-icon-button
|
</ha-icon-button
|
||||||
></a>
|
></a>
|
||||||
@ -273,7 +271,6 @@ class DataEntryFlowDialog extends LitElement {
|
|||||||
)}
|
)}
|
||||||
.path=${mdiClose}
|
.path=${mdiClose}
|
||||||
dialogAction="close"
|
dialogAction="close"
|
||||||
?rtl=${computeRTL(this.hass)}
|
|
||||||
></ha-icon-button>
|
></ha-icon-button>
|
||||||
</div>
|
</div>
|
||||||
${this._step === null
|
${this._step === null
|
||||||
@ -521,7 +518,7 @@ class DataEntryFlowDialog extends LitElement {
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
.dialog-actions[rtl] {
|
:host-context([style*="direction: rtl;"]) .dialog-actions {
|
||||||
right: auto;
|
right: auto;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
@ -194,6 +194,10 @@ class StepFlowForm extends LitElement {
|
|||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
padding-right: 72px;
|
padding-right: 72px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) h2 {
|
||||||
|
padding-right: auto !important;
|
||||||
|
padding-left: 72px !important;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,10 @@ class StepFlowPickFlow extends LitElement {
|
|||||||
h2 {
|
h2 {
|
||||||
padding-right: 66px;
|
padding-right: 66px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) h2 {
|
||||||
|
padding-right: auto !important;
|
||||||
|
padding-left: 66px !important;
|
||||||
|
}
|
||||||
@media all and (max-height: 900px) {
|
@media all and (max-height: 900px) {
|
||||||
div {
|
div {
|
||||||
max-height: calc(100vh - 134px);
|
max-height: calc(100vh - 134px);
|
||||||
|
@ -313,6 +313,10 @@ class StepFlowPickHandler extends LitElement {
|
|||||||
h2 {
|
h2 {
|
||||||
padding-right: 66px;
|
padding-right: 66px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) h2 {
|
||||||
|
padding-right: auto !important;
|
||||||
|
padding-left: 66px !important;
|
||||||
|
}
|
||||||
@media all and (max-height: 900px) {
|
@media all and (max-height: 900px) {
|
||||||
mwc-list {
|
mwc-list {
|
||||||
max-height: calc(100vh - 134px);
|
max-height: calc(100vh - 134px);
|
||||||
|
@ -414,7 +414,7 @@ export default class HaAutomationActionRow extends LitElement {
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
--mdc-theme-text-primary-on-background: var(--primary-text-color);
|
--mdc-theme-text-primary-on-background: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
.rtl .card-menu {
|
:host-context([style*="direction: rtl;"]) .card-menu {
|
||||||
right: initial;
|
right: initial;
|
||||||
left: 16px;
|
left: 16px;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ export default class HaAutomationConditionRow extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.rtl .card-menu {
|
:host-context([style*="direction: rtl;"]) .card-menu {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
mwc-list-item[disabled] {
|
mwc-list-item[disabled] {
|
||||||
|
@ -442,7 +442,7 @@ export default class HaAutomationTriggerRow extends LitElement {
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
--mdc-theme-text-primary-on-background: var(--primary-text-color);
|
--mdc-theme-text-primary-on-background: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
.rtl .card-menu {
|
:host-context([style*="direction: rtl;"]) .card-menu {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
.triggered {
|
.triggered {
|
||||||
|
@ -143,6 +143,10 @@ export class HaIntegrationHeader extends LitElement {
|
|||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
:host-context([style*="direction: rtl;"]) .header img {
|
||||||
|
margin-right: auto !important;
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
.header .info {
|
.header .info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
|
@ -228,6 +228,7 @@ class DialogSystemLogDetail extends LitElement {
|
|||||||
.contents {
|
.contents {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
direction: ltr;
|
||||||
}
|
}
|
||||||
.error {
|
.error {
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user