ui/position_helpers.ts

CSS position calculation helpers for popovers and floating UI elements.

view source

Declarations
#

4 declarations

Alignment
#

ui/position_helpers.ts view source

Alignment

type "start" | "center" | "end"

import type {Alignment} from '@fuzdev/fuz_app/ui/position_helpers.js';

Alignment options for positioned elements.

CardinalPosition
#

ui/position_helpers.ts view source

CardinalPosition

type "left" | "right" | "top" | "bottom"

import type {CardinalPosition} from '@fuzdev/fuz_app/ui/position_helpers.js';

Basic position options for UI elements (cardinal directions).

generate_position_styles
#

ui/position_helpers.ts view source

(position?: Position, align?: Alignment, offset?: string): Record<string, string> import {generate_position_styles} from '@fuzdev/fuz_app/ui/position_helpers.js';

Generates CSS positioning styles for UI elements.

position?

optional default 'center'

align?

optional default 'center'

offset?

distance from the position (CSS value)

type string
optional default '0'

returns

Record<string, string>

throws

  • UnreachableError - if `position` is not a known `Position` value

Position
#

Imported by
#