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: CSS var() truncation in advanced styles panel (#5378) (#5468)

niatalwalkarcc20991b08c1
diff --git a/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx b/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx
index 9e7ae0c1eb..aff1c6a442 100644
--- a/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx
+++ b/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx
@@ -335,7 +335,8 @@ const itemToString = (item: CssValueInputValue | null) => {
return "";
}
if (item.type === "var") {
- return `var(--${item.value})`;
+ // Use toValue to include fallback when present
+ return toValue(item as StyleValue);
}
if (item.type === "keyword") {
// E.g. we want currentcolor to be lower case