mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Use /
This commit is contained in:
parent
7db28c0156
commit
96d375cb84
@ -12,8 +12,9 @@ export class HaFab extends Fab {
|
|||||||
static override styles = Fab.styles.concat([
|
static override styles = Fab.styles.concat([
|
||||||
css`
|
css`
|
||||||
.mdc-fab--extended .mdc-fab__icon {
|
.mdc-fab--extended .mdc-fab__icon {
|
||||||
margin-left: var(--rtl-12px, -8px) !important;
|
margin-inline-start: -8px !important;
|
||||||
margin-right: var(--rtl--8px, 12px) !important;
|
margin-inline-end: 12px !important;
|
||||||
|
direction: var(--direction) !important;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
]);
|
]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { atLeastVersion } from "../common/config/version";
|
import { atLeastVersion } from "../common/config/version";
|
||||||
import { computeLocalize, LocalizeFunc } from "../common/translations/localize";
|
import { computeLocalize, LocalizeFunc } from "../common/translations/localize";
|
||||||
import { computeRTL } from "../common/util/compute_rtl";
|
import { computeRTLDirection } from "../common/util/compute_rtl";
|
||||||
import { debounce } from "../common/util/debounce";
|
import { debounce } from "../common/util/debounce";
|
||||||
import {
|
import {
|
||||||
getHassTranslations,
|
getHassTranslations,
|
||||||
@ -187,18 +187,10 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _applyDirection(hass: HomeAssistant) {
|
private _applyDirection(hass: HomeAssistant) {
|
||||||
if (computeRTL(hass)) {
|
const direction = computeRTLDirection(hass);
|
||||||
this.style.direction = "rtl";
|
this.style.direction = direction;
|
||||||
// apply custom properties used to fix RTL appearance throughout the system
|
document.dir = direction;
|
||||||
this.style.setProperty("--rtl-12px", "12px");
|
this.style.setProperty("--direction", direction);
|
||||||
this.style.setProperty("--rtl--8px", "-8px");
|
|
||||||
this.style.setProperty("--dir", "rtl");
|
|
||||||
} else {
|
|
||||||
// clear all custom properties (can't use "all" for this)
|
|
||||||
this.style.cssText = "";
|
|
||||||
|
|
||||||
this.style.direction = "ltr";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user