Skip to content

Commit cfc685f

Browse files
jacobmllr95tmorehouse
authored andcommitted
fix(card): Drop img-fluid property (#2548)
1 parent c7cfc00 commit cfc685f

File tree

3 files changed

+11
-31
lines changed

3 files changed

+11
-31
lines changed

src/components/card/README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -499,22 +499,22 @@ When using card groups with footers, their content will automatically line up.
499499
```html
500500
<div>
501501
<b-card-group>
502-
<b-card title="Title" img-src="https://placekitten.com/g/300/450" img-alt="Img" img-top>
502+
<b-card title="Title" img-src="https://placekitten.com/g/300/450" img-alt="Image" img-top>
503503
<b-card-text>
504504
This is a wider card with supporting text below as a natural lead-in to additional content.
505505
This content is a little bit longer.
506506
</b-card-text>
507507
<div slot="footer"><small class="text-muted">Last updated 3 mins ago</small></div>
508508
</b-card>
509509

510-
<b-card title="Title" img-src="https://placekitten.com/g/300/450" img-alt="Img" img-top>
510+
<b-card title="Title" img-src="https://placekitten.com/g/300/450" img-alt="Image" img-top>
511511
<b-card-text>
512512
This card has supporting text below as a natural lead-in to additional content.
513513
</b-card-text>
514514
<div slot="footer"><small class="text-muted">Last updated 3 mins ago</small></div>
515515
</b-card>
516516

517-
<b-card title="Title" img-src="https://placekitten.com/g/300/450" img-alt="Img" img-top>
517+
<b-card title="Title" img-src="https://placekitten.com/g/300/450" img-alt="Image" img-top>
518518
<b-card-text>
519519
This is a wider card with supporting text below as a natural lead-in to additional content.
520520
This card has even longer content than the first to show that equal height action.
@@ -536,22 +536,22 @@ automatically line up.
536536
```html
537537
<div>
538538
<b-card-group deck>
539-
<b-card title="Title" img-src="https://picsum.photos/300/300/?image=41" img-alt="Img" img-top>
539+
<b-card title="Title" img-src="https://picsum.photos/300/300/?image=41" img-alt="Image" img-top>
540540
<b-card-text>
541541
This is a wider card with supporting text below as a natural lead-in to additional content.
542542
This content is a little bit longer.
543543
</b-card-text>
544544
<div slot="footer"><small class="text-muted">Last updated 3 mins ago</small></div>
545545
</b-card>
546546

547-
<b-card title="Title" img-src="https://picsum.photos/300/300/?image=41" img-alt="Img" img-top>
547+
<b-card title="Title" img-src="https://picsum.photos/300/300/?image=41" img-alt="Image" img-top>
548548
<b-card-text>
549549
This card has supporting text below as a natural lead-in to additional content.
550550
</b-card-text>
551551
<div slot="footer"><small class="text-muted">Last updated 3 mins ago</small></div>
552552
</b-card>
553553

554-
<b-card title="Title" img-src="https://picsum.photos/300/300/?image=41" img-alt="Img" img-top>
554+
<b-card title="Title" img-src="https://picsum.photos/300/300/?image=41" img-alt="Image" img-top>
555555
<b-card-text>
556556
This is a wider card with supporting text below as a natural lead-in to additional content.
557557
This card has even longer content than the first to show that equal height action.
@@ -579,8 +579,7 @@ set them to display: inline-block as column-break-inside: avoid isn’t a bullet
579579
<b-card
580580
title="Card title that wraps to a new line"
581581
img-src="https://placekitten.com/g/400/450"
582-
img-fluid
583-
img-alt="image"
582+
img-alt="Image"
584583
img-top
585584
>
586585
<b-card-text>
@@ -601,8 +600,7 @@ set them to display: inline-block as column-break-inside: avoid isn’t a bullet
601600
<b-card
602601
title="Title"
603602
img-src="https://placekitten.com/500/350"
604-
img-fluid
605-
img-alt="image"
603+
img-alt="Image"
606604
img-top
607605
>
608606
<b-card-text>
@@ -628,9 +626,9 @@ set them to display: inline-block as column-break-inside: avoid isn’t a bullet
628626
<b-card-text class="small text-muted">Last updated 3 mins ago</b-card-text>
629627
</b-card>
630628

631-
<b-card img-src="https://picsum.photos/400/400/?image=41" img-fluid img-alt="image" overlay />
629+
<b-card img-src="https://picsum.photos/400/400/?image=41" img-alt="Image" overlay />
632630

633-
<b-card img-src="https://picsum.photos/400/200/?image=41" img-fluid img-alt="image" img-top>
631+
<b-card img-src="https://picsum.photos/400/200/?image=41" img-alt="Image" img-top>
634632
<b-card-text>
635633
This is a wider card with supporting text below as a natural lead-in to additional content.
636634
This card has even longer content than the first.

src/components/card/card-img.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ export const props = {
4343
width: {
4444
type: String,
4545
default: null
46-
},
47-
fluid: {
48-
type: Boolean,
49-
default: false
5046
}
5147
}
5248

@@ -70,7 +66,7 @@ export default {
7066
return h(
7167
'img',
7268
mergeData(data, {
73-
class: [baseClass, props.fluid ? 'img-fluid' : null],
69+
class: [baseClass],
7470
attrs: {
7571
src: props.src,
7672
alt: props.alt,

src/components/card/card-img.spec.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,6 @@ describe('card-image', async () => {
115115
expect(wrapper.classes().length).toBe(1)
116116
})
117117

118-
it('has class "img-fluid" when fluid=true', async () => {
119-
const wrapper = mount(CardImg, {
120-
context: {
121-
props: {
122-
src: 'https://picsum.photos/600/300/?image=25',
123-
fluid: true
124-
}
125-
}
126-
})
127-
expect(wrapper.classes()).toContain('card-img')
128-
expect(wrapper.classes()).toContain('img-fluid')
129-
expect(wrapper.classes().length).toBe(2)
130-
})
131-
132118
it('has attribute alt when prop alt set', async () => {
133119
const wrapper = mount(CardImg, {
134120
context: {

0 commit comments

Comments
 (0)