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: Align spacing for size section with figma (#2823)

Oleg Isonenabcc046c65a7
diff --git a/apps/builder/app/builder/features/style-panel/sections/size/size.tsx b/apps/builder/app/builder/features/style-panel/sections/size/size.tsx
index 9783a282ad..46e42f6d2b 100644
--- a/apps/builder/app/builder/features/style-panel/sections/size/size.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/size/size.tsx
@@ -1,6 +1,6 @@
import type { StyleProperty } from "@webstudio-is/css-engine";
import { toValue } from "@webstudio-is/css-engine";
-import { Flex, Grid } from "@webstudio-is/design-system";
+import { Grid, Separator, styled } from "@webstudio-is/design-system";
import { styleConfigByName } from "../../shared/configs";
import type { RenderCategoryProps } from "../../style-sections";
import { PropertyName } from "../../shared/property-name";
@@ -62,6 +62,12 @@ const properties: StyleProperty[] = [
"aspectRatio",
];
+const Section = styled(Grid, {
+ columnGap: theme.spacing[5],
+ rowGap: theme.spacing[5],
+ px: theme.spacing[9],
+});
+
export const SizeSection = ({
currentStyle: style,
setProperty,
@@ -72,11 +78,9 @@ export const SizeSection = ({
label="Size"
currentStyle={style}
properties={properties}
+ fullWidth
>
- <Grid
- columns={2}
- css={{ columnGap: theme.spacing[5], rowGap: theme.spacing[7] }}
- >
+ <Section columns={2}>
<SizeField
property="width"
style={style}
@@ -125,6 +129,9 @@ export const SizeSection = ({
setProperty={setProperty}
deleteProperty={deleteProperty}
/>
+ </Section>
+ <Separator />
+ <Section columns={2}>
<PropertyName
label={styleConfigByName("overflow").label}
properties={["overflow"]}
@@ -184,8 +191,6 @@ export const SizeSection = ({
setProperty={setProperty}
deleteProperty={deleteProperty}
/>
- </Grid>
- <Flex justify="between">
<PropertyName
label={styleConfigByName("objectPosition").label}
properties={["objectPosition"]}
@@ -198,7 +203,7 @@ export const SizeSection = ({
setProperty={setProperty}
deleteProperty={deleteProperty}
/>
- </Flex>
+ </Section>
</CollapsibleSection>
);
};
diff --git a/apps/builder/app/builder/features/style-panel/shared/collapsible-section.tsx b/apps/builder/app/builder/features/style-panel/shared/collapsible-section.tsx
index d79f03754d..3a56413bfc 100644
--- a/apps/builder/app/builder/features/style-panel/shared/collapsible-section.tsx
+++ b/apps/builder/app/builder/features/style-panel/shared/collapsible-section.tsx
@@ -28,8 +28,9 @@ export const CollapsibleSection = (props: {
children: ReactNode;
currentStyle: StyleInfo;
properties: ReadonlyArray<StyleProperty>;
+ fullWidth?: boolean;
}) => {
- const { label, children, currentStyle, properties } = props;
+ const { label, children, currentStyle, properties, fullWidth } = props;
const [isOpen, setIsOpen] = useOpenState(props);
return (
@@ -42,6 +43,7 @@ export const CollapsibleSection = (props: {
<SectionTitleLabel>{label}</SectionTitleLabel>
</SectionTitle>
}
+ fullWidth={fullWidth}
>
{children}
</CollapsibleSectionBase>