-
-
Notifications
You must be signed in to change notification settings - Fork 411
[DashboardLayout] Highlight and text alignment for mini #4844
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
[DashboardLayout] Highlight and text alignment for mini #4844
Conversation
Netlify deploy preview |
@@ -287,9 +287,9 @@ function DashboardSidebarSubNavigation({ | |||
sx={{ | |||
position: 'absolute', | |||
bottom: -18, | |||
left: '50%', | |||
left: '45%', |
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 wouldn't change this, this is what is centering the text and it goes together with transform: 'translateX(-50%)'
below.
And also the font size shouldn't be what is causing the issue and it shouldn't be changed unless necessary.
Can we not just set a minimum width somewhere so that the scrollbar doesn't make things narrower?
The current changes are only trying to disguise the problem but the content is not centered.
I can take a deeper look if it helps.
@apedroferreira I've changed the solution to use the Screen.Recording.2025-04-16.at.2.08.56.PM.mov |
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.
This seems a lot better, thanks a lot for the changes!
Looks like there's a horizontal scrollbar when the sidebar is in mini mode now: https://deploy-preview-4809--mui-toolpad-docs.netlify.app/toolpad/core/react-dashboard-layout Maybe it'll be fixed if we remove a few pixels from the width? |
We could do that or hide scrollbars on the container nav of the list, which approach do you think makes more sense? Either make sense to me, although the |
I would try to figure out why there is an overflow now - if it's related with having set a width in the items, I would try to fix something related to that. I don't mind taking a look soon. |
The scrollbar is due to providing an explicit width to the list now - reducing the width makes the scrollbar go away but I haven't tested this fix rigorously over all device sizes. I can open a PR with that fix and you can take it forward/review it |
Fix Sidebar selected item styling misalignment when scrollbar appears in collapsed state #4835
use the
MINI_DRAWER_WIDTH
for theul
and passingscrollbar-gutter: stable
to thenav
whenisMini
is set, everything being the same in all other modes.Screen.Recording.2025-04-16.at.2.08.56.PM.mov