shadow_css.ts

The shape of a declared shadow variable: a geometry token, then a shadow color mixed down to a step of the alpha ramp. Kept in a leaf module with type-only imports so a theme module can author shadows without pulling the variable data into a runtime chunk.

view source

Declarations
#

2 declarations

render_shadow_css
#

shadow_css.ts view source

(shape: "shadow" | "shadow_top" | "shadow_bottom" | "shadow_inset" | "shadow_inset_top" | "shadow_inset_bottom", size: "lg" | "md" | "sm" | "xs" | "xl", color: "umbra" | "highlight" | "glow" | "shroud", alpha: "00" | ... 11 more ... | "100"): string import {render_shadow_css} from '@fuzdev/fuz_css/shadow_css.js';

Renders one box-shadow layer from the shadow tokens, for a declared shadow variable like --button_shadow or --panel_shadow. Join several with , to stack them.

The color is named outright, not read through the contextual --shadow_color the .shadow_* classes set: a custom property's var()s substitute against the element that declares it, and theme variables are declared on :root, so that indirection would only ever see its fallback.

shape

where the shadow falls

size

the geometry step

color

the semantic shadow color, as in --shadow_color_umbra

alpha

the step of the shadow alpha ramp, scaled by --shadow_alpha_scale

returns

string

the layer as a CSS value

ShadowShape
#

shadow_css.ts view source

"shadow" | "shadow_top" | "shadow_bottom" | "shadow_inset" | "shadow_inset_top" | "shadow_inset_bottom"

type "shadow" | "shadow_top" | "shadow_bottom" | "shadow_inset" | "shadow_inset_top" | "shadow_inset_bottom"

import type {ShadowShape} from '@fuzdev/fuz_css/shadow_css.js';

Where a shadow falls: shadow centered on the element, shadow_top and shadow_bottom cast to one side, and the inset twins drawn inside it. Derived from shadow_variant_prefixes, the vocabulary the geometry tokens are emitted from.

Depends on
#

Imported by
#