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

[docs][material-ui] Revise and split up "Styled engine" doc #37774

Merged
merged 24 commits into from
Sep 5, 2023
Merged

[docs][material-ui] Revise and split up "Styled engine" doc #37774

merged 24 commits into from
Sep 5, 2023

Conversation

samuelsycamore
Copy link
Contributor

@samuelsycamore samuelsycamore commented Jul 1, 2023

This PR was initially created to address feedback about a typo on this page. I've been meaning to revise this doc for awhile now so this seemed like as good a time as any.

The original title "Styled engine" doesn't really tell the reader anything about the page's contents. The way I see it, the current version of the doc actually covers two different topics:

  • how to use styled-components instead of Emotion
  • how to use multiple styling solutions in a single project

As such, I'm proposing that we split this into two docs:

Beyond that, the changes here are mostly about copyediting.

@samuelsycamore samuelsycamore added docs Improvements or additions to the documentation package: material-ui Specific to @mui/material labels Jul 1, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
@samuelsycamore samuelsycamore marked this pull request as ready for review August 3, 2023 17:42
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

https://deploy-preview-37774--material-ui.netlify.app/material-ui/guides/multiple-styling-solutions/ feels like it cover the same content as https://deploy-preview-37774--material-ui.netlify.app/material-ui/guides/interoperability/, at least from the title.

We could rename "Working with multiple styling solutions" to be specific about Emotion, or move the content of the page to be under https://deploy-preview-37774--material-ui.netlify.app/material-ui/guides/interoperability/#emotion.

@samuelsycamore
Copy link
Contributor Author

@oliviertassinari hmm yeah that's a good point. The Interoperability doc needs heavy revisions as well (#38147), so I'll move this "multiple styling solutions" content over there for now, and we can come back to that doc in a future PR.

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 3, 2023

@samuelsycamore Another idea, what if instead, we were renaming the page "Theme scoping"? We have no other documentation about it. And in the style interoperability page, we could link it. It actually both covers Emotion and Styled-components.

@samuelsycamore
Copy link
Contributor Author

@oliviertassinari good call, I'll go with that—the Interoperability doc is already longer than we'd prefer (with a scrollbar in the table of contents).

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 9, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 9, 2023
@@ -20,7 +20,7 @@
"bugs": {
"url": "https://github.com/mui/material-ui/issues"
},
"homepage": "https://mui.com/material-ui/guides/styled-engine/",
"homepage": "https://mui.com/material-ui/guides/styled-components/",
Copy link
Member

@oliviertassinari oliviertassinari Aug 13, 2023

Choose a reason for hiding this comment

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

This link is wrong. The closest I can find is:

Suggested change
"homepage": "https://mui.com/material-ui/guides/styled-components/",
"homepage": "https://mui.com/system/getting-started/",

It's still wrong but the best I can find.

Same above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oliviertassinari Is there a use case for the styled-engine package other than swapping out Emotion for styled-components? It seems like the styled-components guide would still be the best place to direct a user who needs to know about this topic.

Copy link
Member

@oliviertassinari oliviertassinari Aug 17, 2023

Choose a reason for hiding this comment

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

The other use case is to:

  1. use its exported modules, the theme context, styled, global styles, etc. It's not a straight re-export of emotion. I think a lot more frequent that styled components swap.
  2. swapping for other style engines, but this was never implemented

@@ -112,7 +112,7 @@ npm install @mui/material @mui/styled-engine-sc styled-components
yarn add @mui/material @mui/styled-engine-sc styled-components
```

Visit our [`styled-engine` guide](https://mui.com/material-ui/guides/styled-engine/) for more information about how to configure `styled-components` as the style engine.
Visit our [styled-components guide](https://mui.com/material-ui/guides/styled-components/) for more information on configuration.
Copy link
Member

Choose a reason for hiding this comment

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

I think that the true location of this guide should be here:

Suggested change
Visit our [styled-components guide](https://mui.com/material-ui/guides/styled-components/) for more information on configuration.
Visit our [styled-components guide](https://mui.com/system/guides/styled-components/) for more information on configuration.

But we could say it's beyond the scope of this PR.

Comment on lines +86 to +90
+const withTM = require('next-transpile-modules')([
+ '@mui/material',
+ '@mui/system',
+ '@mui/icons-material', // If @mui/icons-material is being used
+]);
Copy link
Member

@oliviertassinari oliviertassinari Aug 14, 2023

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

docs/data/material/guides/theme-scoping/theme-scoping.md Outdated Show resolved Hide resolved
docs/data/material/guides/theme-scoping/theme-scoping.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 15, 2023
samuelsycamore and others added 2 commits August 17, 2023 14:56
Co-authored-by: Olivier Tassinari <[email protected]>
Signed-off-by: Sam Sycamore <[email protected]>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 17, 2023
@oliviertassinari oliviertassinari requested review from brijeshb42 and removed request for mj12albert and siriwatknp August 17, 2023 20:38
README.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 29, 2023
samuelsycamore and others added 2 commits September 1, 2023 16:42
Co-authored-by: Brijesh Bittu <[email protected]>
Signed-off-by: Sam Sycamore <[email protected]>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 1, 2023
@samuelsycamore samuelsycamore changed the title [docs] Revise and split up Material UI "Styled engine" doc [docs][material-ui] Revise and split up "Styled engine" doc Sep 1, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 3, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 5, 2023
Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

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

Reads clearly to me! 🤙

@samuelsycamore samuelsycamore merged commit e9bd183 into mui:master Sep 5, 2023
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Sep 8, 2023
Signed-off-by: Sam Sycamore <[email protected]>
Co-authored-by: Olivier Tassinari <[email protected]>
Co-authored-by: Brijesh Bittu <[email protected]>
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Sep 8, 2023
Signed-off-by: Sam Sycamore <[email protected]>
Co-authored-by: Olivier Tassinari <[email protected]>
Co-authored-by: Brijesh Bittu <[email protected]>
xcode-it pushed a commit to xcode-it/material-ui that referenced this pull request Sep 11, 2023
Signed-off-by: Sam Sycamore <[email protected]>
Co-authored-by: Olivier Tassinari <[email protected]>
Co-authored-by: Brijesh Bittu <[email protected]>
@samuelsycamore samuelsycamore deleted the styled-engine branch April 3, 2024 17:24
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: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants