MCPcopy
hub / github.com/vuejs/core / setVarsOnNode

Function setVarsOnNode

packages/runtime-dom/src/helpers/useCssVars.ts:99–110  ·  view source on GitHub ↗
(el: Node, vars: Record<string, unknown>)

Source from the content-addressed store, hash-verified

97}
98
99function setVarsOnNode(el: Node, vars: Record<string, unknown>) {
100 if (el.nodeType === 1) {
101 const style = (el as HTMLElement).style
102 let cssText = ''
103 for (const key in vars) {
104 const value = normalizeCssVarValue(vars[key])
105 style.setProperty(`--${key}`, value)
106 cssText += `--${key}: ${value};`
107 }
108 ;(style as any)[CSS_VAR_TEXT] = cssText
109 }
110}

Callers 3

useCssVarsFunction · 0.85
setVarsFunction · 0.85
setVarsOnVNodeFunction · 0.85

Calls 1

normalizeCssVarValueFunction · 0.90

Tested by

no test coverage detected