-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Fix code copy button obscuring on small screen sizes #44861
[docs] Fix code copy button obscuring on small screen sizes #44861
Conversation
Netlify deploy previewhttps://deploy-preview-44861--material-ui.netlify.app/ Bundle size report |
@alexfauquette Could you review this? |
@@ -559,6 +559,9 @@ const Root = styled('div')( | |||
transition: theme.transitions.create(['background', 'borderColor', 'display'], { | |||
duration: theme.transitions.duration.shortest, | |||
}), | |||
'@media (max-width: 640px)': { |
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.
Why does it use a custom value? Meaning, why is this not using the theme breakpoints? I think deviations from the standard deserve code comments.
Is this solving the problem? For example: https://deploy-preview-44861--material-ui.netlify.app/material-ui/integrations/nextjs/#typescript Now, I guess it will always be a problem. If we have a toolbar, rendering the copy button there seems better, e.g. https://deploy-preview-44861--material-ui.netlify.app/material-ui/integrations/nextjs/#font-optimization-2 |
Base UI solved this problem by relying more on the header, e.g. https://base-ui.com/react/handbook/composition#composing-custom-react-components It's not ideal though, it's bulky to show that header when it has little use cases.
The problem we might have though now is: https://en.wikipedia.org/wiki/Region-beta_paradox 😄 |
Part of #43863, addressing point one.
The button can simply be hidden on smaller screens like for mobile. I considered 640px.