0

I define theme for typography but font family of Mui buttons, don't change.

 typography: {
fontFamily: ["Baloo Bhaijaan 2", "cursive"].join(", "),
button: {
  fontFamily: "Baloo Bhaijaan 2",
  fontWeight: 500,
  color: "#ffffff !important",
},

},

Amir Rezaie
  • 43
  • 1
  • 11
  • Does this answer your question? [Changing font family of all MUI components](https://stackoverflow.com/questions/48319372/changing-font-family-of-all-mui-components) – C. Helling Aug 11 '22 at 21:56
  • When you specify the font-family in the `typography` object it should be inherited also in the Button component. But even that, your code should work. Have you checked if you are importing the font family in the right way? What you see when you inspect the Button component? – Akis Aug 11 '22 at 22:58

1 Answers1

1

This modified example is provided in the MUI docs for customizing components in Material-UI version 5:

const theme = createTheme({
  components: {
    // Name of the component
    MuiButton: {
      styleOverrides: {
        // Name of the slot
        root: {
          // Some CSS
          fontFamily: "Baloo Bhaijaan 2",
          fontWeight: 500,
          color: "#ffffff !important"
        },
      },
    },
  },
});

kofeigen
  • 1,331
  • 4
  • 8