Files
2025-06-11 11:19:58 +10:00

16 lines
354 B
TypeScript

// RTL Support
export type HTMLDirection = 'ltr' | 'rtl';
export function isRtlBody(): boolean {
const body = document.getElementsByTagName('body').item(0);
return body?.classList.contains('rtl') || false;
}
export const useHTMLDirection = (): HTMLDirection => (isRtlBody() ? 'rtl' : 'ltr');
export function useIsRtl() {
return isRtlBody();
}