-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Rtl changes #12693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rtl changes #12693
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ import { styles } from "@material/mwc-dialog/mwc-dialog.css"; | |
| import { mdiClose } from "@mdi/js"; | ||
| import { css, html, TemplateResult } from "lit"; | ||
| import { customElement } from "lit/decorators"; | ||
| import { computeRTLDirection } from "../common/util/compute_rtl"; | ||
| import type { HomeAssistant } from "../types"; | ||
| import "./ha-icon-button"; | ||
|
|
||
|
|
@@ -17,7 +16,6 @@ export const createCloseHeading = ( | |
| .path=${mdiClose} | ||
| dialogAction="close" | ||
| class="header_button" | ||
| dir=${computeRTLDirection(hass)} | ||
| ></ha-icon-button> | ||
| `; | ||
|
|
||
|
|
@@ -89,18 +87,18 @@ export class HaDialog extends DialogBase { | |
| } | ||
| .header_title { | ||
| margin-right: 40px; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep this line
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Done |
||
| margin-inline-end: 40px; | ||
| direction: var(--direction); | ||
| } | ||
| [dir="rtl"].header_button { | ||
| right: auto; | ||
| left: 16px; | ||
| } | ||
| [dir="rtl"].header_title { | ||
| margin-left: 40px; | ||
| margin-right: 0px; | ||
| .header_button { | ||
| inset-inline-start: initial; | ||
| inset-inline-end: 16px; | ||
| direction: var(--direction); | ||
| } | ||
| :host-context([style*="direction: rtl;"]) .dialog-actions { | ||
| left: 0px !important; | ||
| right: auto !important; | ||
| .dialog-actions { | ||
| inset-inline-start: initial !important; | ||
| inset-inline-end: 0px !important; | ||
| direction: var(--direction); | ||
| } | ||
| `, | ||
| ]; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,24 +175,23 @@ export class HaFileUpload extends LitElement { | |
| } | ||
| .mdc-text-field__icon--leading { | ||
| margin-bottom: 12px; | ||
| } | ||
| :host-context([style*="direction: rtl;"]) | ||
| .mdc-text-field__icon--leading { | ||
| margin-right: 0px; | ||
| inset-inline-start: initial; | ||
| inset-inline-end: 0px; | ||
| direction: var(--direction); | ||
| } | ||
| .mdc-text-field--filled .mdc-floating-label--float-above { | ||
| transform: scale(0.75); | ||
| top: 8px; | ||
| } | ||
| :host-context([style*="direction: rtl;"]) .mdc-floating-label { | ||
| left: initial; | ||
| right: 16px; | ||
| .mdc-floating-label { | ||
| inset-inline-start: 16px !important; | ||
| inset-inline-end: initial !important; | ||
|
Comment on lines
+187
to
+188
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need important?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes otherwise overruled by:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| direction: var(--direction); | ||
| } | ||
| :host-context([style*="direction: rtl;"]) | ||
| .mdc-text-field--filled | ||
| .mdc-floating-label { | ||
| left: initial; | ||
| right: 48px; | ||
| .mdc-text-field--filled .mdc-floating-label { | ||
| inset-inline-start: 48px !important; | ||
| inset-inline-end: initial !important; | ||
| direction: var(--direction); | ||
| } | ||
| .dragged:before { | ||
| position: var(--layout-fit_-_position); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -460,17 +460,13 @@ export default class HaAutomationActionRow extends LitElement { | |
| border-top-left-radius: var(--ha-card-border-radius); | ||
| } | ||
| .card-menu { | ||
| float: right; | ||
| float: var(--float-end, right); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| z-index: 3; | ||
| margin: 4px; | ||
| --mdc-theme-text-primary-on-background: var(--primary-text-color); | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
| :host-context([style*="direction: rtl;"]) .card-menu { | ||
| right: initial; | ||
| left: 16px; | ||
| } | ||
| mwc-list-item[disabled] { | ||
| --mdc-theme-text-primary-on-background: var(--disabled-text-color); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -288,16 +288,13 @@ export default class HaAutomationConditionRow extends LitElement { | |
| border-top-left-radius: var(--ha-card-border-radius); | ||
| } | ||
| .card-menu { | ||
| float: right; | ||
| float: var(--float-end, right); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| z-index: 3; | ||
| margin: 4px; | ||
| --mdc-theme-text-primary-on-background: var(--primary-text-color); | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
| :host-context([style*="direction: rtl;"]) .card-menu { | ||
| float: left; | ||
| } | ||
| mwc-list-item[disabled] { | ||
| --mdc-theme-text-primary-on-background: var(--disabled-text-color); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -487,16 +487,13 @@ export default class HaAutomationTriggerRow extends LitElement { | |
| border-top-left-radius: var(--ha-card-border-radius); | ||
| } | ||
| .card-menu { | ||
| float: right; | ||
| float: var(--float-end, right); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| z-index: 3; | ||
| margin: 4px; | ||
| --mdc-theme-text-primary-on-background: var(--primary-text-color); | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
| :host-context([style*="direction: rtl;"]) .card-menu { | ||
| float: left; | ||
| } | ||
| .triggered { | ||
| cursor: pointer; | ||
| position: absolute; | ||
|
|
||



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need important?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because otherwise margin-right overwrites it with 16 from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should try to use the exact same selector used as you want to override, then you dont need important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done