MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / resolveGradientBorder

Function resolveGradientBorder

packages/extension/utils/css.ts:532–550  ·  view source on GitHub ↗
(style: Record<string, string>)

Source from the content-addressed store, hash-verified

530}
531
532function resolveGradientBorder(style: Record<string, string>): GradientBorderSpec | null {
533 const gradient = extractLeadingGradient(style['border-image'] ?? '')
534 if (!gradient) return null
535
536 const borderWidth = getBorderWidth(style)
537 if (!borderWidth || isZeroBorderWidth(borderWidth)) return null
538
539 const preserveBorder = !hasOverflowClipping(style)
540 const inset = preserveBorder
541 ? (negateLengthLiteral(borderWidth) ?? `calc(-1 * ${borderWidth})`)
542 : '0'
543
544 return {
545 gradient,
546 borderWidth,
547 preserveBorder,
548 inset
549 }
550}
551
552function buildGradientBorderBaseStyle(
553 style: Record<string, string>,

Callers 1

serializeCSSFunction · 0.85

Calls 5

isZeroBorderWidthFunction · 0.85
extractLeadingGradientFunction · 0.70
getBorderWidthFunction · 0.70
hasOverflowClippingFunction · 0.70
negateLengthLiteralFunction · 0.70

Tested by

no test coverage detected