Using material ui createStyles

前端 未结 1 1405
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 18:14

I\'m trying to transform my css from a less file to material createStyles and i can\'t get my head around how it works.

I understand the basics of the createstyles b

1条回答
  •  天涯浪人
    2020-12-21 18:34

    You want something like the following:

    const useStyles = makeStyles((theme: Theme) =>
      createStyles({
        missionStatus: {
          display: "flex",
          alignItems: "center",
          height: "34px",
          width: "100%",
    
          "& $missionStatusLibelle": {
            alignItems: "flex-start",
            justifyContent: "flex-start",
            marginLeft: "10px",
            fontSize: "14px",
            fontWeight: 500,
            lineHeight: "20px"
          }
        },
        missionStatusLibelle: {}
      }
    ));
    

    Here's the relevant documentation: https://cssinjs.org/jss-plugin-nested/?v=v10.0.0-alpha.24#use-rulename-to-reference-a-local-rule-within-the-same-style-sheet

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