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

Function resolveCssVars

packages/runtime-core/src/hydration.ts:947–969  ·  view source on GitHub ↗
(
  instance: ComponentInternalInstance,
  vnode: VNode,
  expectedMap: Map<string, string>,
)

Source from the content-addressed store, hash-verified

945}
946
947function resolveCssVars(
948 instance: ComponentInternalInstance,
949 vnode: VNode,
950 expectedMap: Map<string, string>,
951) {
952 const root = instance.subTree
953 if (
954 instance.getCssVars &&
955 (vnode === root ||
956 (root &&
957 root.type === Fragment &&
958 (root.children as VNode[]).includes(vnode)))
959 ) {
960 const cssVars = instance.getCssVars()
961 for (const key in cssVars) {
962 const value = normalizeCssVarValue(cssVars[key])
963 expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value)
964 }
965 }
966 if (vnode === root && instance.parent) {
967 resolveCssVars(instance.parent, instance.vnode, expectedMap)
968 }
969}
970
971const allowMismatchAttr = 'data-allow-mismatch'
972

Callers 1

propHasMismatchFunction · 0.85

Calls 3

normalizeCssVarValueFunction · 0.90
getEscapedCssVarNameFunction · 0.90
setMethod · 0.45

Tested by

no test coverage detected