Skip to content

Commit

Permalink
[Chip] Alignment fix (#13536)
Browse files Browse the repository at this point in the history
* add box-sizing: border-box to chip root class to prevent misalignment for bordered chips. #13533

* add 1px horizontal adjustment of chip avatar if variant='outlined' to account for horizontal misalignment. #13533

* add space in between icon prop and following prop in chip playground JSX code display to prevent markdown parser from misinterpreting the code block. #13532

* [docs] Update chip API

* remove the style rule
  • Loading branch information
izyb authored and oliviertassinari committed Nov 7, 2018
1 parent 20cd3e3 commit 24cc1f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/pages/demos/chips/ChipsPlayground.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ChipsPlayground extends React.Component {
iconToCode = '';
break;
default:
iconToCode = 'icon={<FaceIcon />}';
iconToCode = 'icon={<FaceIcon />} ';
iconToPlayground = <FaceIcon />;
break;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui/src/Chip/Chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const styles = theme => {
border: 'none', // Remove `button` border
padding: 0, // Remove `button` padding
verticalAlign: 'middle',
boxSizing: 'border-box',
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
Expand Down Expand Up @@ -112,6 +113,9 @@ export const styles = theme => {
'$clickable&:hover, $clickable&:focus, $deletable&:focus': {
backgroundColor: fade(theme.palette.text.primary, theme.palette.action.hoverOpacity),
},
'& $avatar': {
marginLeft: -1,
},
},
/* Styles applied to the root element if `variant="outlined"` and `color="primary"`. */
outlinedPrimary: {
Expand Down

0 comments on commit 24cc1f6

Please sign in to comment.