Skip to content

Commit 9aecd3b

Browse files
committed
✨ Add useful defaults to Image component
1 parent 7b96f69 commit 9aecd3b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/image/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const image = combineStyles(
2929
)
3030

3131
const Image = styled(createBase('img', { blacklist: [ 'width', 'height' ] }))(
32-
{ display: 'block' },
32+
{ display: 'block', maxWidth: '100%', height: 'auto' },
3333
image
3434
)
3535

test/__snapshots__/index.js.snap

+4
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ exports[`FlexGrid vertical and horizontal space 1`] = `
756756
exports[`Image empty 1`] = `
757757
.emotion-0 {
758758
display: block;
759+
max-width: 100%;
760+
height: auto;
759761
}
760762
761763
<img
@@ -766,6 +768,8 @@ exports[`Image empty 1`] = `
766768
exports[`Image with image 1`] = `
767769
.emotion-0 {
768770
display: block;
771+
max-width: 100%;
772+
height: auto;
769773
width: 50%;
770774
}
771775

0 commit comments

Comments
 (0)