@antadesign/anta
    Preparing search index...

    Interface BoxContext

    interface BoxContext {
        mode: BoxMode;
        globalMode: BoxMode;
        systemAppearance: BoxMode;
        focusWithin: boolean;
        os: BoxOS;
        osVersion: number;
        browser: BoxBrowser;
        browserVersion: number;
        mobile: boolean;
        pointer: BoxPointer;
        hover: boolean;
        reducedMotion: boolean;
        devicePixelRatio: number;
        font: BoxFont;
        inset: BoxInset;
        backgroundColor: string;
    }
    Index
    mode: BoxMode

    Closest scoped Anta mode. A local .light can override a dark document.

    globalMode: BoxMode

    Mode on <html>, independent of an enclosing local scope.

    systemAppearance: BoxMode

    Browser / operating-system color preference, independent of Anta classes.

    focusWithin: boolean

    Whether focus is on the box or any of its descendants, read from the native :focus-within. For CSS, use that pseudo-class directly; this field is for logic that cannot query the DOM.

    os: BoxOS

    Operating-system family.

    osVersion: number

    Operating-system major version, or 0 when the browser withholds it. Browsers freeze this: every engine reports macOS as 10.15.7 and Windows 11 as 10.0, so only Android and iOS carry a real number. Treat it as a hint, never as a gate.

    browser: BoxBrowser

    Browser family.

    browserVersion: number

    Browser major version, or 0 when unknown. Minor and patch digits are frozen by every engine, so only the major number is reported.

    mobile: boolean

    Whether the browser reports a mobile device.

    pointer: BoxPointer

    Most precise available primary pointer.

    hover: boolean

    Whether ordinary hover interaction is available.

    reducedMotion: boolean

    Whether the reader asks for reduced motion.

    devicePixelRatio: number

    window.devicePixelRatio: CSS pixels per device pixel. 1 on a standard display, 2 on most Retina screens, and a fraction under OS or browser zoom. Live — it re-reports on zoom and when the window moves to a monitor with a different density.

    font: BoxFont

    Resolved text style, ready to hand to a canvas 2D context.

    inset: BoxInset

    Padding and border widths, for placing content inside the border box.

    backgroundColor: string

    Resolved background-color. Needed when the box's content is drawn somewhere else — an offscreen canvas, a worker, an export — where the box's own background is not behind it.