Skip to content

Commit

Permalink
feat!: Allow zero row gap for Grid (#1040)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Smedinga <[email protected]>
  • Loading branch information
alimpens and VincentSmedinga authored Jan 12, 2024
1 parent 2955915 commit 6ef7b08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/css/src/components/grid/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
--amsterdam-grid-padding-inline: var(--amsterdam-grid-compact-padding-inline);
}

.amsterdam-grid--gap-vertical--none {
row-gap: initial;
}

.amsterdam-grid--gap-vertical--small {
row-gap: calc(var(--amsterdam-grid-gap) / 2);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type GridProps = {
*/
compact?: boolean
/** The amount of vertical whitespace between rows of the grid. */
gapVertical?: 'small' | 'large'
gapVertical?: 'none' | 'small' | 'large'
} & (GridPaddingVerticalProp | GridPaddingTopAndBottomProps) &
PropsWithChildren<HTMLAttributes<HTMLDivElement>>

Expand Down
4 changes: 2 additions & 2 deletions storybook/storybook-react/src/Grid/Grid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const gridArgTypes = {
gapVertical: {
control: {
type: 'radio',
labels: { small: 'small', undefined: 'medium', large: 'large' },
labels: { none: 'none', small: 'small', undefined: 'medium', large: 'large' },
},
options: ['small', undefined, 'large'],
options: ['none', 'small', undefined, 'large'],
},
paddingVertical: paddingArgType,
paddingTop: paddingArgType,
Expand Down

0 comments on commit 6ef7b08

Please sign in to comment.