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.

Merge branch 'fix-css-value-input' into feature-style-panel-flexChild-section

Sultan78d8c71fe048
diff --cc apps/designer/app/designer/features/style-panel/controls/index.ts
index b2c1fc3e34,f6e4b98bb3..337abb16a8
--- a/apps/designer/app/designer/features/style-panel/controls/index.ts
+++ b/apps/designer/app/designer/features/style-panel/controls/index.ts
@@@ -3,4 -3,4 +3,5 @@@ export * from "./color/color-control"
export * from "./select/select-control";
export * from "./menu/menu-control";
export * from "./font-family/font-family-control";
+ export * from "./image/image-control";
+export * from "./toggle/toggle-control";
diff --cc apps/designer/app/designer/features/style-panel/sections/layout/layout.tsx
index 14c5bdfd82,7529e48ee3..eca26820ce
--- a/apps/designer/app/designer/features/style-panel/sections/layout/layout.tsx
+++ b/apps/designer/app/designer/features/style-panel/sections/layout/layout.tsx
@@@ -10,15 -12,51 +10,41 @@@ const LayoutSectionFlex = (
sectionStyle,
createBatchUpdate,
}: RenderCategoryProps) => {
- const {
- display,
- flexDirection,
- flexWrap,
- alignItems,
- justifyContent,
- alignContent,
- columnGap,
- rowGap,
- } = sectionStyle;
const batchUpdate = createBatchUpdate();
+ const hasMenuItems = [
+ flexDirection,
+ flexWrap,
+ alignItems,
+ justifyContent,
+ alignContent,
+ ].some((config) => config !== undefined);
+
return (
- <>
- <Grid
- css={{
- gap: "$2",
- gridTemplateColumns: "repeat(2, $6) repeat(3, $6)",
- gridTemplateRows: "repeat(2, $6)",
- gridTemplateAreas: `
+ <Flex css={{ flexDirection: "column", gap: "$2" }}>
+ {display?.styleConfig && (
+ <Grid
+ css={{
+ gridArea: "display",
+ gridTemplateColumns: "auto 1fr",
+ gap: "$space$2",
+ width: "fit-content",
+ fontWeight: "500",
+ }}
+ >
+ <PropertyName
+ property={display.styleConfig.property}
+ label={display.styleConfig.label}
+ />
+ <SelectControl {...display} />
+ </Grid>
+ )}
+ {hasMenuItems && (
+ <Grid
+ css={{
+ gap: "$2",
+ gridTemplateColumns: "repeat(2, $6) repeat(3, $6)",
+ gridTemplateRows: "repeat(2, $6)",
+ gridTemplateAreas: `
"grid grid flexDirection flexWrap ."
"grid grid alignItems justifyContent alignContent"
`,
@@@ -55,21 -104,27 +92,27 @@@
alignItems: "center",
}}
>
- <Box css={{ gridArea: "columnGap" }}>
- <TextControl {...sectionStyle["columnGap"]} />
- </Box>
- <Box css={{ gridArea: "lock", px: "$1" }}>
- <Lock
- pairedKeys={["columnGap", "rowGap"]}
- currentStyle={currentStyle}
- batchUpdate={batchUpdate}
- />
- </Box>
- <Box css={{ gridArea: "rowGap" }}>
- <TextControl {...sectionStyle["rowGap"]} />
- </Box>
+ {columnGap?.styleConfig && (
+ <Box css={{ gridArea: "columnGap" }}>
+ <TextControl {...columnGap} />
+ </Box>
+ )}
+ {rowGap?.styleConfig && columnGap?.styleConfig && (
+ <Box css={{ gridArea: "lock", px: "$1" }}>
+ <Lock
+ pairedKeys={["columnGap", "rowGap"]}
+ currentStyle={currentStyle}
+ batchUpdate={batchUpdate}
+ />
+ </Box>
+ )}
+ {rowGap?.styleConfig && (
+ <Box css={{ gridArea: "rowGap" }}>
+ <TextControl {...rowGap} />
+ </Box>
+ )}
</Grid>
- </Flex>
+ </>
);
};
diff --cc apps/designer/app/designer/features/style-panel/style-sections.tsx
index 04f1a367cf,7501ca59fe..2b9c630640
--- a/apps/designer/app/designer/features/style-panel/style-sections.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-sections.tsx
@@@ -130,27 -126,8 +130,17 @@@ export const shouldRenderCategory = (
};
const sections: {
- [key: string]: (props: RenderCategoryProps) => JSX.Element | null;
+ [Property in Category]: (props: RenderCategoryProps) => JSX.Element | null;
} = {
layout: LayoutSection,
+ flexChild: FlexChildSection,
+ gridChild: GridChildSection,
spacing: SpacingSection,
+ size: SizeSection,
+ position: PositionSection,
+ typography: TypographySection,
+ backgrounds: BackgroundsSection,
+ borders: BordersSection,
+ effects: EffectsSection,
+ other: OtherSection,
};
-
- const controls: {
- [key: string]: (props: ControlProps) => JSX.Element | null;
- } = {
- Menu: MenuControl,
- Text: TextControl,
- Color: ColorControl,
- Select: SelectControl,
- FontFamily: FontFamilyControl,
- };
diff --cc packages/icons/src/index.ts
index 6e5c1f2ac7,e806ce7d5d..fd76ebfeb2
--- a/packages/icons/src/index.ts
+++ b/packages/icons/src/index.ts
@@@ -49,15 -49,14 +49,26 @@@ export { SizeIcon } from "./size"
export { UploadIcon } from "./upload";
export { GearIcon, gearIconCssVars } from "./gear";
export * from "./page";
+ export { CopyIcon } from "./copy";
+ export * from "./new-page";
+ export * from "./new-folder";
+ export * from "./chevron-double-up";
+ export * from "./chevron-double-down";
+ export * from "./chevron-double-left";
+ export * from "./chevron-double-right";
+ export { ChevronUpIcon } from "./chevron-up";
+ export { ChevronDownIcon } from "./chevron-down";
+ export { ChevronLeftIcon } from "./chevron-left";
+ export { ChevronRightIcon } from "./chevron-right";
+export * from "./align-self-start";
+export * from "./align-self-end";
+export * from "./align-self-center";
+export * from "./align-self-stretch";
+export * from "./align-self-baseline";
+export * from "./flex-sizing-grow";
+export * from "./flex-sizing-shrink";
+export * from "./order-first";
+export * from "./order-last";
+export * from "./cross-small";
+export * from "./cross-large";
+export * from "./ellipses";