After trying to attach the shadow root using the MUI createTheme
function, I encountered rendering issues. Despite following the instructions in this helpful guide on the MUI website, my problem persists.
// App.js
const cache = createCache({
key: 'css',
prepend: true,
container: shadowRoot,
speedy: false
})
return (
<StyledEngineProvider injectFirst>
<CacheProvider value={cache}>
<ThemeProvider theme={themes(customization)}>
<CssBaseline />
<NavigationScroll>
<Routes />
</NavigationScroll>
</ThemeProvider>
</CacheProvider>
</StyledEngineProvider>
);
// themes.js
const themeOptions = {
direction: 'ltr',
palette: themePalette(themeOption),
mixins: {
toolbar: {
minHeight: '48px',
padding: '16px',
'@media (min-width: 600px)': {
minHeight: '48px'
}
}
},
typography: themeTypography(themeOption)
};
const themes = createTheme(themeOptions);
themes.components = componentStyleOverrides(themeOption);
return themes;
// componentStyleOverrides
const shadowRoot = flowise.shadowRoot.querySelectorAll('#mountPoint')[0];
MuiCssBaseline: {
defaultProps: {
container: shadowRoot
},
styleOverrides: {
body: {
scrollbarWidth: 'thin',
scrollbarColor: theme?.customization?.isDarkMode
? `${theme.colors?.grey500} ${theme.colors?.darkPrimaryMain}`
.
.
.
Despite attempting to mount it in the shadow root, the solution still doesn't seem to be effective: