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

Signature TypeScript complète, extraite du fichier util.

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

Paramètres

Paramètres d'entrée acceptés par cet 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

Valeur de retour

La valeur retournée par cet util.

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

Usage

Exemples

Extraits de code prêts à coller.

Legacy usage (deprecated)

typescript