Home / Function/ bgGradientToLinear() — tailwindcss Function Reference

bgGradientToLinear() — tailwindcss Function Reference

Architecture documentation for the bgGradientToLinear() function in canonicalize-candidates.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  c6e5ad7d_81ee_7586_f6b5_00bd9ac85b5f["bgGradientToLinear()"]
  f6c14bbb_2e42_58cc_18f1_c89a243da9c0["canonicalize-candidates.ts"]
  c6e5ad7d_81ee_7586_f6b5_00bd9ac85b5f -->|defined in| f6c14bbb_2e42_58cc_18f1_c89a243da9c0
  style c6e5ad7d_81ee_7586_f6b5_00bd9ac85b5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/canonicalize-candidates.ts lines 560–573

function bgGradientToLinear(candidate: Candidate) {
  if (candidate.kind === 'static' && candidate.root.startsWith('bg-gradient-to-')) {
    let direction = candidate.root.slice(15)

    if (!DIRECTIONS.includes(direction)) {
      return candidate
    }

    candidate.root = `bg-linear-to-${direction}`
    return candidate
  }

  return candidate
}

Domain

Subdomains

Frequently Asked Questions

What does bgGradientToLinear() do?
bgGradientToLinear() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/canonicalize-candidates.ts.
Where is bgGradientToLinear() defined?
bgGradientToLinear() is defined in packages/tailwindcss/src/canonicalize-candidates.ts at line 560.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free