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

Add global Reset CSS #10164

Merged
merged 3 commits into from
Aug 29, 2024
Merged

Add global Reset CSS #10164

merged 3 commits into from
Aug 29, 2024

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Aug 27, 2024

Problem

For new apps, developers need to reset the body margin manually, unless they use create-react-admin. This is cumbersome and, in many cases, leads to ugly admins because users have missed one step in the setup.

Solution

Use MUI's CssBaseline instead of ScopedCssBaseline.

This might be a breaking change in some very particular situations where react-admin is included in a div and some other content is rendered ion the same page.

How to test

Compile the create-react-admin package and use it to create a new app. Run the app. If should have correct margins.

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • [ ] The PR includes unit tests (only design)
  • [ ] The PR includes one or several stories (existing FullApp stories still work)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@fzaninotto fzaninotto added the RFR Ready For Review label Aug 27, 2024
@@ -1,7 +1,7 @@
import * as React from 'react';
import { createElement, ComponentType } from 'react';
import { CoreAdminUI, CoreAdminUIProps } from 'ra-core';
import { ScopedCssBaseline } from '@mui/material';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only code change of this PR

@slax57 slax57 added this to the 5.2.0 milestone Aug 29, 2024
@slax57 slax57 merged commit 1821c73 into next Aug 29, 2024
14 checks passed
@slax57 slax57 deleted the css-baseline branch August 29, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants