Error in documentation of theme.breakpoints.down
See original GitHub issue- 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 😯
When I use this
const useStyles = makeStyles(theme =>
createStyles({
inner: {
color: "blue",
[theme.breakpoints.down("lg")]: {
color: "red"
}
}
})
);
then the generated CSS is this:
.makeStyles-inner-17 {
color: blue;
}
@media (max-width:1919.95px) {
.makeStyles-inner-17 {
color: red;
}
}
Expected Behavior 🤔
theme.breakpoints.value.lg equals 1280, so I expected the generated CSS to be like this:
.makeStyles-inner-17 {
color: blue;
}
@media (max-width:1280px) {
.makeStyles-inner-17 {
color: red;
}
}
Steps to Reproduce 🕹
Sandbox: https://codesandbox.io/s/nostalgic-frost-m8boc?file=/src/Demo.js
Steps:
- Move the border between the source code and the right part of the screen called “Browser”.
- Watch a red string that says “The current window width is 1400 … This string should be red when the width of the window is less than or equal to 1280.”
- Move the border so that the window becomes wider than 1920
- Watch the displayed string turn to blue.
Context 🔦
I am trying to design a responsive web page.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.11.0 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Error in documentation of theme.breakpoints.down #21892
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >Why the Theme breakpoints in MUI is not working?
In v5, ThemeProvider should be defined at the root of your application and useStyles should not be called before ThemeProvider.
Read more >Breakpoints - Material UI - MUI
API that enables the use of breakpoints in a wide variety of contexts.
Read more >How to use the @material-ui/core.useMediaQuery function in ...
To help you get started, we've selected a few @material-ui/core.useMediaQuery examples, based on popular ways it is used in public projects.
Read more >React-admin - Theming
For instance, you can have a look at the Datagrid CSS documentation. ... const isXSmall = useMediaQuery(theme => theme.breakpoints.down('xs')); ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hii @oliviertassinari i can i work on this .?
Oh, I see! Then, if both issues are resolved, everything will be fine, thanks!