From 847d4aa752decc8c21a8eb57bff32a371c800b6d Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 14 Feb 2025 19:23:07 +0100 Subject: [PATCH] feat(Card): add `variant` prop --- docs/content/3.components/card.md | 36 ++++++++++++++++ playground/app/pages/components/card.vue | 12 +++++- src/runtime/components/Card.vue | 8 +++- src/theme/card.ts | 21 +++++++++- test/components/Card.spec.ts | 4 ++ .../__snapshots__/Card-vue.spec.ts.snap | 42 ++++++++++++++++--- .../__snapshots__/Card.spec.ts.snap | 42 ++++++++++++++++--- 7 files changed, 151 insertions(+), 14 deletions(-) diff --git a/docs/content/3.components/card.md b/docs/content/3.components/card.md index 8dd1d0bc..a66bc694 100644 --- a/docs/content/3.components/card.md +++ b/docs/content/3.components/card.md @@ -16,6 +16,42 @@ props: --- :: +### Variant + +Use the `variant` prop to change the variant of the Card. + +::component-code +--- +prettier: true +hide: + - class +props: + variant: subtle + class: 'w-full' +slots: + header: | + + + + default: | + + + + footer: | + + +--- + +#header +:placeholder{class="h-8"} + +#default +:placeholder{class="h-32"} + +#footer +:placeholder{class="h-8"} +:: + ## API ### Props diff --git a/playground/app/pages/components/card.vue b/playground/app/pages/components/card.vue index 5ac5c9e6..0e568a65 100644 --- a/playground/app/pages/components/card.vue +++ b/playground/app/pages/components/card.vue @@ -1,6 +1,16 @@ + +