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.

experimental: Improve readability in advanced section (#4852)

Oleg Isonend60d3c55b85c
diff --git a/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx b/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx
index 55e75d40f9..f1105e18b7 100644
--- a/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx
@@ -288,6 +288,10 @@ const AddProperty = forwardRef<
);
});
+// Used to indent the values when they are on the next line. This way its easier to see
+// where the property ends and value begins, especially in case of presets.
+const indentation = `20px`;
+
const AdvancedPropertyLabel = ({
property,
onReset,
@@ -334,6 +338,7 @@ const AdvancedPropertyLabel = ({
text="mono"
css={{
backgroundColor: "transparent",
+ marginLeft: `-${indentation}`,
}}
>
{label}
@@ -542,6 +547,7 @@ const AdvancedProperty = memo(
// with "auto" it will call it with skipped false for all initial elements.
// 44px is the height of the property row with 2 lines of text. This value can be adjusted slightly.
containIntrinsicSize: "auto 44px",
+ paddingLeft: indentation,
}}
key={property}
wrap="wrap"
@@ -551,12 +557,20 @@ const AdvancedProperty = memo(
{isVisible && (
<>
<AdvancedPropertyLabel property={property} onReset={onReset} />
- <Text>:</Text>
- <AdvancedPropertyValue
- autoFocus={autoFocus}
- property={property}
- onChangeComplete={onChangeComplete}
- />
+ <Text
+ variant="mono"
+ // Improves the visual separation of value from the property.
+ css={{ textIndent: "-0.5ch", fontWeight: "bold" }}
+ >
+ :
+ </Text>
+ <Box css={{ color: "red" }}>
+ <AdvancedPropertyValue
+ autoFocus={autoFocus}
+ property={property}
+ onChangeComplete={onChangeComplete}
+ />
+ </Box>
</>
)}
</Flex>
diff --git a/packages/design-system/src/components/label.tsx b/packages/design-system/src/components/label.tsx
index f932f54b84..24389cc2fd 100644
--- a/packages/design-system/src/components/label.tsx
+++ b/packages/design-system/src/components/label.tsx
@@ -64,7 +64,7 @@ const StyledLabel = styled(RadixLabel, {
},
preset: {
backgroundColor: theme.colors.backgroundPresetMain,
- color: theme.colors.foregroundMain,
+ color: theme.colors.foregroundTextSubtle,
"&:hover": {
backgroundColor: theme.colors.backgroundPresetHover,
},