我想用Mui样式的工具覆盖 accordion 式CSS,但是我无法将 accordion 式CSS应用到它上面。在我的代码中有一个底层类,我无法指向它。这是Mui类:
<div class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiAccordion-root MuiAccordion-rounded MuiAccordion-gutters css-1elwnq4-MuiPaper-root-MuiAccordion-root" style="user-select: auto;">
这是我的 accordion 代码
const CustomizedAccordion = styled(Accordion)<AccordionProps>(({ theme }) => ({
root: {
"& .MuiPaper-root": {
color: 'darkslategray',
backgroundColor: '#E4FAF4',
borderRadius: '0.6rem',
boxShadow: 'none'
}
},
paddingBottom: '1.6rem',
boxShadow: 'none',
}));
2条答案
按热度按时间q43xntqr1#
t98cgbkg2#
我想把扩展样式从代码为
.css-kj1tus-MuiPaper-root-MuiAccordion-root.Mui-expanded { margin: 16px 0; }
的样式修改为margin:0px 0px 0px 4px
;但是,无法使它工作。