I'm using mui 1.0.0-beta.33. I've got a wrapper around createMuiTheme, so that I can add a debugger line, or print out various things, as I try to update my local project. The 2 themes I have are only specifying palette.type = 'dark', or 'light'.
Those values however, don't get reflected into theme.palette.common, the white/dark values remainined unchanged. If I have placed my GridList onto Paper, that has set the background to pull from theme.palette.background.paper, then I would assume that GridList(and children) would also update?
The demo site at https://material-ui-next.com/demos/grid-list/ shows this problem. The styling of the overlayed text doesn't follow the theme.
Fyi, not all GridList use cases have images as their content, sometimes, it might just be random other stuff, that then has a background that inherits from something. Or perhaps there is no other content other than the TileBar.
For now, I've added a hack, that if palette.type === 'light', I swap white/dark, but that seems icky to me.
Tbh, this isn't really a GridList issue. but more that type is not auto-updating common?
The styling of the overlayed text doesn't follow the theme.
@eigood Why should it follow the theme?
Fyi, not all GridList use cases have images as their content, sometimes, it might just be random other stuff
Ok, this answers my previous question. I think that it's a good reason for nor to be smart about the display color. We don't know what people are going to put inside. Better having a deterministic behavior and let people override what they need for their specific context.
Tbh, this isn't really a GridList issue. but more that type is not auto-updating common?
It's not, and it will never be. The theme.palette.common values are constant.
So, if GridList(and children) use the hard-coded common values, then that means they don't change based on the theme. So now each and every single user of this library will need to override those values in their own themes(in palette), or creating wrapper components(HOC), or overriding classes. If everyone has to do it, then it most likely means a missing opportunity in the base.
If everyone has to do it, then it most likely means a missing opportunity in the base.
@eigood I agree, but it's a big if. What if nobody is facing this problem?
I have added the waiting for users upvotes tag. So please upvote this issue if you facing the same problem. We will prioritize our effort based on the number of upvotes.
Fyi, I have seen other components picking between white and dark, based on the type of the palette. I've had to look at much of the new source while doing a 0.20 conversion, as the docs are still lacking. That's how I've come to understand this particular issue.
Waiting for upvotes on a closed ticket seems counter productive?
Most helpful comment
@eigood I agree, but it's a big if. What if nobody is facing this problem?
I have added the
waiting for users upvotestag. So please upvote this issue if you facing the same problem. We will prioritize our effort based on the number of upvotes.