-
-
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
[material-ui][docs] Refine the free templates page #41469
Comments
#41947 was a short term solution for dark/light theme switching in the templates' page. However, a long term solution would be to have a script that generates these images automatically, like we have for Joy UI. @siriwatknp can you help me with this? |
@oliviertassinari I'll answer the items here, to make things more organized, since this issue is to track the improvements for template's page—feel free to add items or ideas here as well 💙 about #41757 (comment):
Is this related to https://mui-org.slack.com/archives/C061V6JNZ9Q/p1708354100659669 somehow? If so, what would be the best file structure in your opinion?
The only different theme is the Dashboard. This is because the approach for the other templates was more focused on following marketing UI trends. For the Dashboard, the theme design is lighter and more sober, as it is intended for SaaS and tooling. |
Mixed feelings about this one—I'm not sure about this. I think having everything on one gigantic file is much harder to deal with. Even if you're copying the whole template to use it almost without any customizations, it will be very hard to find yourself amidst a file that will very likely have thousands of lines if you want to change just the logo or a little icon or anything like that. |
@zanivan Right, it sounds related. For the theme file, I agree, I think it should be separate from the template files. I was more thinking of https://github.com/mui/material-ui/tree/v5.15.19/docs/data/material/getting-started/templates/dashboard. It feels a bad DX. @mbrookes added this back in the days with #12410. It's infinitely better than nothing, but when compared to some of the other options out there, I don't see how we can make accessing the source of templates from the GitHub UI a great DX.
It reminds me of https://www.notion.so/blog/migrating-notion-marketing-to-next-js "It got to a point where we felt our entire codebase would be easier to maintain by splitting the app and marketing site apart". But I don't know, it feels like Notion's engineering team gave up, running out of time, they took the technical/design dept path. If Vercel can use the same Tailwind CSS config for its marketing and dashboard app, the same theme could work? Now, if we have a base theme, and an extension of it with small tweaks depending on the case, I think this could work close enough.
@danilo-leal It's easier for me to search in one file than multiple, and I know I will need to use the search feature no matter what. So I would have a better time with one big file. |
Sure thing! I think both themes can work for both applications (and an e-commerce template in the future) if we polish them. Since I have already designed the two themes, we can have a theme selector with the default style plus these two options. Maybe we can call one 'Sober' and the other 'Sleek' (inspired by the Base UI marketing page 😅).
In this case, I believe that if we design the experience well enough, we can provide both options. I created an example where we can have a complete theme file with all styles that can be copied to the clipboard, and a button to access the template folder, with a well-organized and structured project. In this prototype, we can offer a more scalable experience for the templates, as well as a better UX and DX (Figma prototype). Besides, these prototypes fulfill almost all the tasks in this issue. |
@zanivan So we would have 3 themes? I think it's the same problem, but a 3rd one feels like a distraction. I think developers should be able to see Material UI and what will be the second theme as part of their options for the templates. If we want to have a landing page mode for the theme, then fair enough, why not. I would try to avoid this as much as possible though. In the past, I solved this problem with one theme and variants.
I don't know how we can organize the code, it feels like it depends on each developer's use case. The organization in https://github.com/mui/material-ui/tree/v5.15.19/docs/data/material/getting-started/templates/dashboard feels not helpful to me. The first thing I would do might be to put everything back into one file, and then split based on what I need to build. For example, I would create something for the navigation, so I can share this layout between multiple pages. If the template/block become really complex, then yes, makes sense to me, like https://github.com/tremorlabs/template-dashboard-oss but at this point, it's has grown to something beyond the purpose of the free templates. |
I don't know if I captured your idea correctly—please feel free to correct me if not—, but I actually think it's easier to build more themes (obviously after building the first one very well) than to add variants to the themes. This is because, with our current setup, to work with the default MD theme, the template itself doesn't have extra styles, tokens, or variants from other themes. It only has different values for the existing variables in the theme and In this case, if we did something like So, I think the ideal approach right now is to refine the two existing themes (dashboard and marketing) and merge them into a single theme that meets both needs. Does it make sense? |
I can help with this. |
I have just tried to compare the experience between v5 and v6 as a user who needed to quickly start a project and test the performance. I felt point 16.
The experience of copying the source was better before. |
Thanks for the feedback! The previous experience, with all the code in the same file, was indeed better for copying and pasting. It’s on my roadmap, along with adding StackBlitz/CodeSandbox support (item 23). With the new appbar, it’s possible to include buttons for both things (copy theme and open in CodeSandbox) |
Oh actually, @romgrk tried this user flow too in: emotion-js/emotion#3242 (comment)
I'm curious about the friction point he got along the way. |
I reached out to @siriwatknp for help, and we’ll be working on this next week, exploring what we can offer to users. IMO we could support both structures and give users the option to either copy the entire code at once or download the project folder with the current theme structure. |
@zanivan True, this shouldn't too hard to do. We can use the same dependency as used by the live demo editor to resolve the dependencies. We add analytics to see how people use both, and we will learn from it. |
Friction was ok, had to |
@zanivan let's add a task to refactor the theme to use the new |
@zanivan, let's add #43514 (review) as well (and other shared components). @siriwatknp also had some ideas on tasks to add to which he wanted to contribute to. |
@DiegoAndai added ✅ @siriwatknp let's pop some time in the calendar next week to organize the ideas 😊 |
I will start working on task 23 (CodeSandbox) and 25 (Refactor the theme to use the new colorSchemes API (based on #41469 (comment))) #43604 Can you explain the task 16? It's not clear to me what exactly are the sources (the whole template files or theme files). |
@siriwatknp just documenting the things we've discussed in the meeting to have it here too, feel free to edit it and add stuff :) Add support for
|
Summary
After wrapping up the first round of design refresh that this #37555 issue is going for, we'll do a global revision so that every template feels like part of a single app. So, this issue gathers small adjustment opportunities that have surfaced through working on all templates so far.
Tasks
styled
component. [material-ui][docs] Simplify components styling on templates #41845For example https://ui.shadcn.com/blocks
paper
component and its usage (removebackground-image
and usebackground-color
) [material-ui] Refine and unify custom template themes #43220Screen.Recording.2024-06-10.at.18.14.18.mov
More generally, @oliviertassinari thinks that having this type of layout https://blocks.tremor.so/templates would be amazing, I would want to use this 👌✨:
More context on why it could be valuable: #14604. It becomes something they can then just click on export, and have it working as a starting point.
But to look at the GA event first on Joy UI to see the use. It's only a guess, maybe nobody uses it.
24. Add tokens for the 25 shadow levels so it won't spread strings into arrays, and result in many 1-character strings in the target array (reported on [docs][material-ui] Fixed incorrectly spread shadows in templates #43369, decision made on [docs][material-ui] Fixed incorrectly spread shadows in templates #43369 (comment))
25. Refactor the theme to use the new
colorSchemes
API (based on [material-ui][docs] Refine the free templates page #41469 (comment))26. Share the TemplateFrame files through all templates
Fix [material-ui] Sign-in template improvements #42609
Search keywords
template
The text was updated successfully, but these errors were encountered: