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.

experimental: fix local styles when copy from webflow (#3735)

Bogdan Chadkindc78b53c1398
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx b/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx
index 636a21433f..ea62e6d7cf 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx
@@ -726,13 +726,13 @@ test("QuickStack with instance styles", async () => {
justify-content: center;
padding: 20px
}
+ wf-layout-layout {
+ display: grid
+ }
Local {
grid-template-columns: 1fr 1fr;
grid-template-rows: auto
}
- wf-layout-layout {
- display: grid
- }
w-layout-cell {
flex-direction: column;
justify-content: flex-start;
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
index 0fd01aa207..a0e4cd6dbb 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
@@ -484,15 +484,15 @@ export const addStyles = async ({
instanceId,
fragment,
});
-
- addNodeLocalStyles({
- styleSourceId: await generateStyleSourceId(wfNode._id),
- style: wfNode.data?.style,
- instanceId,
- fragment,
- });
}
+ addNodeLocalStyles({
+ styleSourceId: await generateStyleSourceId(wfNode._id),
+ style: wfNode.data?.style,
+ instanceId,
+ fragment,
+ });
+
const instance = fragment.instances.find(
(instance) => instance.id === instanceId
);