Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
fix: Better content sizing logic for CenterContent
Browse files Browse the repository at this point in the history
  • Loading branch information
diondiondion committed Aug 29, 2019
1 parent 6d6f29a commit 137294c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CenterContent/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Instead of defining a height, you can also use the `fillParent` prop which will

<Playground>
<CenterContent height={350}>
Hello <PodcastIcon />
<PodcastIcon vAlign /> Hello
</CenterContent>

<div style={{
Expand Down
5 changes: 4 additions & 1 deletion src/CenterContent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {paddingProps} from '../styleProps';

const Wrapper = styled.div`
display: flex;
flex: 1;
${p =>
p.height &&
css`
Expand All @@ -34,7 +36,8 @@ const Wrapper = styled.div`
`;

const Content = styled.div`
max-width: ${p => (p.width ? pxToRem(p.width) : '100%')};
width: ${p => (p.width ? pxToRem(p.width) : 'auto')};
max-width: 100%;
/* Needed for IE11 to contain large items: https://stackoverflow.com/a/42494339 */
flex-shrink: 0;
Expand Down

0 comments on commit 137294c

Please sign in to comment.