-
-
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
[CssBaseline] Persistent scrollbar in dark mode #23520
Comments
Related? #23407 |
Interesting. In my configuration of macOS, I force the scrollbar (why? to be closer to the UX end-users have on Windows), so I couldn't see this change of behavior when working on #23407. |
@eps1lon I start to think that https://github.com/mui-org/material-ui-x/issues/510 could be interesting. YouTube, Facebook, Gmail are using custom scrollbars. This is a strong signal. |
Having the same issue 😕 As soon as the scrollbars are styled with CSS, they are always visible on macOS, so I think this styling should be optional |
By default MacOS has auto hiding scrollbars and I believe most users will expect this behaviour. Since there's no way to un-do or override the |
Yeah ok, it seems too opinionated to be done by default for macOS users. Maybe an opt-out flag? @mbrookes would it work with you if we keep it enabled by default? |
Would OS detection be too icky? It's never going to be nice on Mac while it's enabled, and the system default scroll bar is perfectly fine for both light and dark mode, so Macs don't need the custom scrollbar styles. |
Well, I'm personally not using the autohide scrollbar feature of macOS, I like it just fine with the scrollbar always visible. Maybe because I was used to it for so many years on Windows. As far as I know, CSS OS detection isn't possible. So opt-in flag? Should we enable it for the docs? Note that we have also the same CSS logic applied on the DataGrid. It could be interesting to export the CSS object to not duplicate it. |
I meant in JS, to determine whether to apply the CSS, but... SSR
Preferably
I don't know. Just how bad do scrollbars look on Windows in dark mode? |
👍 for opt-in flag to preserve system-default behaviour. but definitely agree that scrollbars look bad on Windows, especially in dark mode. maybe there is a way to detect permanent scrollbar visibility and OS, then apply webkit styles. seems tricky though |
I want to emphasize that my main concern with scrollbars is scrolling performance. However, this is mainly an issue on mobile devices. I'm not aware of scrolling issues on desktop though it might be one. Scrolling is also a crucial part of the UX so any component needs thorough manual testing in different environments. Since this is integral to the documentation we can't just ship something we want users to test for us. So please consider how much you want to invest into "pretty scrollbars" and if it isn't more important that you can smoothly scroll. |
@mbrookes you can experience it with BrowserStack. It's significantly worse on Windows than it's on macOS with, at least, from my perspective. We can also weight the difference with the traffic coming from Windows vs. macOS, I haven't looked at the data but I imagine Windows is the dominant OS among developers. |
It seems we should just be using |
@mbrookes I don't understand. What's the link with color-scheme and native elements? |
Browsers set native element color (including scroll bar) according to the page meta or css color-scheme. |
https://material-ui.com/components/selects/
import { darkScrollbar } from '@material-ui/system';
const theme = {
components: {
MuiCssBaseline: {
styleOverrides: {
'@global': darkScrollbar(),
},
},
},
} A function we can then share with the data grid. |
I'm adding the "good to take" label to move forward with option 4. from #23520 (comment):
|
Any updates to this? Just upgraded to v5 (which we need for pickers fixes) and this will definitely block our launch. Happy to use any workarounds in the meantime. |
@dborstelmann What would be perfect is to execute on #23520 (comment). I'm not sure that there is an easy workaround. It requires resetting the CSS properties set back to their default. |
I'm not super familiar with how this works or I'd be happy to make a PR. Is it simple enough I can help out in some way? |
I see the code got added in #23407 but I'm not sure how to make that CSS change optional |
I think I can do #23520 (comment). I'll send a PR soon. |
Current Behavior 😯
Expected Behavior 🤔
Steps to Reproduce 🕹
Steps:
Your Environment 🌎
The text was updated successfully, but these errors were encountered: