-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[system] Improve breakpoints resolver function #29300
Conversation
@material-ui/core: parsed: +0.10% , gzip: +0.11% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good let's just add tests for resolveBreakpointValues
to make sure we don't break it in the future
// compute base for responsive values; e.g., | ||
// [1,2,3] => {xs: true, sm: true, md: true} | ||
// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true} | ||
function computeBreakpointsBase(breakpointValues, themeBreakpoints) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that we have this extracted :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From looking at the tests it looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Niceee!
Closes #26773
Closes #29175
Bugs prior to this PR:
spacing
,direction
,rowSpacing
,columnSpacing
, are not resolved correctly; e.g.,direction={{sm: 'row', xs: 'column'}} stays as
column` in all window sizes.columns={{ xs: 4, sm: 8, md: 12 }}
andcolumns=[4,8,12]
behave differently.spacing
anddirection
, are not resolved correctly; e.g.,direction={{sm: 'row', xs: 'column'}} stays as
column` in all window sizes.After this PR: