MCPcopy Create free account
hub / github.com/SyntaxUI/syntaxui / generateTailwindGradient

Function generateTailwindGradient

src/lib/gradients.ts:1–17  ·  view source on GitHub ↗
({
  shape,
  direction,
  from,
  via,
  to,
}: {
  shape: string
  direction: string
  from: string
  via?: string
  to: string
})

Source from the content-addressed store, hash-verified

1export function generateTailwindGradient({
2 shape,
3 direction,
4 from,
5 via,
6 to,
7}: {
8 shape: string
9 direction: string
10 from: string
11 via?: string
12 to: string
13}): string {
14 const formattedDirection = direction.replace(/\s+/g, '_')
15 const viaClass = via ? `via-[${via}]` : ''
16 return `bg-[radial-gradient(${shape}_at_${formattedDirection},_var(--tw-gradient-stops))] from-[${from}] ${viaClass} to-[${to}]`
17}
18
19export function generateCssGradient({
20 shape,

Callers 1

CustomGradientGeneratorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected