material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[CardHeader] paddingRight: 90px hardcoded + reasoning.

Open BlockChange opened this issue 10 years ago • 3 comments

There's a paddingRight: 90px on the container for title and subtitle: https://github.com/callemall/material-ui/blob/82b666966013d2e528a5c931773f9a12b556d5d5/src/Card/CardHeader.js#L19

The number seems arbitrary, and doesn't do a lot, except on mobile the CardHeader falls off-screen, making the page horizontally scrollable.

The only way to override this is to give it the textStyle props (which is weird, since CardHeader has no text prop, and seems to be meant for CardText, but its probably meant to indicate both text elements, maybe docs should clarify)

The 90px only occurs once in the whole source as well: https://github.com/callemall/material-ui/search?utf8=%E2%9C%93&q=90px

Which also makes me wonder why it is in px, since react converts numbers to pixels in style objects.

  • Material-UI: 0.16.0
  • React: 15.3.2
  • Browser: Chrome

BlockChange avatar Oct 14 '16 13:10 BlockChange

Same problem here, you can fix the horizontal scrolling with <CardHeader style={{ overflowX: 'hidden' }} />

amangeot avatar Oct 15 '16 10:10 amangeot

+1 ... really not sure why there is "white-space: nowrap;" on the div containing the title/subtitle.

"material-ui": "^0.17.3"

mrichmond avatar Apr 14 '17 22:04 mrichmond

We have removed that padding on the v1-beta branch. The padding was here to handle a potential icon on the right.

oliviertassinari avatar Aug 05 '17 07:08 oliviertassinari