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.

feat: Outline Section UX improvement (#2789)

Oleg Isonence2a5ebc52ae
diff --git a/apps/builder/app/builder/features/style-panel/sections/outline/outline.tsx b/apps/builder/app/builder/features/style-panel/sections/outline/outline.tsx
index ca954ed5f6..2d5e246097 100644
--- a/apps/builder/app/builder/features/style-panel/sections/outline/outline.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/outline/outline.tsx
@@ -18,6 +18,11 @@ const properties: StyleProperty[] = [
export const OutlineSection = (props: RenderCategoryProps) => {
const { currentStyle, setProperty, deleteProperty } = props;
+ const { outlineStyle } = currentStyle;
+
+ if (outlineStyle?.value.type !== "keyword") {
+ return;
+ }
return (
<CollapsibleSection
@@ -31,45 +36,48 @@ export const OutlineSection = (props: RenderCategoryProps) => {
setProperty={setProperty}
deleteProperty={deleteProperty}
/>
+ {outlineStyle.value.value !== "none" && (
+ <>
+ <Grid
+ css={{
+ gridTemplateColumns: `1fr ${theme.spacing[20]} ${theme.spacing[12]}`,
+ }}
+ gapX={2}
+ >
+ <PropertyName
+ style={currentStyle}
+ properties={[property]}
+ label={"Color"}
+ onReset={() => deleteProperty(property)}
+ />
- <Grid
- css={{
- gridTemplateColumns: `1fr ${theme.spacing[20]} ${theme.spacing[12]}`,
- }}
- gapX={2}
- >
- <PropertyName
- style={currentStyle}
- properties={[property]}
- label={"Color"}
- onReset={() => deleteProperty(property)}
- />
+ <Box
+ css={{
+ gridColumn: `span 2`,
+ }}
+ >
+ <ColorControl
+ property={property}
+ currentStyle={currentStyle}
+ setProperty={setProperty}
+ deleteProperty={deleteProperty}
+ />
+ </Box>
+ </Grid>
- <Box
- css={{
- gridColumn: `span 2`,
- }}
- >
- <ColorControl
- property={property}
+ <OutlineWidth
currentStyle={currentStyle}
setProperty={setProperty}
deleteProperty={deleteProperty}
/>
- </Box>
- </Grid>
- <OutlineWidth
- currentStyle={currentStyle}
- setProperty={setProperty}
- deleteProperty={deleteProperty}
- />
-
- <OutlineOffset
- currentStyle={currentStyle}
- setProperty={setProperty}
- deleteProperty={deleteProperty}
- />
+ <OutlineOffset
+ currentStyle={currentStyle}
+ setProperty={setProperty}
+ deleteProperty={deleteProperty}
+ />
+ </>
+ )}
</Flex>
</CollapsibleSection>
);
diff --git a/apps/builder/app/builder/features/style-panel/style-sections.tsx b/apps/builder/app/builder/features/style-panel/style-sections.tsx
index 44ae66d9ac..803a59e1dd 100644
--- a/apps/builder/app/builder/features/style-panel/style-sections.tsx
+++ b/apps/builder/app/builder/features/style-panel/style-sections.tsx
@@ -40,8 +40,8 @@ export const categories = [
"backgrounds",
"borders",
"boxShadows",
- "outline",
"effects",
+ "outline",
"transitions",
] as const;
@@ -141,7 +141,7 @@ export const shouldRenderCategory = (
export const sections: Record<
Category,
- (props: RenderCategoryProps) => JSX.Element | null
+ (props: RenderCategoryProps) => JSX.Element | undefined
> = {
layout: LayoutSection,
flexChild: FlexChildSection,
diff --git a/apps/builder/env-check.js b/apps/builder/env-check.js
index ddf79e579c..579715749e 100644
--- a/apps/builder/env-check.js
+++ b/apps/builder/env-check.js
@@ -24,8 +24,9 @@ const S3_KEYS = [
const errors = [];
REQUIRED_ENVS.map((env) => {
- if (!process.env[env])
+ if (!process.env[env]) {
errors.push(`👉 The ${env} environment variable is required`);
+ }
});
if (process.env.DEPLOYMENT_ENVIRONMENT === "production") {