I have been refering to the following resources:
- Learn about customizing login page background in React-Admin:
- Explore themes customization in Material-UI: https://material-ui.com/customization/components/
Instead of using a preset background, I want to modify the CSS styles property located in
which currently includes:ra-ui-materialui/src/auth/Login.tsx
const useStyles = makeStyles(
(theme: Theme) => ({
main: {
backgroundImage: 'radial-gradient(circle at 50% 14em, #313264 0%, #00023b 60%, #00023b 100%)',
},
}),
{ name: 'RaLogin' }
);
As per Material-UI documentation (https://material-ui.com/customization/components/#global-theme-override), it can be customized like this:
import { createMuiTheme } from '@material-ui/core/styles';
import pink from '@material-ui/core/colors/pink';
/**
* @public
* @name theme
* @description
* Application material ui main theme, read more at https://material-ui.com
* It is used to configure the spacings, colors, fonts and components of the application
* @type {object}
*/
const theme = createMuiTheme({
overrides: {
RaLogin: {
main: {
backgroundImage: 'radial-gradient(circle at 50% 14em, #ff0000 0%, #ff0000 60%, #ff0000 100%)',
},
}
},
});
The React-Admin documentation explains how to implement an image by passing the props backgroundImage
to <Login />
, but my requirement is different.
Is there a way to edit the login background in Material-UI/React-Admin?