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: Add hflex/vflex styles (#3954)

Oleg Isonenb465ccbc5b74
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 e5a6d4850f..ca087625df 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
@@ -672,7 +672,15 @@ test("V Flex", async () => {
},
});
equalFragment(fragment, <$.Box />);
- expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-layout-vflex {
+ flex-direction: column;
+ align-items: flex-start;
+ display: flex
+ }
+ }"
+ `);
});
test("H Flex", async () => {
@@ -693,7 +701,15 @@ test("H Flex", async () => {
},
});
equalFragment(fragment, <$.Box />);
- expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-layout-hflex {
+ flex-direction: row;
+ align-items: flex-start;
+ display: flex
+ }
+ }"
+ `);
});
test("QuickStack with instance styles", async () => {
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 d8e9823a59..94cac5a8db 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
@@ -366,6 +366,14 @@ const mapComponentAndPresetStyles = (
presetStyles.push("wf-layout-layout");
return presetStyles;
}
+ case "HFlex": {
+ presetStyles.push("w-layout-hflex");
+ return presetStyles;
+ }
+ case "VFlex": {
+ presetStyles.push("w-layout-vflex");
+ return presetStyles;
+ }
case "FormWrapper": {
presetStyles.push("w-form");
return presetStyles;