After switching from @material-ui to @mui theme is not applied

Viewed 84

I began my project using @material-ui package and created a theme that was applied to my app properly

After switching to @mui theme is not applied anymore

theme definition:

import { createTheme } from '@mui/material/styles';
import "./fonts/fonts.module.css";

export const theme = createTheme({
    palette: { ... },
    shadows: ["none"],
    typography: {
        fontFamily: ...
        button: {
            textTransform: "none"
        },
        htmlFontSize: 16,
    },
    components: {
        MuiCssBaseline: {
            styleOverrides: {
                fontFamily: "LatoLatinWeb"
            }
        }
    }
});

Usage in MyComponent:

import { ThemeProvider } from "@mui/material/styles";
import { theme } from "../theme";
import { CssBaseline } from '@mui/material';


const MyComponent = () => {
    ...

    return (
        <ThemeProvider theme={theme}>
            <CssBaseline/>
            {children}
        </ThemeProvider>

How can I fix this so the theme is applied?

0 Answers
Related