From 142664479bbe52d1c952685899218b49144c6c88 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 30 Jan 2023 12:37:08 -0500 Subject: [PATCH] wrap field template so we can style with margin bottom --- .../carbon/FieldTemplate/FieldTemplate.tsx | 50 ++++++++++--------- .../src/themes/carbon/index.css | 7 +-- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/spiffworkflow-frontend/src/themes/carbon/FieldTemplate/FieldTemplate.tsx b/spiffworkflow-frontend/src/themes/carbon/FieldTemplate/FieldTemplate.tsx index 44b687ea3..b105e3edf 100644 --- a/spiffworkflow-frontend/src/themes/carbon/FieldTemplate/FieldTemplate.tsx +++ b/spiffworkflow-frontend/src/themes/carbon/FieldTemplate/FieldTemplate.tsx @@ -34,30 +34,32 @@ function FieldTemplate({ return
{children}
; } return ( - - - {children} - {displayLabel && rawDescription ? ( - - {rawDescription} - - ) : null} - {errors} - {help} - - +
+ + + {children} + {displayLabel && rawDescription ? ( + + {rawDescription} + + ) : null} + {errors} + {help} + + +
); } diff --git a/spiffworkflow-frontend/src/themes/carbon/index.css b/spiffworkflow-frontend/src/themes/carbon/index.css index 329bc33fd..72cdbb849 100644 --- a/spiffworkflow-frontend/src/themes/carbon/index.css +++ b/spiffworkflow-frontend/src/themes/carbon/index.css @@ -1,7 +1,3 @@ -button.react-json-schema-form-submit-button { - margin-top: 1.5em; -} - .rjsf .header { font-weight: 400; font-size: 20px; @@ -17,6 +13,7 @@ button.react-json-schema-form-submit-button { margin-bottom: 1em; } -.rjsf .input { +/* for some reason it wraps the entire form using FieldTemplate.jsx, which is where we added the rjsf-field thing (which is only intended for fields, not entire forms. hence the double rjsf-field reference, only for rjsf-fields inside rjsf-fields, so we don't get double margin after the last field */ +.rjsf .rjsf-field .rjsf-field { margin-bottom: 2em; }