Skip to content

Commit d4d91fa

Browse files
polish
1 parent 6e1a679 commit d4d91fa

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

docs/pages/api/divider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
2727
| <span class="prop-name">absolute</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | Absolutely position the element. |
2828
| <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. |
2929
| <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. |
30-
| <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. |
30+
| <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. |
3131
| <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. |
3232
| <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. |
3333
| <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. |

docs/src/pages/components/dividers/VerticalDividers.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const useStyles = makeStyles(theme => ({
1717
backgroundColor: theme.palette.background.paper,
1818
color: theme.palette.text.secondary,
1919
'& svg': {
20-
margin: theme.spacing(2),
20+
margin: theme.spacing(1.5),
2121
},
2222
'& hr': {
2323
margin: theme.spacing(0, 0.5),
@@ -29,14 +29,16 @@ export default function VerticalDividers() {
2929
const classes = useStyles();
3030

3131
return (
32-
<Grid container alignItems="center" className={classes.root}>
33-
<FormatAlignLeftIcon />
34-
<FormatAlignCenterIcon />
35-
<FormatAlignRightIcon />
36-
<Divider orientation="vertical" />
37-
<FormatBoldIcon />
38-
<FormatItalicIcon />
39-
<FormatUnderlinedIcon />
40-
</Grid>
32+
<div>
33+
<Grid container alignItems="center" className={classes.root}>
34+
<FormatAlignLeftIcon />
35+
<FormatAlignCenterIcon />
36+
<FormatAlignRightIcon />
37+
<Divider orientation="vertical" flexItem />
38+
<FormatBoldIcon />
39+
<FormatItalicIcon />
40+
<FormatUnderlinedIcon />
41+
</Grid>
42+
</div>
4143
);
4244
}

docs/src/pages/components/dividers/VerticalDividers.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const useStyles = makeStyles((theme: Theme) =>
1818
backgroundColor: theme.palette.background.paper,
1919
color: theme.palette.text.secondary,
2020
'& svg': {
21-
margin: theme.spacing(2),
21+
margin: theme.spacing(1.5),
2222
},
2323
'& hr': {
2424
margin: theme.spacing(0, 0.5),
@@ -31,14 +31,16 @@ export default function VerticalDividers() {
3131
const classes = useStyles();
3232

3333
return (
34-
<Grid container alignItems="center" className={classes.root}>
35-
<FormatAlignLeftIcon />
36-
<FormatAlignCenterIcon />
37-
<FormatAlignRightIcon />
38-
<Divider orientation="vertical" />
39-
<FormatBoldIcon />
40-
<FormatItalicIcon />
41-
<FormatUnderlinedIcon />
42-
</Grid>
34+
<div>
35+
<Grid container alignItems="center" className={classes.root}>
36+
<FormatAlignLeftIcon />
37+
<FormatAlignCenterIcon />
38+
<FormatAlignRightIcon />
39+
<Divider orientation="vertical" flexItem />
40+
<FormatBoldIcon />
41+
<FormatItalicIcon />
42+
<FormatUnderlinedIcon />
43+
</Grid>
44+
</div>
4345
);
4446
}

docs/src/pages/components/dividers/dividers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ The examples below show two ways of achieving this.
3636
## Vertical Dividers
3737

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

4041
{{"demo": "pages/components/dividers/VerticalDividers.js", "bg": true}}

packages/material-ui/src/Divider/Divider.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
33
export interface DividerTypeMap<P = {}, D extends React.ElementType = 'hr'> {
44
props: P & {
55
absolute?: boolean;
6-
light?: boolean;
76
flexItem?: boolean;
7+
light?: boolean;
88
orientation?: 'horizontal' | 'vertical';
99
variant?: 'fullWidth' | 'inset' | 'middle';
1010
};

packages/material-ui/src/Divider/Divider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Divider.propTypes = {
9999
*/
100100
component: PropTypes.elementType,
101101
/**
102-
* If `true`, the divider will apply different strategy for height.
102+
* If `true`, the divider will apply adapt to a parent flex container.
103103
*/
104104
flexItem: PropTypes.bool,
105105
/**

0 commit comments

Comments
 (0)