Skip to content

Commit

Permalink
[system] Add boxSizing to sizing styled system (mui#19684)
Browse files Browse the repository at this point in the history
  • Loading branch information
mesteche authored and EsoterikStare committed Feb 13, 2020
1 parent 956b8c8 commit 3c9a03a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/pages/system/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
| [sizing](/system/sizing/) | `minHeight` | `minHeight`| `min-height` | none |
| [sizing](/system/sizing/) | `minWidth` | `minWidth` | `min-width` | none |
| [sizing](/system/sizing/) | `width` | `width` | `width` | none |
| [sizing](/system/sizing/) | `boxSizing` | `boxSizing` | `box-sizing` | none |
| [spacing](/system/spacing/) | `spacing` | `m` | `margin` | [`spacing`](/customization/default-theme/?expand-path=$.spacing) |
| [spacing](/system/spacing/) | `spacing` | `mb` | `margin-bottom` | [`spacing`](/customization/default-theme/?expand-path=$.spacing) |
| [spacing](/system/spacing/) | `spacing` | `ml` | `margin-left` | [`spacing`](/customization/default-theme/?expand-path=$.spacing) |
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/system/sizing/sizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ import { sizing } from '@material-ui/system';
| `height` | `height` | `height` | none |
| `maxHeight` | `maxHeight`| `max-height` | none |
| `minHeight` | `minHeight`| `min-height` | none |
| `boxSizing` | `boxSizing`| `box-sizing` | none |
2 changes: 2 additions & 0 deletions packages/material-ui-system/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const maxHeight: SimpleStyleFunction<'maxHeight'>;
export const minHeight: SimpleStyleFunction<'minHeight'>;
export const sizeWidth: SimpleStyleFunction<'sizeWidth'>;
export const sizeHeight: SimpleStyleFunction<'sizeHeight'>;
export const boxSizing: SimpleStyleFunction<'boxSizing'>;
export const sizing: SimpleStyleFunction<
| 'width'
| 'maxWidth'
Expand All @@ -131,6 +132,7 @@ export const sizing: SimpleStyleFunction<
| 'minHeight'
| 'sizeWidth'
| 'sizeHeight'
| 'boxSizing'
>;
export type SizingProps = PropsFor<typeof sizing>;

Expand Down
5 changes: 5 additions & 0 deletions packages/material-ui-system/src/sizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@ export const sizeHeight = style({
transform,
});

export const boxSizing = style({
prop: 'boxSizing',
});

const sizing = compose(
width,
maxWidth,
minWidth,
height,
maxHeight,
minHeight,
boxSizing,
);

export default sizing;

0 comments on commit 3c9a03a

Please sign in to comment.