Skip to content

Commit

Permalink
10339: accordion styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Rogers committed Sep 17, 2024
1 parent a5e1fac commit c5092f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 6 additions & 3 deletions web-client/src/styles/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1385,12 +1385,10 @@ hr.lighter {
font-size: 20px !important;
}


.usa-accordion__heading:not(:first-child) {
margin-top: 1rem;
}


.all-columns-view {
column-count: 4;

Expand Down Expand Up @@ -2408,4 +2406,9 @@ button.change-scanner-button {
.accordion-title {
padding-top: 24px;
padding-bottom: 24px;
}
}

.padding-0 {
// This has higher importance than uwds padding-0
padding: 0;
}
16 changes: 11 additions & 5 deletions web-client/src/ustc-ui/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ export const Accordion = ({

export const AccordionItem = ({
children,
className,
contentClassName,
headerClassName,
initiallyOpen = false,
title,
}: {
initiallyOpen?: boolean;
className?: string;
headerClassName?: string;
contentClassName?: string;
children: ReactNode;
title: string;
}) => {
Expand All @@ -41,11 +43,15 @@ export const AccordionItem = ({

return (
<>
<h3 className="usa-accordion__heading">
<h3 className={classNames('usa-accordion__heading')}>
<button
aria-controls={id}
aria-expanded={isOpen}
className="usa-accordion__button"
className={classNames(
'usa-accordion__button',
'accordion-title',
headerClassName,
)}
onClick={() => {
setIsOpen(!isOpen);
}}
Expand All @@ -54,7 +60,7 @@ export const AccordionItem = ({
</button>
</h3>
<div
className={classNames('usa-accordion__content', className)}
className={classNames('usa-accordion__content', contentClassName)}
hidden={!isOpen}
id={id}
>
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/Dashboards/FilingFeeOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const FilingFeeOptions = function () {

<Accordion>
<AccordionItem
contentClassName="bg-gray padding-0"
contentClassName="bg-gray padding-x-0"
headerClassName="padding-0"
title="Other options"
>
Expand Down

0 comments on commit c5092f2

Please sign in to comment.