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.

just render flex items for now

Sultaneefa60361ac9
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsx
index bba5781538..6e91517947 100644
--- a/apps/designer/app/designer/features/style-panel/style-section.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { ChangeEvent, ChangeEventHandler, useState } from "react";
import {
Box,
Flex,
@@ -191,6 +191,22 @@ const ComboboxControl = ({
const setValue = setProperty(styleConfig.property);
+ switch (styleConfig.property) {
+ case "rowGap":
+ case "columnGap": {
+ return (
+ <input
+ type="number"
+ value={String(value.value)}
+ onChange={(event: ChangeEvent<HTMLInputElement>) =>
+ setValue(event.target.value)
+ }
+ style={{ width: "100%", boxSizing: "border-box" }}
+ />
+ );
+ }
+ }
+
return (
<Grid columns={2} align="center" gapX="1">
{/* @todo needs icon variant */}
@@ -269,7 +285,6 @@ const ComboiconControl = ({
const setValue = setProperty(styleConfig.property);
const currentValue = value.value as string;
const Icon = (icons as any)[styleConfig.property]?.[currentValue];
- console.log(currentValue);
return (
<Comboicon
id={styleConfig.property}
@@ -380,11 +395,17 @@ export const renderCategory = ({
css={{ gridArea: "grid" }}
currentStyle={currentStyle}
/>,
- <Box key="lock" css={{ gridArea: "lock" }}>
+ <Box
+ key="lock"
+ css={{
+ gridArea: "lock",
+ display: "flex",
+ justifyContent: "center",
+ }}
+ >
<IconButton>
<LockClosedIcon />
</IconButton>
- ,
</Box>,
...styleConfigsByCategory,
];
@@ -397,7 +418,7 @@ export const renderCategory = ({
gridTemplateRows: "auto auto auto auto",
gridTemplateAreas: `
"display display display display display display display display display display display display"
- "grid grid grid grid flexDirection flexDirection flexWrap flexWrap . . . ."
+ "grid grid grid grid flexDirection flexDirection flexWrap flexWrap justifyItems justifyItems . ."
"grid grid grid grid alignItems alignItems justifyContent justifyContent alignContent alignContent . ."
"rowGap rowGap rowGap rowGap rowGap lock lock columnGap columnGap columnGap columnGap columnGap"
`,
@@ -409,6 +430,9 @@ export const renderCategory = ({
</>
);
}
+ default: {
+ styleConfigsByCategory = [styleConfigsByCategory[0]];
+ }
}
}
}
diff --git a/apps/designer/app/shared/icons/align-items.tsx b/apps/designer/app/shared/icons/align-items.tsx
index a165294b1c..4a89e997f3 100644
--- a/apps/designer/app/shared/icons/align-items.tsx
+++ b/apps/designer/app/shared/icons/align-items.tsx
@@ -158,6 +158,8 @@ export const alignItems = {
normal: AlignItemsStart,
start: AlignItemsStart,
end: AlignItemsEnd,
+ "flex-start": AlignItemsStart,
+ "flex-end": AlignItemsEnd,
center: AlignItemsCenter,
baseline: AlignItemsBaseline,
stretch: AlignItemsStretch,