-
-
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
[Tabs] Remove min-width media query #15824
Comments
@smeijer The title of the issue sounds reverse. We are using media queries right now, and you want to rely on JavaScript layout width computation to switch between the different breakpoints, right? |
@oliviertassinari, correct. I've updated the title. I think it should be more clear now. The problem of the media query is that it's based on the window size instead of the container size. I think this can give problems on other components as well, but it's the Tab's that caused me problems. Basically what I'm saying is, that I'm not sure if a component (Tabs in this case), should be basing it's display properties on the window size. It should make more sense if it's basing its properties on the element size. There are workarounds for this if we would want to stick to css media queries, for example with css-element-queries, but I'm not sure if that's the way to go and if it plays nicely with css-in-js. |
A quick follow up. Should we continue to follow your most recent recommendation to resolve this issue?
Or has the issue been resolved in the latest Thanks! |
@chrisVillanueva material.io mentions 90px as the min-width and 360px as the max-width. Its what Vuetify implements. It's not what Google and most of the design community tend to do (no min-width) but it seems to be already a great improvement (a smaller value, and no more media query). I think that we could solve this issue like this. |
@oliviertassinari |
Expected Behavior 🤔
Tabs should render in a certain style/layout, depending on the width of the
Tabs
(container), instead of depending on the width of the screen.Current Behavior 😯
Tabs base their width on the screen, and not on the tabs container.
Steps to Reproduce 🕹
Link present: https://x87uz.codesandbox.io/
Link editor: https://codesandbox.io/embed/materialuitabs-x87uz
TAB 1
andTAB 2
are visibleTAB 1
,TAB 2
,TAB 3
andTAB 4
are visible.The tab container is in both cases, 350 px wide.
Context 🔦
Tabs should render the same based on the width of the tab container. Material is often used and optimized for mobile layouts. This case confirms it.
What I'm doing, is rendering multi-column layout on desktop, and on mobile this translates to multiple single-column screens. So on desktop you would see column 1 + 2, while on mobile you see 1 or 2.
Thereby, my tabs are rendered in a single column, and on desktop optimized for a fixed width. While they scale to fullWidth on mobile.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: