-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathStyledAccordion.tsx
More file actions
28 lines (26 loc) · 947 Bytes
/
StyledAccordion.tsx
File metadata and controls
28 lines (26 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { styled } from '@mui/material/styles';
import MuiAccordion, { AccordionProps } from '@mui/material/Accordion';
import MuiAccordionSummary, { AccordionSummaryProps } from '@mui/material/AccordionSummary';
export const StyledAccordion = styled(MuiAccordion)<AccordionProps>(({ theme }) => ({
border: `1px solid ${theme.palette.divider || 'rgba(0, 0, 0, .125)'}`,
'&:not(:last-child)': {
borderBottom: 0,
},
'&:before': {
display: 'none',
},
'&.Mui-expanded': {
margin: 'auto',
},
}));
export const StyledAccordionSummary = styled(MuiAccordionSummary)<AccordionSummaryProps>(({ theme }) => ({
backgroundColor: theme.palette.mode === 'dark' ? 'rgba(255, 255, 255, .05)' : 'rgba(0, 0, 0, .03)',
borderBottom: `1px solid ${theme.palette.divider || 'rgba(0, 0, 0, .125)'}`,
marginBottom: -1,
minHeight: 56,
'& .MuiAccordionSummary-content': {
'&.Mui-expanded': {
margin: '12px 0',
},
},
}));