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

Cannot override RaLogin theme #6654

Closed
davidhenley opened this issue Oct 6, 2021 · 5 comments · Fixed by #6762
Closed

Cannot override RaLogin theme #6654

davidhenley opened this issue Oct 6, 2021 · 5 comments · Fixed by #6762

Comments

@davidhenley
Copy link
Contributor

davidhenley commented Oct 6, 2021

I have my theme setup but the override isn't working. I still see the original radial gradient. The palette is working but not the override.

const theme = createTheme({
  palette: {
    primary: {
      main: '#995057'
    },
    secondary: {
      main: '#7A1130',
    },
  },
  overrides: {
    RaLogin: {
      main: {
        backgroundImage: 'none',
      },
    }
  }
});

<Admin theme={theme}>
@davidhenley
Copy link
Contributor Author

davidhenley commented Oct 27, 2021

@fzaninotto @djhi? This is the only override that isn't working like the others.

@djhi
Copy link
Collaborator

djhi commented Oct 28, 2021

Thanks for reporting this. Please provide a sample application showing the issue by forking the following CodeSandbox (https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple).

@davidhenley
Copy link
Contributor Author

@djhi
Copy link
Collaborator

djhi commented Oct 28, 2021

Reproduced, thanks! To fix that, we must split the Login component in two parts:

  • one to set the ThemeProvider
  • the other which would render the actual content

That's because you can't set the ThemeProvider and use it in the same component

@davidhenley
Copy link
Contributor Author

Thanks guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants