-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve CardGrid; CardGrid docs; SectionHeader component
- Loading branch information
Showing
12 changed files
with
262 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Card Grid | ||
|
||
The `CardGrid` component is a layout component that allows you to display a grid of `Card`'s. | ||
|
||
## Usage | ||
|
||
::code-group | ||
::code-preview{label="Preview" column} | ||
::card-grid{style="--docus-landing-card-wrapper-backgroundColor: var(--elements-surface-secondary-backgroundColor);"} | ||
::card | ||
Card | ||
:: | ||
::card{row=2} | ||
Card | ||
:: | ||
::card | ||
Card | ||
:: | ||
::card{row=2} | ||
Card | ||
:: | ||
::card{col=2} | ||
Card | ||
:: | ||
::card | ||
Card | ||
:: | ||
:: | ||
:: | ||
```md [MDC] | ||
``` | ||
:: | ||
|
||
## Props | ||
|
||
| Prop | Type | Default | Description | | ||
|--|--|--|--| | ||
| `cols` | `[String, Number, Object]` | `3` | Number of columns to display | | ||
| `gap` | `[String, Object]` | `{ initial: '{space.4}', '2xl': '{space.6}' }` | Gap between cards | | ||
|
||
## Slots | ||
|
||
| Slot | Description | | ||
| --- | --- | | ||
| `root` | A slot for any content, rendered at the root of the component | | ||
| `default` | `Card` components to be displayed in the grid. | | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<script setup lang="ts"> | ||
defineProps({ | ||
subtitle: { | ||
type: String, | ||
default: 'Section subtitle' | ||
}, | ||
subtitleColor: { | ||
type: String, | ||
default: '{color.primary.500}' | ||
}, | ||
title: { | ||
type: String, | ||
default: 'Section title' | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<span v-if="subtitle || $slots.subtitle" class="subtitle"> | ||
<ContentSlot :use="$slots.subtitle" unwrap="p"> | ||
{{ subtitle }} | ||
</ContentSlot> | ||
</span> | ||
|
||
<h2 v-if="title || $slots.title" class="title"> | ||
<ContentSlot :use="$slots.title" unwrap="p"> | ||
{{ title }} | ||
</ContentSlot> | ||
</h2> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="ts"> | ||
css({ | ||
'.subtitle': { | ||
'--subtitleColor': (props) => props.subtitleColor, | ||
display: 'block', | ||
fontSize: '{docus.landing.sectionHeader.subtitle.fontSize}', | ||
lineHeight: '{docus.landing.sectionHeader.subtitle.lineHeight}', | ||
fontWeight: '{docus.landing.sectionHeader.subtitle.fontWeight}', | ||
color: 'var(--subtitleColor)', | ||
marginBottom: '{docus.landing.sectionHeader.subtitle.marginBottom}', | ||
letterSpacing: '{docus.landing.sectionHeader.subtitle.letterSpacing}', | ||
}, | ||
'.title': { | ||
width: '{docus.landing.sectionHeader.title.width}', | ||
marginBottom: '{docus.landing.sectionHeader.title.marginBottom}', | ||
fontSize: '{docus.landing.sectionHeader.title.fontSize}', | ||
lineHeight: '{docus.landing.sectionHeader.title.lineHeight}', | ||
fontWeight: '{docus.landing.sectionHeader.title.fontWeight}', | ||
letterSpacing: '{docus.landing.sectionHeader.title.letterSpacing}', | ||
color: '{docus.landing.sectionHeader.title.color}', | ||
gradientText: '{docus.landing.sectionHeader.title.gradientText}', | ||
}, | ||
}) | ||
</style> |
Oops, something went wrong.