-
-
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
[Toolbar] Height should be 48px for Mobile Landscape #7454
Comments
The issue lies in the stylesheet, which makes no direct determination of mobile/desktop, but relies on the defined breakpoints. Below small, the device is considered mobile. Small and higher, the device is considered Tablet/Desktop: export const styleSheet = createStyleSheet('MuiToolbar', theme => ({
root: {
position: 'relative',
display: 'flex',
alignItems: 'center',
height: 56,
[theme.breakpoints.up('sm')]: {
height: 64,
},
},
gutters: theme.mixins.gutters({}),
})); In order to properly detect mobile landscape, where one of the dimensions falls below the small breakpoint, we'd have to consider the device height before specifying a toolbar height of 64. Perhaps some variant of the existing breakpoint implementation that optionally adds min-height to its media queries to constrain the other dimension, if necessary? Or, maybe we extend theme to include a new object, devices, that works similarly to breakpoints and uses media queries to determine which device type applies (given some assumptions with the current set of breakpoints)? Thoughts on this, @oliviertassinari? |
For reference, this is how material-components-web currently implements it: min-height: 64px;
@media (max-width: 959px)
and (orientation: landscape) {
min-height: 48px;
}
@media (max-width: 599px) {
min-height: 56px;
} |
I wish we could rely on material-components-web at some point. But given how different their styling solution is from ours, it might be simpler to take inspiration from their style. |
Sure, we could create a new abstraction. But that's gonna require some thought:
|
Problem description
https://material.io/guidelines/layout/structure.html#structure-app-bar
Currently, the toolbar uses the 'sm' width breakpoint, so the toolbar becomes 64px in landscape on mobile devices. According to the guidelines, it should be 48px.
Link to minimal working code that reproduces the issue
https://material-ui-1dab0.firebaseapp.com/component-demos/app-bar
Versions
The text was updated successfully, but these errors were encountered: