Unable to customise theme breakpoints
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 😯
No longer able to customise theme breakpoints.
Expected Behavior 🤔
Be able to import the BreakpointOptions
type from core and use it to pass in custom breakpoints to theme.
Steps to Reproduce 🕹
https://codesandbox.io/s/basicalerts-material-demo-forked-7qnte?file=/demo.tsx:9-27
import { BreakpointsOptions } from "@material-ui/core/styles/createBreakpoints";
const getBreakpoints = (theme: CustomerUITheme): BreakpointsOptions => ({
values: theme.breakpoints,
});
shows error Cannot find module '@material-ui/core/styles/createBreakpoints
there doesn’t appear to be any error passing breakpoints into the createTheme
function, and i believe createBreakpoints
has moved to the system package.
Do we need to install @material-ui/system
to be able to use the BreakpointsOptions
type?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Unable to get custom breakpoints in theme - Stack Overflow
So I would like to get my custom breakpoint values from within the createMuiTheme . I've tried the following but it doesn't work, ......
Read more >theme.breakpoints.down method does not support custom ...
Steps: create a theme with custom breakpoints; use theme.breakpoints.down(customBreakpoint) or other affected functions. Context.
Read more >Allow sub-theme to alter breakpoints of base theme - Drupal
To be clear, I want to simply change the min/max width pixel values for xs, sm, md, and lg, not define any completely...
Read more >Fixing Your Responsive Navigation Menu in Divi
Creating a responsive navigation menu that looks great on all screen ... Thankfully, Divi's theme customizer allows you to customize the ...
Read more >Changing breakpoint for the mobile menu - WordPress.org
[This thread is closed.] Hello! I'm trying to change the breakpoint where the menu goes to the mobile menu in a child theme,...
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
I wanted to say that we should make it public via public path. So re-export it from something at level 2 or 3. Not tell people to export from level >=4
The proposed patch looks great. I would even not make
BreakpointValues
public but and inline it for consistency with the other keys:Regarding the side questions.
@material-ui/core/styles/createBreakpoints
was never allowed as an import path (AFAIK). It’s private. With #26254 we can enforce to make them unreachable.