addCSSVarsToStyle() — astro Function Reference
Architecture documentation for the addCSSVarsToStyle() function in imageAttributes.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD ce7d9564_bb34_a99c_b1d4_90f5e7b5a1f3["addCSSVarsToStyle()"] 038ae3fa_b0fa_2171_53fd_a3441a780778["imageAttributes.ts"] ce7d9564_bb34_a99c_b1d4_90f5e7b5a1f3 -->|defined in| 038ae3fa_b0fa_2171_53fd_a3441a780778 style ce7d9564_bb34_a99c_b1d4_90f5e7b5a1f3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/assets/utils/imageAttributes.ts lines 5–20
export function addCSSVarsToStyle(
vars: Record<string, string | false | undefined>,
styles?: string | Record<string, any>,
) {
const cssVars = Object.entries(vars)
.filter(([_, value]) => value !== undefined && value !== false)
.map(([key, value]) => `--${key}: ${value};`)
.join(' ');
if (!styles) {
return cssVars;
}
const style = typeof styles === 'string' ? styles : toStyleString(styles);
return `${cssVars} ${style}`;
}
Domain
Subdomains
Source
Frequently Asked Questions
What does addCSSVarsToStyle() do?
addCSSVarsToStyle() is a function in the astro codebase, defined in packages/astro/src/assets/utils/imageAttributes.ts.
Where is addCSSVarsToStyle() defined?
addCSSVarsToStyle() is defined in packages/astro/src/assets/utils/imageAttributes.ts at line 5.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free