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

[mui-system] Add import statement in docs #43223

Merged
merged 3 commits into from
Aug 12, 2024
Merged

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Aug 8, 2024

@sai6855 sai6855 marked this pull request as draft August 8, 2024 06:17
@mui-bot
Copy link

mui-bot commented Aug 8, 2024

Netlify deploy preview

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 68ea769

@sai6855 sai6855 added docs Improvements or additions to the documentation package: system Specific to @mui/system labels Aug 8, 2024
@sai6855 sai6855 marked this pull request as ready for review August 8, 2024 06:34
// If you are using @mui/material
import { styled } from '@mui/material/styles';
```

You can use the utility coming from the `@mui/system` package, or if you are using `@mui/material`, you can import it from `@mui/material/styles`.
Copy link
Member

Choose a reason for hiding this comment

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

Can we add the snippet after the explanation?

Copy link
Contributor Author

@sai6855 sai6855 Aug 8, 2024

Choose a reason for hiding this comment

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

The docs do have a "Basic usage" example here: https://deploy-preview-43223--material-ui.netlify.app/system/styled/#basic-usage. Are you imagining the snippet to be different from the "basic usage" code in some way?

Copy link
Member

@mnajdova mnajdova Aug 9, 2024

Choose a reason for hiding this comment

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

I just meant to add it after the text in the same section:

You can use the utility coming from the @mui/system package, or if you are using @mui/material, you can import it from @mui/material/styles.
The difference is in the default theme that is used (if no theme is available in the React context).

import { styled } from '@mui/system';
// If you are using @mui/material
import { styled } from '@mui/material/styles';

This order ☝️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: system Specific to @mui/system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants