Skip to content

Orbit.resize()

Orbit.resize(selectorOrElement) adapts .gravity-spot layouts to a container’s width using ResizeObserver. It accepts a CSS selector or an element and returns a cleanup function. Call it after the container mounts, and clean up when the container unmounts.

const stopResizing = Orbit.resize(document.querySelector('.wrapper'));
// When removing the container or disposing a component:
stopResizing();

Calling resize() again for the same container replaces its previous observer. The current site’s runtime also updates SVG geometry after DOM, ancestor style and size changes. For CSSOM edits or CSS driven by an external control, call Orbit.refresh(container) after your change; this synchronously refreshes that subtree.

These APIs describe the current site build.

Examples include the current Orbit stylesheet and runtime. Get both files for your project.