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

[RFR] Fix Layout styles can't be overridden by theme #4382

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

leonidasv
Copy link
Contributor

Right now, it's not possible to target the Layout component via a custom theme.

This PR aims to fix that, thus making code like the following work:

const theme = createMuiTheme({
  overrides: {
    RaLayout: {
      root: {
        display: 'contents'
      },
      appFrame: {
        marginTop: '5rem'
      }
    }
  }
});

export default function Home() {
  return (
    <Admin theme={theme}>
      {/* your Resources here */}
    </Admin>
  );
}

Otherwise, you would need to create a custom <Layout /> component using withStyles() to merge the changes and pass this custom component to the <Admin /> component.

@fzaninotto fzaninotto merged commit bc159e6 into marmelab:master Feb 7, 2020
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 3.2.1 milestone Feb 7, 2020
@fzaninotto fzaninotto changed the title [RFR] Add name property to Layout [RFR] Fix Layout styles can't be overridden by theme Feb 7, 2020
@leonidasv leonidasv deleted the patch-1 branch February 7, 2020 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants