From e3b5b71120b7b1d241271da4abc52acc5d6d598d Mon Sep 17 00:00:00 2001 From: Jean-Marc Millet Date: Tue, 5 Nov 2024 16:14:41 +0100 Subject: [PATCH] remove padding on left for accordion content , add font to Accordion --- .../accordion/Accordion.component.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/components/accordion/Accordion.component.tsx b/src/lib/components/accordion/Accordion.component.tsx index 92652b23eb..2152793cec 100644 --- a/src/lib/components/accordion/Accordion.component.tsx +++ b/src/lib/components/accordion/Accordion.component.tsx @@ -15,6 +15,11 @@ export type AccordionProps = { style?: React.CSSProperties; }; +const AccordionContainer = styled(Box)` + width: 100%; + height: auto; +`; + const AccordionHeader = styled.button` -webkit-appearance: none; -moz-appearance: none; @@ -25,8 +30,9 @@ const AccordionHeader = styled.button` background-color: transparent; color: ${(props) => props.theme.textPrimary}; padding: 0; + font-family: 'Lato'; `; -const AccordionContainer = styled.div<{ +const AccordionContent = styled.div<{ isOpen: boolean; }>` overflow: hidden; @@ -38,7 +44,7 @@ const AccordionContainer = styled.div<{ visibility: ${(props) => (props.isOpen ? 'visible' : 'hidden')}; `; const Wrapper = styled.div` - padding: ${spacing.r8} 0 ${spacing.r8} ${spacing.r20}; + padding: ${spacing.r8} 0 ${spacing.r8} 0; `; export const Accordion = ({ title, id, style, children }: AccordionProps) => { @@ -53,7 +59,7 @@ export const Accordion = ({ title, id, style, children }: AccordionProps) => { }; return ( - +

{

- { if (isOpen) { element?.style.setProperty('height', element.scrollHeight + 'px'); @@ -93,7 +99,7 @@ export const Accordion = ({ title, id, style, children }: AccordionProps) => { role="region" > {children} - -
+ + ); };