Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set custom theme #9191

Closed
1 task done
Milos5611 opened this issue Nov 17, 2017 · 1 comment
Closed
1 task done

Unable to set custom theme #9191

Milos5611 opened this issue Nov 17, 2017 · 1 comment
Labels
support: question Community support but can be turned into an improvement

Comments

@Milos5611
Copy link

Milos5611 commented Nov 17, 2017

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I want to add some custom colors as primary for theme.

Current Behavior

Updating theme with custom color not possible. New object is updated with new color but theme property not get updated.

Steps to Reproduce (for bugs)

I call createMuiTheme method and pass object

const default_theme_obj = {
    fontFamily: "Roboto, sans-serif",
    palette: {
        primary: "#fff"
    },
};

but when i pass it as theme={default_theme_obj} to MuiThemeProvider nothing happen, it still have default MUI theme colors. This is exacly how it was worked it v0.19.

Context

I expect that theme is updated with new color set as primary.
My app have several different theme depend on user role. When user is on login page default should be applied with color from DEFAULT_THEME object and when user get access he also get theme from DB which is applied to MUI. It was working really well in v0.19 but when i switch MuiProvider is never updated.

Your Environment

Tech Version
Material-UI 1.0.0-beta.20
React 16.1.1
browser all
@oliviertassinari oliviertassinari added the support: question Community support but can be turned into an improvement label Nov 17, 2017
@oliviertassinari
Copy link
Member

Have a closer look at the documentation and the warnings in your console. The theme colors with Material-UI are rich objects containing hues (#xxxxxxx).
Follow #8075 for a better story on this end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

2 participants