Yuisei-Maruyama / MyPortfolio

This is my portfolio.
1 stars 1 forks source link

CSSのスタイルを変更できない #62

Closed Yuisei-Maruyama closed 2 years ago

Yuisei-Maruyama commented 2 years ago

下記のような形で記述しても、反映されない。  

<StepLabel sx={{ color: "white" }}>{label}</StepLabel>

スクリーンショット 2022-01-02 7 26 30

Yuisei-Maruyama commented 2 years ago

解決方法

material UI の style から下記のようにデフォルトスタイルを書き換える。

import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'

const useStyles = makeStyles((theme: Theme) =>
  createStyles({
    root: {
      "& .MuiStepLabel-label.Mui-active": { color: "white" },
      "& .MuiStepLabel-label.Mui-completed": { color: "white" },
      "& .MuiSelect-icon": { color: "white" }
    }
  })
)

const Stepper: React.FC<Props> = (props: Props) => {

  const classes = useStyles()

  return (
    <StepLabel className={classes.root}>{label}</StepLabel>
  )