export type Insets = { top: number; right: number; bottom: number; left: number };

export function applySafeAreaToRoot(insets: Partial<Insets>, root: HTMLElement = document.documentElement) {
    if (typeof insets.top === "number") root.style.setProperty("--safe-top", `${insets.top}px`);
    if (typeof insets.right === "number") root.style.setProperty("--safe-right", `${insets.right}px`);
    if (typeof insets.bottom === "number") root.style.setProperty("--safe-bottom", `${insets.bottom}px`);
    if (typeof insets.left === "number") root.style.setProperty("--safe-left", `${insets.left}px`);
}
