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.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Fix adding/deleting bg style in case of style source inheritance (#1593)
Ivan Starkov15ad4df53001
diff --git a/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-layers.ts b/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-layers.tsindex d1c19e8f8b..34f56ebce6 100644--- a/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-layers.ts+++ b/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-layers.ts@@ -101,15 +101,35 @@ export const getLayerBackgroundStyleInfo = (const valueStyle = styleValue?.value;const localStyle = styleValue?.local;const cascadedStyle = styleValue?.cascaded;+ const previousSourceStyle = styleValue?.previousSource;+ const nextSourceStyle = styleValue?.nextSource;if (valueStyle?.type === "layers") {const styleValue = valueStyle.value[layerNum];resultProperty["value"] = styleValue;}+if (localStyle?.type === "layers") {const styleValue = localStyle.value[layerNum];resultProperty["local"] = styleValue;}++ if (previousSourceStyle?.value?.type === "layers") {+ const styleValue = previousSourceStyle.value.value[layerNum];+ resultProperty["previousSource"] = {+ styleSourceId: previousSourceStyle.styleSourceId,+ value: styleValue,+ };+ }++ if (nextSourceStyle?.value?.type === "layers") {+ const styleValue = nextSourceStyle.value.value[layerNum];+ resultProperty["nextSource"] = {+ styleSourceId: nextSourceStyle.styleSourceId,+ value: styleValue,+ };+ }+if (cascadedStyle?.value.type === "layers") {const styleValue = cascadedStyle.value.value[layerNum];resultProperty["cascaded"] = {@@ -150,6 +170,15 @@ const getLayersValue = (styleValue?: StyleValueInfo) => {if (clonedStyleValue?.local?.type === "layers") {return clonedStyleValue.local;}++ if (clonedStyleValue?.nextSource?.value?.type === "layers") {+ return clonedStyleValue?.nextSource?.value;+ }++ if (clonedStyleValue?.previousSource?.value?.type === "layers") {+ return clonedStyleValue?.previousSource?.value;+ }+if (clonedStyleValue?.cascaded?.value.type === "layers") {return clonedStyleValue?.cascaded?.value;}diff --git a/apps/builder/app/builder/features/style-panel/shared/property-name.tsx b/apps/builder/app/builder/features/style-panel/shared/property-name.tsxindex ed30fa6e3c..18a7d144ce 100644--- a/apps/builder/app/builder/features/style-panel/shared/property-name.tsx+++ b/apps/builder/app/builder/features/style-panel/shared/property-name.tsx@@ -209,7 +209,7 @@ export const PropertyName = ({});const labelElement = (- <Flex shrink gap={1}>+ <Flex shrink gap={1} align="center">{typeof label === "string" ? (<Label color={styleSource} truncate>{label}