@oddbird/css-anchor-positioning
Version:
Polyfill for the proposed CSS anchor positioning spec
15 lines (14 loc) • 867 B
TypeScript
import { type Selector } from './dom.js';
/**
* Validates that el is a acceptable anchor element for an absolutely positioned
* element query el
* https://drafts.csswg.org/css-anchor-position-1/#acceptable-anchor-element
*/
export declare function isAcceptableAnchorElement(el: HTMLElement, anchorName: string | null, queryEl: HTMLElement, scopeSelector: string | null): Promise<boolean>;
/**
* Given a target element and CSS selector(s) for potential anchor element(s),
* returns the first element that passes validation,
* or `null` if no valid anchor element is found
* https://drafts.csswg.org/css-anchor-position-1/#target
*/
export declare function validatedForPositioning(targetEl: HTMLElement | null, anchorName: string | null, anchorSelectors: Selector[], scopeSelectors: Selector[]): Promise<HTMLElement | import("./dom.js").PseudoElement | null>;