useCssVars() — vue Function Reference
Architecture documentation for the useCssVars() function in useCssVars.ts from the vue codebase.
Entity Profile
Relationship Graph
Source Code
src/v3/sfc-helpers/useCssVars.ts lines 9–34
export function useCssVars(
getter: (
vm: Record<string, any>,
setupProxy: Record<string, any>
) => Record<string, string>
) {
if (!inBrowser && !__TEST__) return
const instance = currentInstance
if (!instance) {
__DEV__ &&
warn(`useCssVars is called without current active component instance.`)
return
}
watchPostEffect(() => {
const el = instance.$el
const vars = getter(instance, instance._setupProxy!)
if (el && el.nodeType === 1) {
const style = (el as HTMLElement).style
for (const key in vars) {
style.setProperty(`--${key}`, vars[key])
}
}
})
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free