formatElevationStyle

Commons
stable

Compute a CSS box-shadow declaration from a numeric elevation level and an optional background color. Deprecated since v0.4 — prefer the --origam-shadow-{xs|sm|md|lg|xl} design tokens emitted by useElevation.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

Deprecated since v0.4. Migrate to the --origam-shadow-{xs|sm|md|lg|xl} tokens via the useElevation composable. Will be removed in v3.0.0.

API

Parameters

Input parameters accepted by this util.

elevation
number
0
Elevation level (0–n). Higher values produce larger shadows. Defaults to 0 (no shadow).
bgColor
TColor
Optional background color used to tint the shadow hue. Accepts any parseable CSS color string.

API

Return value

The value returned by this util.

A CSS box-shadow declaration string ready to be set as an inline style.

Usage

Examples

Ready-to-paste usage snippets.

Legacy usage (deprecated)

typescript