Skip to content
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

theme breakpoint for sm uses 960px instead of 600 #19357

Closed
2 tasks done
danielo515 opened this issue Jan 23, 2020 · 6 comments
Closed
2 tasks done

theme breakpoint for sm uses 960px instead of 600 #19357

danielo515 opened this issue Jan 23, 2020 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@danielo515
Copy link

I see that breakpoint function of the theme is not using the correct width pixels.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The following style object:

 [theme.breakpoints.down('sm')]: {height: 400}

Produces the followingn rule:

@media (max-width: 959.95px)
.makeStyles-fixedHeight-285 {
    height: 400px;
}

Expected Behavior 🤔

I expected the used value to be 600px and not 959

Steps to Reproduce 🕹

Here is a small sandbox to demonstrate it:

https://codesandbox.io/s/elated-hoover-sldxi

Context 🔦

According to docs, sm breakpoint should be 600px

Your Environment 🌎

Tech Version
Material-UI v4.9.0
@Studio384
Copy link
Contributor

You are looking for xs. down('sm') is "everything that is sm or lower". sm is 600px until 959.95px. This is the expected behavior. If down('sm') would be everything below 600px, then there is no way to select the largest breakpoint (because down('xl') would select lg) and xs would have to select everything below 0px.

@danielo515
Copy link
Author

xs is translated to 0, which is completely useless.
There is no way to target from 600px to 0 ? From your comment I suggest that down('xs') should give me what I expect, but instead it is translated to 0

@danielo515
Copy link
Author

Well, I took another look at my sandbox and down('xs') is behaving as expected. I'll try on my actual app and close this issue.

Thanks for the clarification.

@oliviertassinari oliviertassinari added the duplicate This issue or pull request already exists label Jan 24, 2020
@mustafa-hanif
Copy link

You are looking for xs. down('sm') is "everything that is sm or lower". sm is 600px until 959.95px. This is the expected behavior. If down('sm') would be everything below 600px, then there is no way to select the largest breakpoint (because down('xl') would select lg) and xs would have to select everything below 0px.

The documentation convey this very badly

@oliviertassinari
Copy link
Member

@mustafa-hanif Check the docs in v5, we have changed the behavior.

@oliviertassinari
Copy link
Member

Duplicate of #13448

@oliviertassinari oliviertassinari marked this as a duplicate of #13448 Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants