css pseudo selectors with material-ui

后端 未结 1 1190
故里飘歌
故里飘歌 2021-02-06 22:49

I have seen in a lot of the material-ui code that they use pseudo selectors in their react styled components. I thought I would try to do it myself and I cannot get it to work.

1条回答
  •  既然无缘
    2021-02-06 23:38

    I found out that the content attribute needed to be double quoted like this

    const styles = () =>
      createStyles({
        h: {
          '&::before': {
            content: '"some content"',
            display: 'block',
            height: 60,
            marginTop: -60
          }
        }
      });
    

    and then everything worked like expected

    0 讨论(0)
提交回复
热议问题