Home / Function/ inferDataType() — tailwindcss Function Reference

inferDataType() — tailwindcss Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e9f456b9_ea98_fa9b_1202_d2c13bcee0d8["inferDataType()"]
  516809a4_c70e_60c3_bbb2_8de4c4572510["infer-data-type.ts"]
  e9f456b9_ea98_fa9b_1202_d2c13bcee0d8 -->|defined in| 516809a4_c70e_60c3_bbb2_8de4c4572510
  2efa0a66_c375_c031_24ad_1f7509bb9b14["buildPluginApi()"]
  2efa0a66_c375_c031_24ad_1f7509bb9b14 -->|calls| e9f456b9_ea98_fa9b_1202_d2c13bcee0d8
  3df007ff_869c_dbfa_d21c_be64d5ce3eec["resolveValueFunction()"]
  3df007ff_869c_dbfa_d21c_be64d5ce3eec -->|calls| e9f456b9_ea98_fa9b_1202_d2c13bcee0d8
  style e9f456b9_ea98_fa9b_1202_d2c13bcee0d8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/utils/infer-data-type.ts lines 47–57

export function inferDataType(value: string, types: DataType[]): DataType | null {
  if (value.startsWith('var(')) return null

  for (let type of types) {
    if (checks[type]?.(value)) {
      return type
    }
  }

  return null
}

Subdomains

Frequently Asked Questions

What does inferDataType() do?
inferDataType() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/utils/infer-data-type.ts.
Where is inferDataType() defined?
inferDataType() is defined in packages/tailwindcss/src/utils/infer-data-type.ts at line 47.
What calls inferDataType()?
inferDataType() is called by 2 function(s): buildPluginApi, resolveValueFunction.

Analyze Your Own Codebase

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

Try Supermodel Free