Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: render images on canvas (#4234)

Bogdan Chadkin9b81aa6050b5
diff --git a/apps/builder/app/canvas/shared/styles.ts b/apps/builder/app/canvas/shared/styles.ts
index 2e27ceb4b4..d8a647666d 100644
--- a/apps/builder/app/canvas/shared/styles.ts
+++ b/apps/builder/app/canvas/shared/styles.ts
@@ -146,14 +146,16 @@ const getEphemeralProperty = (styleDecl: StyleDecl) => {
// wrap normal style value with var(--namespace, value) to support ephemeral styles updates
// between all token usages
const toVarValue = (styleDecl: StyleDecl): undefined | VarValue => {
- const { value } = styleDecl;
return {
type: "var",
// var style value is relying on name without leading "--"
// escape complex selectors in state like ":hover"
// setProperty and removeProperty escape automatically
value: CSS.escape(getEphemeralProperty(styleDecl).slice(2)),
- fallback: { type: "unparsed", value: toValue(value) },
+ fallback: {
+ type: "unparsed",
+ value: toValue(styleDecl.value, $transformValue.get()),
+ },
};
};