You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents from changing colors globally across a Dash application. We should figure out a way to set a global (perhaps, unfortunately, window) variable(?) that allows for these components to grab the same styles object, if the Dash developer wants to modify the base theme.
Create a "MuiThemeable" Dash component that takes props and updates something like window.__sdMuiThemeable.
Have each Dash component instead of the current approach
importMuiThemeProviderfrom'material-ui/styles/MuiThemeProvider';importgetMuiThemefrom'material-ui/styles/getMuiTheme';constmuiTheme=getMuiTheme(<NAMEOFTHEME>);
const Main = () =>(<MuiThemeProvidermuiTheme={muiTheme}><AppBartitle="My AppBar"/></MuiThemeProvider>
);
use the global theme object by combining the two theme objects, like:
importMuiThemeProviderfrom'material-ui/styles/MuiThemeProvider';importgetMuiThemefrom'material-ui/styles/getMuiTheme';constmuiTheme=getMuiTheme(<NAMEOFTHEME>);
const Main = () =>(<MuiThemeProvidermuiTheme={myCombineFunc(muiTheme,window.__sdMuiThemeable)}><AppBartitle="My AppBar"/></MuiThemeProvider>
);
This will require an additional component (the MuiThemeable Dash component), as well as a function to combine the two theme objects (this would likely be _.merge from lodash.
The MuiThemeable Dash component would look something like:
Right now, each component gets its own
MuiThemeProvider
like:https://github.com/StratoDem/sd-material-ui/blob/v1.7.5/src/components/SDDialog.react.js#L90-L100
This prevents from changing colors globally across a Dash application. We should figure out a way to set a global (perhaps, unfortunately,
window
) variable(?) that allows for these components to grab the same styles object, if the Dash developer wants to modify the base theme.See here for more on customizing the theme.
The text was updated successfully, but these errors were encountered: