Home / Function/ isLocalHSLValue() — ui Function Reference

isLocalHSLValue() — ui Function Reference

Architecture documentation for the isLocalHSLValue() function in update-css-vars.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  989639e5_72dc_2426_39e9_5a75ddec4756["isLocalHSLValue()"]
  09244f5d_7fce_b385_220b_05945bb9e93b["update-css-vars.ts"]
  989639e5_72dc_2426_39e9_5a75ddec4756 -->|defined in| 09244f5d_7fce_b385_220b_05945bb9e93b
  b9266edd_762e_e91a_7f0a_fcd26e8e87a3["updateCssVarsPluginV4()"]
  b9266edd_762e_e91a_7f0a_fcd26e8e87a3 -->|calls| 989639e5_72dc_2426_39e9_5a75ddec4756
  9e221c92_a132_552e_5f2f_e0d1591df611["updateThemePlugin()"]
  9e221c92_a132_552e_5f2f_e0d1591df611 -->|calls| 989639e5_72dc_2426_39e9_5a75ddec4756
  style 989639e5_72dc_2426_39e9_5a75ddec4756 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/utils/updaters/update-css-vars.ts lines 880–896

export function isLocalHSLValue(value: string) {
  if (
    value.startsWith("hsl") ||
    value.startsWith("rgb") ||
    value.startsWith("#") ||
    value.startsWith("oklch")
  ) {
    return false
  }

  const chunks = value.split(" ")

  return (
    chunks.length === 3 &&
    chunks.slice(1, 3).every((chunk) => chunk.includes("%"))
  )
}

Subdomains

Frequently Asked Questions

What does isLocalHSLValue() do?
isLocalHSLValue() is a function in the ui codebase, defined in packages/shadcn/src/utils/updaters/update-css-vars.ts.
Where is isLocalHSLValue() defined?
isLocalHSLValue() is defined in packages/shadcn/src/utils/updaters/update-css-vars.ts at line 880.
What calls isLocalHSLValue()?
isLocalHSLValue() is called by 2 function(s): updateCssVarsPluginV4, updateThemePlugin.

Analyze Your Own Codebase

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

Try Supermodel Free