Wildcard V2: `<Card />` Implementation
Created by: gitstart-sourcegraph
<Card />
component.
Wildcard implementation of the See Wildcard V2 - Planned work for more context
Acceptance criteria
-
Component is implemented within Wildcard -
Component has tests -
Component is accessible -
Component matches Figma designs
Refs
Implementation details
- Extract styles required for the component from Bootstrap to a CSS module:
- Figure out what classes do we use from
node_modules/bootstrap/scss/_card.scss
. - Create a CSS module with classes that we need from
node_modules/bootstrap/scss/_card.scss
and variables fromclient/branded/src/global-styles/card.scss
. - For top-level classes create small components that incorporate required styles, e.g.,
CardTitle
for.card-title
.
- Figure out what classes do we use from
- Move
client/branded/src/global-styles/GlobalStylesStory/CardsStory.tsx
(link) to the new component folder and update it to match other stories in the Wildcard package. - Use the
<Button />
component as a blueprint for the new component. - Component API:
<Card>
<CardHeader>Featured</CardHeader>
<CardBody>
<CardTitle>My cool title</CardTitle>
<CardSubtitle>Subtitle</CardSubtitle>
<CardText>Body goes here</CardText>
</CardBody>
</Card>