Skip to content

Commit

Permalink
Merge pull request #398 from dcos-labs/mp/fix/gridlist-cell-overflow
Browse files Browse the repository at this point in the history
fix: prevent gridlist cell content from overflowing
  • Loading branch information
mperrotti authored Aug 29, 2019
2 parents b4a2118 + c1dfb01 commit 5c20ec1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/styleUtils/layout/gridList/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const gridColumnTemplate = columnCount => {
acc[breakpoint] = `repeat(${columnCount[breakpoint]}, 1fr)`;
return acc;
}, {})
: `repeat(${columnCount}, 1fr)`;
: `repeat(${columnCount}, minmax(0, 1fr))`;
// 👆explicitly setting the min to 0 so content doesn't overflow the grid cell
// see: https://github.com/rachelandrew/cssgrid-ama/issues/25

return getResponsiveStyle("grid-template-columns", gridTemplateColumns);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`GridList renders default 1`] = `
.emotion-0 {
display: grid;
grid-gap: 16px;
grid-template-columns: repeat(2,1fr);
grid-template-columns: repeat(2,minmax(0,1fr));
list-style: none;
margin-left: 0;
margin-top: 0;
Expand All @@ -29,7 +29,7 @@ exports[`GridList renders with all props 1`] = `
.emotion-0 {
display: grid;
grid-gap: 24px;
grid-template-columns: repeat(2,1fr);
grid-template-columns: repeat(2,minmax(0,1fr));
list-style: none;
margin-left: 0;
margin-top: 0;
Expand Down

0 comments on commit 5c20ec1

Please sign in to comment.