In my Gatsby app I am using MUI v5, and must also output user created markup. I want the user-markup to get the same base-styles as their analogous Typography
elements (see below). How can I achieve this?
Note - the user markup already contains <p>
<h1>
or other tags, which cannot be directly modified by React.
Additionally the app is wrapped with ThemeProvider
and I'm using styled-components
as the style engine for MUI (if that matters...).
import {Typography} from "@mui/material"
export default function() {
return (
<>
<Typography variant="body1" paragraph>My styled Typography</Typography>
// The next line can't receive any classses or modifiers,
// but must end up styled like the <Typography> element.
<p>my custom user content - how can i style this like above?</p>
</>
)
}
` `
` or other markup tags that i can't modify with React - at best i could add styles to their parent... Is there a way to globally make all `
` etc. tags inherit `theme.typography.body1` ?
– dotist Nov 15 '21 at 06:40