材质 UI withstyles last-of-type css 伪选择器无法应用

时间:2020-12-21 07:01:28

标签: reactjs css-selectors material-ui

我需要我的最后一个 CustomizedAccordionSummary 组件没有 borderBottom,所以我在根目录中使用了 :last-of-type 伪选择器,但它不起作用。

最后一个 Accordionsummary 仍然有蓝色边框,我正在努力摆脱它。 Image of all 4 accordions stacked on top of each other

export const CustomizedAccordionSummary = withStyles({
    root: {
      backgroundColor: '#131D47',
      borderBottom: '3px solid #52B9FF',
      marginBottom: -1,
      minHeight: 56,
      '&$expanded': {
        minHeight: 56,
      },
      '&:last-of-type':{
      borderBottom:'0px',
    },
      justifyContent:'flex-start',
    },
    content: {
      flexDirection:'row',
      flexGrow:0,
      '&$expanded': {
        margin: '12px 0',
      },
      order:1,
      flexBasis:'28%',
    },
    expanded: {
      borderBottom:'0px',
    },
    expandIcon: {
      color:'#FD8329',
      '& svg':{
        fontSize:48,
      },
      '&$expanded': {
        transform: 'rotate(-90deg)',
      },
      order:2,
    }
  })(MuiAccordionSummary);

0 个答案:

没有答案