Skip to content

Commit a2b2f6e

Browse files
authored
fix: FwbCard component width issue
Fixes issue #383
2 parents 19bf1df + 0aaf85b commit a2b2f6e

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

docs/components/card.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Use these responsive card components to show data entries and information to you
2020
<fwb-card-example />
2121
```vue
2222
<template>
23-
<fwb-card href="#">
23+
<fwb-card href="#" class="w-sm">
2424
<div class="p-5">
2525
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
2626
Noteworthy technology acquisitions 2021
@@ -46,6 +46,7 @@ import { FwbCard } from 'flowbite-vue'
4646
img-alt="Desk"
4747
img-src="https://flowbite.com/docs/images/blog/image-1.jpg"
4848
variant="image"
49+
class="w-md"
4950
>
5051
<div class="p-5">
5152
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
@@ -72,6 +73,7 @@ import { FwbCard } from 'flowbite-vue'
7273
img-alt="Desk"
7374
img-src="https://flowbite.com/docs/images/blog/image-4.jpg"
7475
variant="horizontal"
76+
class="w-lg"
7577
>
7678
<div class="p-5">
7779
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">

docs/components/card/examples/FwbCardExample.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="vp-raw inline-flex flex-wrap gap-2">
3-
<fwb-card href="#">
3+
<fwb-card href="#" class="w-sm">
44
<div class="p-5">
55
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
66
Noteworthy technology acquisitions 2021

docs/components/card/examples/FwbCardExampleHorizontal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
img-alt="Desk"
55
img-src="https://flowbite.com/docs/images/blog/image-4.jpg"
66
variant="horizontal"
7+
class="w-lg"
78
>
89
<div class="p-5">
910
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">

docs/components/card/examples/FwbCardExampleImage.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
img-alt="Desk"
55
img-src="https://flowbite.com/docs/images/blog/image-1.jpg"
66
variant="image"
7+
class="w-md"
78
>
89
<div class="p-5">
910
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">

src/components/FwbCard/composables/useCardClasses.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export function useCardsClasses (props: UseCardsClassesProps): {
1616
let computedClasses = ''
1717

1818
if (props.variant.value === 'image') {
19-
computedClasses = 'max-w-sm rounded-lg border border-gray-200 shadow-md dark:border-gray-700'
19+
computedClasses = 'min-w-sm rounded-lg border border-gray-200 shadow-md dark:border-gray-700'
2020
} else if (props.variant.value === 'default') {
21-
computedClasses = 'block max-w-sm rounded-lg border border-gray-200 shadow-md dark:border-gray-700'
21+
computedClasses = 'block min-w-sm rounded-lg border border-gray-200 shadow-md dark:border-gray-700 '
2222
} else if (props.variant.value === 'horizontal') {
23-
computedClasses = 'flex flex-col items-center rounded-lg border shadow-md md:flex-row md:max-w-xl dark:border-gray-700'
23+
computedClasses = 'flex flex-col items-center rounded-lg border shadow-md md:flex-row md:min-w-xl dark:border-gray-700'
2424
}
2525

2626
if (!props.class?.value || (!props.class.value.includes('bg-'))) {

0 commit comments

Comments
 (0)