Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const GlobalSheshaStyles = createGlobalStyle`
font-weight: bold;
}
.${(p) => p.theme.prefixCls}-form-item {
margin: 0 !important;

.${(p) => p.theme.prefixCls}-row {
&.${(p) => p.theme.prefixCls}-form-item-row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const useStyles = createStyles(({ css, cx, token }) => {
}
}

.ant-form-item {
margin: 0px !important;
}
Comment on lines +36 to +38
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Scope this margin reset to the js-style preview wrapper only.

Line 36 now matches every Ant Form.Item in the properties tabs. SettingsFormItem renders regular settings controls as plain Form.Items, so this removes the default vertical spacing for the whole panel, not just the preview rows this fix is targeting. Please narrow the selector to the preview-specific wrapper (.sha-js-label / the ConfigurableFormItem root) instead of all .ant-form-items.

Example of a safer scope
-    .ant-form-item {
-      margin: 0px !important;
-    }
+    .sha-js-label,
+    .sha-js-label .ant-form-item {
+      margin: 0 !important;
+    }

Based on learnings: "dimension and margin handling follows a wrapper-based pattern: the FormItem wrapper (ConfigurableFormItem) is responsible for applying dimensions, margins, and layout styles..."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.ant-form-item {
margin: 0px !important;
}
.sha-js-label,
.sha-js-label .ant-form-item {
margin: 0 !important;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/designer-components/propertiesTabs/style.ts` around lines
36 - 38, The global reset targeting `.ant-form-item` is too broad; narrow it to
only the JS-style preview wrapper by changing the selector to scope under the
preview root (e.g., target `.sha-js-label .ant-form-item` or the
`ConfigurableFormItem` root like `.ConfigurableFormItem .ant-form-item`) so only
preview rows lose the margin without affecting `SettingsFormItem` or other
Form.Item instances in the properties panel.


* > .sha-required-mark {
margin-left: 4px;
color: ${token.colorErrorText};
Expand Down