Skip to content

Commit

Permalink
💄 style: Update Card style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Sep 23, 2024
1 parent 502e974 commit 5a4dbfd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
12 changes: 11 additions & 1 deletion docs/mdx/demos/cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,34 @@ export default () => (
<Card href="/mdx/callout" title="Callout" />
<Card href="/mdx/callout" title="Tabs" />
<Card href="/mdx/callouts" title="Steps" />
<Card href="/mdx/callouts" title="FileTree" />
</Cards>
<Divider orientation={'left'}>Icon & Title</Divider>
<Cards>
<Card href="/mdx/callout" icon={Warehouse} title="Callout" />
<Card href="/mdx/callout" icon={Warehouse} title="Tabs" />
<Card href="/mdx/callouts" icon={Warehouse} title="Steps" />
<Card href="/mdx/callouts" icon={Warehouse} title="FileTree" />
</Cards>
<Divider orientation={'left'}>Icon & Desc & Title</Divider>
<Cards>
<Card desc="Demo desction text" href="/mdx/callout" icon={Warehouse} title="Callout" />
<Card desc="Demo desction text" href="/mdx/callout" icon={Warehouse} title="Tabs" />
<Card desc="Demo desction text" href="/mdx/callouts" icon={Warehouse} title="Steps" />
<Card desc="Demo desction text" href="/mdx/callouts" icon={Warehouse} title="FileTree" />
</Cards>
<Divider orientation={'left'}>Tags</Divider>
<Cards>
<Card
desc="Demo desction text"
href="/mdx/callout"
tag={'Components'}
tagColor={'cyan'}
tagColor={'gold'}
title="Callout"
/>
<Card desc="Demo desction text" href="/mdx/callout" tag={'Components'} title="Tabs" />
<Card desc="Demo desction text" href="/mdx/callouts" tag={'Components'} title="Steps" />
<Card desc="Demo desction text" href="/mdx/callouts" tag={'Components'} title="FileTree" />
</Cards>
<Divider orientation={'left'}>Image Cover</Divider>
<Cards>
Expand All @@ -54,6 +58,12 @@ export default () => (
image="https://gw.alipayobjects.com/zos/kitchen/sLO%24gbrQtp/lobe-chat.webp"
title="Steps"
/>
<Card
href="/mdx/callouts"
icon={Warehouse}
image="https://gw.alipayobjects.com/zos/kitchen/sLO%24gbrQtp/lobe-chat.webp"
title="FileTree"
/>
</Cards>
</Typography>
);
16 changes: 13 additions & 3 deletions src/mdx/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface CardProps extends Omit<FlexboxProps, 'children'> {

const Card: FC<CardProps> = ({
tag,
tagColor = 'success',
tagColor = 'blue',
icon,
title,
desc,
Expand All @@ -101,11 +101,21 @@ const Card: FC<CardProps> = ({
/>
)}
{tag && (
<Flexbox align={'flex-start'} className={styles.content} style={{ paddingBottom: 0 }}>
<Flexbox
align={'flex-start'}
className={styles.content}
style={{ paddingBottom: '0.2em', paddingTop: '1.8em' }}
>
<Tag
bordered={false}
color={tagColor}
style={{ borderRadius: '1em', fontSize: '0.8em' }}
style={{
borderRadius: '1em',
fontSize: '0.8em',
fontWeight: 500,
paddingBlock: '0.1em',
paddingInline: '0.6em',
}}
>
{tag}
</Tag>
Expand Down

0 comments on commit 5a4dbfd

Please sign in to comment.