-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Add CodeSandbox/Stackblitz to the rest of the templates #43708
Conversation
@siriwatknp, these are the issues I found during my initial review. I won't dive too deep into visual tweaks for the templates, like the box-shadow on the marketing page appbar, since that's not the focus of this PR. I've kept the feedback primarily focused on layout and interaction issues based on
Screen.Recording.2024-09-11.at.08.57.18.mov
|
Question
I thought the idea was to have duplicate theme files so each template would have all the code. This way users can clone one template without having to navigate to the shared theme. Is this no longer the case? @zanivan Some issues found3. Stackblitx only: Sessions graph width not working as expected Screen.Recording.2024-09-12.at.09.42.37.mov |
This was the idea, as the only way users could get the templates before was by copying the folder from the project. However, integrating with CodeSandbox/StackBlitz solves this issue, since @siriwatknp packaged the shared theme within the template files when opened on either platform |
This makes sense. I'll leave it up to you to decide. I think we could be a bit more cautious: We have this new and improved way to use the templates with the sandboxes, and we should promote it, but it might not be best to "remove" the old way right away. There's no rush; we can wait and see how users react to this new system, and if it sticks, we can remove the old one (duplicated themes). If you decide to remove the duplicated files, then let's also remove the copying mechanism and CI check, which were added here: #43220 |
No strong opinion on this. Maybe we can wait until the feature to copy the theme to the clipboard is ready before removing the theme folders from the templates |
Thanks for pointing out. Let me clarify the removal of the duplicate theme. Using the shared-theme import has more benefits in several ways:
With all the above reasons, I don't see why we should keep the duplicated theme. |
This is a regression from #43632 due to |
Found the root cause, will open a separate PR but it's not related to this PR.
I could not see it in Chrome (in any templates), what's your browser and which template?
Added the toggle to Dashboard, Marketing, and Blog mobile viewport (only show when open with Sandboxes)
I fixed it by using a new
Improved, can you check it again. For "there are some bugs when clicking on it", I think it comes from the custom styles from the theme, can you try to fix it? |
@siriwatknp I tried to update the branch from upstream to get the changes from the light/dark background color PR #44059 to review the PR again, but noticed that doing this it also committed 170a9c9. Is this right? |
It's happening on Sign-in, Sign-up and Sign-in-side. I've tested on Arc (chrome), Firefox and Safari, and it happens in all of these browsers.
Will work on it 👍 |
@zanivan found the issue, it's fixed in the latest change. |
Awesome—I think we're almost there! I just have some small remarks:
|
@zanivan All fixed. There is one caveat for the images, when you open with CodeSandbox, the image will use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything design-wise for adding StackBlitz and CodeSandbox is covered—nice work, @siriwatknp! It might be good to get an engineering review before merging, though @DiegoAndai @aarongarciah
Side note: There are some design issues with the templates, but they aren’t directly related to the CodeSandbox/StackBlitz addition. I think it makes sense to address these in follow-up PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, I love to see this.
@@ -4,7 +4,7 @@ | |||
|
|||
<!-- #default-branch-switch --> | |||
|
|||
1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples). | |||
1. Copy these folders (`blog` and `shared-theme`) into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off-topic
We could provide a CLI script that does this. Related to #39588
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really dig this! I created a shaping page kind of related to this https://www.notion.so/mui-org/material-ui-Installation-CLI-e32438c1880c466c8b7075d289e825c4 I think it'd be really nice to have the templates as starting point for new projects.
@@ -1,11 +1,14 @@ | |||
import * as React from 'react'; | |||
import AppTheme from 'docs/src/modules/components/AppTheme'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we rename this? We have two AppTheme
in the React tree, and this component has nothing to do with theming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, seeing:
<AppTheme title="Onepirate theme - MUI" description="A onepirate theme"> |
- Could we also add a
title
to those template pages? This could be a better DX. - I believe we should also remove those
description
. What's the point, the page is<meta name="robots" content="noindex,nofollow" />
, it's absurd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we rename this? We have two
AppTheme
in the React tree, and this component has nothing to do with theming.
Thanks for the feedback but I would do it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense, it's already off in HEAD, not specific to this PR, so best to split the effort in smaller chunks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one small nit.
@@ -395,5 +395,9 @@ export const shape = { | |||
}; | |||
|
|||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: is this still required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's still required.
@zanivan lets remember to tweet about this when it releases 🙏🏼 |
Preview:
Follow up PR from #43604
🫣
theme.palette.*
to usetheme.vars.palette.*