-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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-infra] Improve demo container and related components design #41827
[docs-infra] Improve demo container and related components design #41827
Conversation
Netlify deploy previewhttps://deploy-preview-41827--material-ui.netlify.app/ Bundle size report |
The only additional use case to consider is with multi-tab demos, the per-tab copy button lets you copy the content within a tab, whereas the copy button in the toolbar concatenates content in all tabs and copies it. If that's a low-enough value use case to lose, I see no other reason not to do this 👍🏻 |
About the use case of multiple tabs demo, we could bring back this button for multiple files demo only if it feel missing |
Oh, that's interesting! I think the ability to copy the code just from that tab or the entire code spanning multiple tabs is cool, and we should support it. I'm just not sure about the UX with the code block copy button doing the former and the toolbar copy button doing the latter. What bothers me is that they're visually the same, and there's no expectation set beforehand for the user. A solution that crossed my mind, and we can potentially explore this on @bharatkashyap's multi-tab demo PR, is that when that's the case, the copy button on the demo toolbar becomes a menu trigger that displays the two options: "Copy code from this tab" and "Copy code from all tabs". How does this sound? |
This PR primarily introduced a few color and border-related improvements. However, there's a functional change here that I want to highlight so reviewers can give me feedback: I've hidden the code copy button when a code block is within the demo container. That's because the demo toolbar already offers a copy button, and I've always found it to be a bit confusing to have both buttons with the same icon that seemingly does the same thing (unless that's not true).
So, in summary, the code block copy button will only appear if the code block is outside of a Demo container.
https://deploy-preview-41827--material-ui.netlify.app/experiments/docs/demos/