I've been attempting to integrate a Google font into the text found in a Material-UI DialogTitle component.
Here's my setup in App.module.scss:
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@1,600&display=swap');
$garamond: 'EB Garamond', serif;
.DialogTitle {
font-family: $garamond;
font-weight: normal;
font-size: 20px;
}
In App.tsx:
import s from "./App.module.scss";
import { Dialog, DialogTitle } from '@mui/material'
...
<Dialog>
<DialogTitle classes={{ root: s.DialogTitle }}>
Title
</DialogTitle>
</Dialog
Despite these stylings being set up, the customized font does not display. Interestingly, when I apply a color
attribute to the .DialogTitle
, it works fine. What could be causing this unexpected behavior?