Skip to content

Commit

Permalink
[Container] Fix support of custom breakpoint units (#23191)
Browse files Browse the repository at this point in the history
  • Loading branch information
espipj authored Oct 21, 2020
1 parent 64629bd commit c60fbba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/material-ui/src/Container/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,39 @@ export const styles = (theme) => ({

if (value !== 0) {
acc[theme.breakpoints.up(breakpoint)] = {
maxWidth: value,
maxWidth: `${value}${theme.breakpoints.unit}`,
};
}
return acc;
}, {}),
/* Styles applied to the root element if `maxWidth="xs"`. */
maxWidthXs: {
[theme.breakpoints.up('xs')]: {
maxWidth: Math.max(theme.breakpoints.values.xs, 444),
maxWidth: Math.max(`${theme.breakpoints.values.xs}${theme.breakpoints.unit}`, 444),
},
},
/* Styles applied to the root element if `maxWidth="sm"`. */
maxWidthSm: {
[theme.breakpoints.up('sm')]: {
maxWidth: theme.breakpoints.values.sm,
maxWidth: `${theme.breakpoints.values.sm}${theme.breakpoints.unit}`,
},
},
/* Styles applied to the root element if `maxWidth="md"`. */
maxWidthMd: {
[theme.breakpoints.up('md')]: {
maxWidth: theme.breakpoints.values.md,
maxWidth: `${theme.breakpoints.values.md}${theme.breakpoints.unit}`,
},
},
/* Styles applied to the root element if `maxWidth="lg"`. */
maxWidthLg: {
[theme.breakpoints.up('lg')]: {
maxWidth: theme.breakpoints.values.lg,
maxWidth: `${theme.breakpoints.values.lg}${theme.breakpoints.unit}`,
},
},
/* Styles applied to the root element if `maxWidth="xl"`. */
maxWidthXl: {
[theme.breakpoints.up('xl')]: {
maxWidth: theme.breakpoints.values.xl,
maxWidth: `${theme.breakpoints.values.xl}${theme.breakpoints.unit}`,
},
},
});
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/src/styles/createBreakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default function createBreakpoints(breakpoints) {
between,
only,
width,
unit,
...other,
};
}

0 comments on commit c60fbba

Please sign in to comment.