Skip to content

Commit d22b20b

Browse files
committed
Replace grid with flex column
1 parent 466eab9 commit d22b20b

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

apps/builder/app/shared/tailwind/tailwind.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ test("generate space without display property", async () => {
536536
<ws.element
537537
ws:tag="div"
538538
ws:style={css`
539-
display: grid;
539+
display: flex;
540+
flex-direction: column;
541+
align-items: start;
540542
row-gap: 1rem;
541543
`}
542544
></ws.element>

apps/builder/app/shared/tailwind/tailwind.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,20 @@ const parseTailwindClasses = async (classes: string) => {
243243
});
244244
}
245245
if (hasRowGaps && !hasFlexOrGrid) {
246-
parsedStyles.unshift({
247-
property: "display",
248-
value: { type: "keyword", value: "grid" },
249-
});
246+
parsedStyles.unshift(
247+
{
248+
property: "display",
249+
value: { type: "keyword", value: "flex" },
250+
},
251+
{
252+
property: "flex-direction",
253+
value: { type: "keyword", value: "column" },
254+
},
255+
{
256+
property: "align-items",
257+
value: { type: "keyword", value: "start" },
258+
}
259+
);
250260
}
251261
adaptBreakpoints(parsedStyles);
252262
const newClasses = classes

0 commit comments

Comments
 (0)