mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
94.14k stars 32.35k forks source link

[theme] Improve the breakpoints values #21902

Closed mwskwong closed 3 years ago

mwskwong commented 4 years ago

According to the official https://material.io/design/layout/responsive-layout-grid.html#breakpoints, the breakpoints should be as follow:

xs: 0 - 600 sm: 600 - 1024 md: 1024 - 1440 lg: 1440 - 1920 xl: > 1920

Yet currently, MUI has the following as default xs: 0 - 600 sm: 600 - 960 md: 960 - 1280 lg: 1280 - 1920 xl: > 1920


Edit:

oliviertassinari commented 4 years ago

@matthewkwong2 Thanks for raising this issue, I have been keen to look into how we can improve the breakpoint values to better match the requirements of today's devices. IMHO we should partially ignore the recommendation of Material Design and look at what most teams use in their application/website, it will allow us to pick better values (crowd wisdom).

Design system benchmark

Device resolution benchmark

I figure the easiest would be to look at what Framer have, as I imagine they have spent quite some time thinking about what screen to optimize the design for:

Capture d’écran 2020-07-24 à 13 32 36 Capture d’écran 2020-07-24 à 13 32 45 Capture d’écran 2020-07-24 à 13 32 51

First proposal

I think that we should aim for matching regular devices sizes:

Note that the proposed breakpoints are designed to be divisible by 8 with a 0 rest (default grid is 4px) and to be divisible by 12 for the grid to have absolute values.

  breakpoints: {
    values: {
      xs: 0, // phone
      sm: 600, // tablets
      md: 900, // small laptop
      lg: 1200, // desktop
      xl: 1500, // large screens
    },
  },

More broadly, It would be great to hear change proposals from the community, especially around the why.

mwskwong commented 4 years ago

It might also be a good idea to take orientations into consideration. One example will be dynamically loading fullscreen backgrounds.

oliviertassinari commented 4 years ago

How would you take the orientation into account?

chrisVillanueva commented 3 years ago

Good afternoon.

Any progress on this issue? Has the team decided which breakpoints to support?

Thanks!

oliviertassinari commented 3 years ago

@chrisVillanueva So far, we are going with "First proposal".

siriwatknp commented 3 years ago

I propose the second option. The main reason is to not introduce high impact because it is a breaking change (if we do it for v5).

I assume that most of the project implement responsive from xs-lg. I propose that the change only affect lg-xl like this xs: 0 - 600 (same as v4) sm: 600 - 960 (same as v4) md: 960 - 1280 (same as v4) lg: 1280 - 1536 (changed) xl: > 1536 (changed)

This should affect only projects that support extra large screen.

1536 is divided by 12 and tailwindcss is using it.

oliviertassinari commented 3 years ago

@siriwatknp Thoughts:

https://github.com/mui-org/material-ui/blob/9acf8be6d2fd08210665c294830df3c85c014214/docs/src/modules/branding/BrandingRoot.tsx#L104-L112

siriwatknp commented 3 years ago

Okay, let's move forward with proposal 1 (but with xl: 1536). will open a PR soon.