Skip to content
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

Various RTL fixes #19134

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/ha-check-list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export class HaCheckListItem extends CheckListItemBase {
}
.mdc-deprecated-list-item__meta {
flex-shrink: 0;
direction: var(--direction);
margin-inline-start: auto;
margin-inline-end: 0;
}
.mdc-deprecated-list-item__graphic {
margin-top: var(--check-list-item-graphic-margin-top);
Expand Down
13 changes: 11 additions & 2 deletions src/components/ha-list-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export class HaListItem extends ListItemBase {
--mdc-list-item-graphic-margin,
16px
) !important;
direction: var(--direction);
direction: var(--direction) !important;
}
span.material-icons:last-of-type {
margin-inline-start: auto !important;
margin-inline-end: 0px !important;
direction: var(--direction);
direction: var(--direction) !important;
}
.mdc-deprecated-list-item__meta {
display: var(--mdc-list-item-meta-display);
Expand Down Expand Up @@ -85,6 +85,15 @@ export class HaListItem extends ListItemBase {
pointer-events: unset;
}
`,
// safari workaround - must be explicit
document.dir === "rtl"
? css`
span.material-icons:first-of-type,
span.material-icons:last-of-type {
direction: rtl !important;
}
`
: css``,
];
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/components/ha-settings-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export class HaSettingsRow extends LitElement {
align-items: center;
}
.body {
padding: 8px 16px 8px 0;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 0;
padding-inline-start: 0;
padding-right: 16x;
padding-inline-end: 16px;
overflow: hidden;
display: var(--layout-vertical_-_display);
flex-direction: var(--layout-vertical_-_flex-direction);
Expand Down
4 changes: 4 additions & 0 deletions src/components/ha-two-pane-top-app-bar-fixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ export abstract class TopAppBarBaseBase extends BaseElement {
}
#title {
border-right: 1px solid rgba(255, 255, 255, 0.12);
border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
border-inline-start: initial;
box-sizing: border-box;
flex: 0 0 var(--sidepane-width, 250px);
width: var(--sidepane-width, 250px);
Expand All @@ -290,6 +292,8 @@ export abstract class TopAppBarBaseBase extends BaseElement {
}
.pane {
border-right: 1px solid var(--divider-color);
border-inline-end: 1px solid var(--divider-color);
border-inline-start: initial;
box-sizing: border-box;
display: flex;
flex: 0 0 var(--sidepane-width, 250px);
Expand Down
11 changes: 8 additions & 3 deletions src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,12 @@ export class HaVoiceCommandDialog extends LitElement {
ha-button-menu {
--mdc-theme-on-primary: var(--text-primary-color);
--mdc-theme-primary: var(--primary-color);
margin: -8px 0 0 -8px;
margin-top: -8px;
margin-bottom: 0;
margin-right: 0;
margin-inline-end: 0;
margin-left: -8px;
margin-inline-start: -8px;
}
ha-button-menu ha-button {
--mdc-theme-primary: var(--secondary-text-color);
Expand All @@ -689,7 +694,7 @@ export class HaVoiceCommandDialog extends LitElement {
height: 28px;
margin-left: 4px;
margin-inline-start: 4px;
margin-inline-end: 4px;
margin-inline-end: initial;
direction: var(--direction);
}
ha-list-item {
Expand All @@ -698,7 +703,7 @@ export class HaVoiceCommandDialog extends LitElement {
ha-list-item ha-svg-icon {
margin-left: 4px;
margin-inline-start: 4px;
margin-inline-end: 4px;
margin-inline-end: initial;
direction: var(--direction);
display: block;
}
Expand Down
5 changes: 5 additions & 0 deletions src/panels/lovelace/cards/hui-todo-list-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ export class HuiTodoListCard extends LitElement implements LovelaceCard {
.addRow ha-icon-button {
position: absolute;
right: 16px;
inset-inline-start: initial;
inset-inline-end: 16px;
}

.addRow,
Expand All @@ -636,8 +638,11 @@ export class HuiTodoListCard extends LitElement implements LovelaceCard {
.header {
padding-left: 30px;
padding-right: 16px;
padding-inline-start: 30px;
padding-inline-end: 16px;
margin-top: 8px;
justify-content: space-between;
direction: var(--direction);
}

.header span {
Expand Down
12 changes: 11 additions & 1 deletion src/panels/lovelace/cards/hui-weather-forecast-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
align-items: center;
min-width: 64px;
margin-right: 16px;
margin-inline-end: 16px;
margin-inline-start: initial;
}

.icon-image > * {
Expand All @@ -505,7 +507,7 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
}

.temp-attribute {
text-align: right;
text-align: var(--float-end);
}

.temp-attribute .temp {
Expand Down Expand Up @@ -535,6 +537,8 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
.name-state {
overflow: hidden;
padding-right: 12px;
padding-inline-end: 12px;
padding-inline-start: initial;
width: 100%;
}

Expand Down Expand Up @@ -634,6 +638,8 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {

:host([narrow]) .temp-attribute .temp {
margin-right: 16px;
margin-inline-end: 16px;
margin-inline-start: initial;
}

:host([narrow]) .temp span {
Expand All @@ -655,6 +661,8 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {

:host([veryNarrow]) .name-state {
padding-right: 0;
padding-inline-end: 0;
padding-inline-start: initial;
}

/* ============= VERY VERY NARROW ============= */
Expand All @@ -672,6 +680,8 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {

:host([veryVeryNarrow]) .icon-image {
margin-right: 0;
margin-inline-end: 0;
margin-inline-start: initial;
}
`,
];
Expand Down
Loading