Home / Function/ genVarName() — vue Function Reference

genVarName() — vue Function Reference

Architecture documentation for the genVarName() function in cssVars.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  ca02b3b0_5d12_751b_ef96_78b58db03475["genVarName()"]
  a529a219_41cb_a359_1f8b_d0169d83906f["genCssVarsFromList()"]
  a529a219_41cb_a359_1f8b_d0169d83906f -->|calls| ca02b3b0_5d12_751b_ef96_78b58db03475
  676a6c5d_6ef9_a6b7_ef84_83c833d8a8d4["cssVarsPlugin()"]
  676a6c5d_6ef9_a6b7_ef84_83c833d8a8d4 -->|calls| ca02b3b0_5d12_751b_ef96_78b58db03475
  style ca02b3b0_5d12_751b_ef96_78b58db03475 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/cssVars.ts lines 22–28

function genVarName(id: string, raw: string, isProd: boolean): string {
  if (isProd) {
    return hash(id + raw)
  } else {
    return `${id}-${raw.replace(/([^\w-])/g, '_')}`
  }
}

Domain

Subdomains

Frequently Asked Questions

What does genVarName() do?
genVarName() is a function in the vue codebase.
What calls genVarName()?
genVarName() is called by 2 function(s): cssVarsPlugin, genCssVarsFromList.

Analyze Your Own Codebase

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

Try Supermodel Free