Skip to content

Commit

Permalink
feat: add card gallery component for collections of cards
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Dec 11, 2024
1 parent 8faeaec commit 9bc9cbf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/scss/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@
}
}
}

.iati-card-gallery {
--min-card-width: 300px;

display: flex;
flex-wrap: wrap;
width: 100%;
gap: $padding-block;

& > * {
flex: 1;
min-width: var(--min-card-width);
}
}
7 changes: 7 additions & 0 deletions src/scss/components/card/card.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ export const CardWithMenu: Story = {
</div>
`,
};

export const CardGallery: Story = {
render: () =>
html`<div class="iati-card-gallery">
${Array(5).fill(Card.render?.call({}))}
</div>`,
};

0 comments on commit 9bc9cbf

Please sign in to comment.