Skip to content

Commit

Permalink
feat: update card component and styles for grid layout
Browse files Browse the repository at this point in the history
- changed `data-flex` to `data-flex-grid` in card.stories.tsx for flexible content rendering
- added grid layout styles for `data-flex-grid` in _grid.scss and index.css
- updated css map file to reflect changes in styles
  • Loading branch information
shawnsandy committed Oct 25, 2024
1 parent b0555aa commit b73011e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/react/fpkit/src/components/cards/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const FlexibleContent: Story = {
},
},
render: (args) => (
<div data-flex>
<div data-flex-grid>
<Card {...args}>
<Card.Title>Card Title</Card.Title>
<Card.Content>
Expand Down
16 changes: 16 additions & 0 deletions libs/react/fpkit/src/sass/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,19 @@
justify-content: center;
}
}

[data-flex-grid] {
display: grid;
grid-template-columns: repeat(
auto-fit,
minmax(var(--grid-column-min-width, 20.3125rem), 1fr)
);
gap: var(--gap);
margin-block-end: 3rem;
margin-inline: auto;
justify-content: center;
align-content: start;
// max-width: 92.5rem;
}

// ... existing code ...
10 changes: 10 additions & 0 deletions libs/react/fpkit/src/styles/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/react/fpkit/src/styles/index.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b73011e

Please sign in to comment.