UNPKG

@oddbird/css-anchor-positioning

Version:

Polyfill for the proposed CSS anchor positioning spec

26 lines (25 loc) 3.54 kB
export declare const INSET_PROPS: readonly ["left", "right", "top", "bottom", "inset-block-start", "inset-block-end", "inset-inline-start", "inset-inline-end", "inset-block", "inset-inline", "inset"]; export type InsetProperty = (typeof INSET_PROPS)[number]; export declare function isInsetProp(property: string | AnchorSide): property is InsetProperty; export declare const MARGIN_PROPERTIES: readonly ["margin-block-start", "margin-block-end", "margin-block", "margin-inline-start", "margin-inline-end", "margin-inline", "margin-bottom", "margin-left", "margin-right", "margin-top", "margin"]; export type MarginProperty = (typeof MARGIN_PROPERTIES)[number]; export declare function isMarginProp(property: string): property is MarginProperty; export declare const SIZING_PROPS: readonly ["width", "height", "min-width", "min-height", "max-width", "max-height", "block-size", "inline-size", "min-block-size", "min-inline-size", "max-block-size", "max-inline-size"]; export type SizingProperty = (typeof SIZING_PROPS)[number]; export declare function isSizingProp(property: string): property is SizingProperty; export declare const SELF_ALIGNMENT_PROPS: readonly ["justify-self", "align-self", "place-self"]; export type SelfAlignmentProperty = (typeof SELF_ALIGNMENT_PROPS)[number]; export declare function isSelfAlignmentProp(property: string): property is SelfAlignmentProperty; export declare const ACCEPTED_POSITION_TRY_PROPERTIES: readonly ["left", "right", "top", "bottom", "inset-block-start", "inset-block-end", "inset-inline-start", "inset-inline-end", "inset-block", "inset-inline", "inset", "margin-block-start", "margin-block-end", "margin-block", "margin-inline-start", "margin-inline-end", "margin-inline", "margin-bottom", "margin-left", "margin-right", "margin-top", "margin", "width", "height", "min-width", "min-height", "max-width", "max-height", "block-size", "inline-size", "min-block-size", "min-inline-size", "max-block-size", "max-inline-size", "justify-self", "align-self", "place-self", "position-anchor", "position-area"]; export type AcceptedPositionTryProperty = (typeof ACCEPTED_POSITION_TRY_PROPERTIES)[number]; export declare function isAcceptedPositionTryProp(property: string): property is AcceptedPositionTryProperty; export declare const ACCEPTED_ANCHOR_SIZE_PROPERTIES: readonly ["width", "height", "min-width", "min-height", "max-width", "max-height", "block-size", "inline-size", "min-block-size", "min-inline-size", "max-block-size", "max-inline-size", "left", "right", "top", "bottom", "inset-block-start", "inset-block-end", "inset-inline-start", "inset-inline-end", "inset-block", "inset-inline", "inset", "margin-block-start", "margin-block-end", "margin-block", "margin-inline-start", "margin-inline-end", "margin-inline", "margin-bottom", "margin-left", "margin-right", "margin-top", "margin"]; export type AcceptedAnchorSizeProperty = (typeof ACCEPTED_ANCHOR_SIZE_PROPERTIES)[number]; export declare function isAcceptedAnchorSizeProp(property: string): property is AcceptedAnchorSizeProperty; export declare const ANCHOR_SIDES: string[]; export type AnchorSideKeyword = (typeof ANCHOR_SIDES)[number]; export type AnchorSide = AnchorSideKeyword | number; export declare function isAnchorSide(property: string): property is AnchorSideKeyword; export declare const ANCHOR_SIZES: readonly ["width", "height", "block", "inline", "self-block", "self-inline"]; export type AnchorSize = (typeof ANCHOR_SIZES)[number]; export declare function isAnchorSize(property: string): property is AnchorSize;