Home / Function/ isImage() — tailwindcss Function Reference

isImage() — tailwindcss Function Reference

Architecture documentation for the isImage() function in infer-data-type.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  4ff0496f_f56a_cc01_37ae_02f2f39197d2["isImage()"]
  43fe4735_10e8_ed1d_6f4f_74b2008c1b00["infer-data-type.ts"]
  4ff0496f_f56a_cc01_37ae_02f2f39197d2 -->|defined in| 43fe4735_10e8_ed1d_6f4f_74b2008c1b00
  c58cbb33_f3cc_0b4f_844a_15bf66a1dc61["segment()"]
  4ff0496f_f56a_cc01_37ae_02f2f39197d2 -->|calls| c58cbb33_f3cc_0b4f_844a_15bf66a1dc61
  3f478823_f462_9861_2da5_1c0b6b6e989b["isUrl()"]
  4ff0496f_f56a_cc01_37ae_02f2f39197d2 -->|calls| 3f478823_f462_9861_2da5_1c0b6b6e989b
  style 4ff0496f_f56a_cc01_37ae_02f2f39197d2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/utils/infer-data-type.ts lines 85–110

function isImage(value: string) {
  let count = 0

  for (let part of segment(value, ',')) {
    if (part.startsWith('var(')) continue

    if (isUrl(part)) {
      count += 1
      continue
    }

    if (IS_GRADIENT_FN.test(part)) {
      count += 1
      continue
    }

    if (IS_IMAGE_FN.test(part)) {
      count += 1
      continue
    }

    return false
  }

  return count > 0
}

Domain

Subdomains

Frequently Asked Questions

What does isImage() do?
isImage() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/utils/infer-data-type.ts.
Where is isImage() defined?
isImage() is defined in packages/tailwindcss/src/utils/infer-data-type.ts at line 85.
What does isImage() call?
isImage() calls 2 function(s): isUrl, segment.

Analyze Your Own Codebase

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

Try Supermodel Free