Files
openchamber-android-native/third_party/mygo/packages/bridge/src/window-active.ts
T

8 lines
467 B
TypeScript
Raw Normal View History

/** The attribute of `<html>` that marks a page whose window is not drawn as
* active, for CSS: `:root[data-mygo-window-inactive] .sidebar { … }`. */
export const INACTIVE_ATTRIBUTE = "data-mygo-window-inactive";
/** Marks root, a page's `<html>`, as of a window drawn as active or not. */
export function markWindowActive(root: Pick<Element, "toggleAttribute"> | null | undefined, active: boolean): void {
root?.toggleAttribute(INACTIVE_ATTRIBUTE, !active);
}