Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Feb 9, 2020
1 parent 6e1a679 commit d4d91fa
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api/divider.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| <span class="prop-name">absolute</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | Absolutely position the element. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">component</span> | <span class="prop-type">elementType</span> | <span class="prop-default">'hr'</span> | The component used for the root node. Either a string to use a DOM element or a component. |
| <span class="prop-name">flexItem</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the divider will apply different strategy for height. |
| <span class="prop-name">flexItem</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the divider will apply adapt to a parent flex container. |
| <span class="prop-name">light</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the divider will have a lighter color. |
| <span class="prop-name">orientation</span> | <span class="prop-type">'horizontal'<br>&#124;&nbsp;'vertical'</span> | <span class="prop-default">'horizontal'</span> | The divider orientation. |
| <span class="prop-name">variant</span> | <span class="prop-type">'fullWidth'<br>&#124;&nbsp;'inset'<br>&#124;&nbsp;'middle'</span> | <span class="prop-default">'fullWidth'</span> | The variant to use. |
Expand Down
22 changes: 12 additions & 10 deletions docs/src/pages/components/dividers/VerticalDividers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const useStyles = makeStyles(theme => ({
backgroundColor: theme.palette.background.paper,
color: theme.palette.text.secondary,
'& svg': {
margin: theme.spacing(2),
margin: theme.spacing(1.5),
},
'& hr': {
margin: theme.spacing(0, 0.5),
Expand All @@ -29,14 +29,16 @@ export default function VerticalDividers() {
const classes = useStyles();

return (
<Grid container alignItems="center" className={classes.root}>
<FormatAlignLeftIcon />
<FormatAlignCenterIcon />
<FormatAlignRightIcon />
<Divider orientation="vertical" />
<FormatBoldIcon />
<FormatItalicIcon />
<FormatUnderlinedIcon />
</Grid>
<div>
<Grid container alignItems="center" className={classes.root}>
<FormatAlignLeftIcon />
<FormatAlignCenterIcon />
<FormatAlignRightIcon />
<Divider orientation="vertical" flexItem />
<FormatBoldIcon />
<FormatItalicIcon />
<FormatUnderlinedIcon />
</Grid>
</div>
);
}
22 changes: 12 additions & 10 deletions docs/src/pages/components/dividers/VerticalDividers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const useStyles = makeStyles((theme: Theme) =>
backgroundColor: theme.palette.background.paper,
color: theme.palette.text.secondary,
'& svg': {
margin: theme.spacing(2),
margin: theme.spacing(1.5),
},
'& hr': {
margin: theme.spacing(0, 0.5),
Expand All @@ -31,14 +31,16 @@ export default function VerticalDividers() {
const classes = useStyles();

return (
<Grid container alignItems="center" className={classes.root}>
<FormatAlignLeftIcon />
<FormatAlignCenterIcon />
<FormatAlignRightIcon />
<Divider orientation="vertical" />
<FormatBoldIcon />
<FormatItalicIcon />
<FormatUnderlinedIcon />
</Grid>
<div>
<Grid container alignItems="center" className={classes.root}>
<FormatAlignLeftIcon />
<FormatAlignCenterIcon />
<FormatAlignRightIcon />
<Divider orientation="vertical" flexItem />
<FormatBoldIcon />
<FormatItalicIcon />
<FormatUnderlinedIcon />
</Grid>
</div>
);
}
1 change: 1 addition & 0 deletions docs/src/pages/components/dividers/dividers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ The examples below show two ways of achieving this.
## Vertical Dividers

You can also render a divider vertically using the `orientation` prop.
Note the usage of the `flexItem` prop to accommodate for the flex container.

{{"demo": "pages/components/dividers/VerticalDividers.js", "bg": true}}
2 changes: 1 addition & 1 deletion packages/material-ui/src/Divider/Divider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
export interface DividerTypeMap<P = {}, D extends React.ElementType = 'hr'> {
props: P & {
absolute?: boolean;
light?: boolean;
flexItem?: boolean;
light?: boolean;
orientation?: 'horizontal' | 'vertical';
variant?: 'fullWidth' | 'inset' | 'middle';
};
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Divider/Divider.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Divider.propTypes = {
*/
component: PropTypes.elementType,
/**
* If `true`, the divider will apply different strategy for height.
* If `true`, the divider will apply adapt to a parent flex container.
*/
flexItem: PropTypes.bool,
/**
Expand Down

0 comments on commit d4d91fa

Please sign in to comment.