Skip to main content

Function: parseBoxShadow()

parseBoxShadow(boxShadow, getColor): string

Defined in: utils/styled.ts:51

Converts a boxShadow object to a CSS box-shadow string.

Parameters​

boxShadow​

The boxShadow object to convert

color?​

string

x?​

number

y?​

number

radius?​

number

getColor​

(color) => string

Function to resolve theme color references (e.g., 'theme.colors.primary')

Returns​

string

CSS box-shadow string in the format: "xpx ypx radiuspx color"

Example​

parseBoxShadow(
{ x: 2, y: 4, radius: 8, color: 'theme.colors.shadow' },
(color) => '#000000'
);
// Returns: "2px 4px 8px #000000"