@@ -26,11 +26,14 @@ export const Subtitle = styled(SubtitleBase)`
2626` ;
2727
2828export const ThumbnailBase = styled ( Link ) `
29- background-color: ${ theme . colors . secondary } ;
3029 padding-bottom: 2em;
3130 cursor: pointer;
3231 transition: all 0.4s ease;
3332 min-width: 10em;
33+ width: 100%;
34+ & > * {
35+ box-shadow: 0 0 0.1em 0 rgba(0,0,0,0.05);
36+ }
3437 .thumbnail-cta {
3538 transition: 0.3s ease all;
3639 transform: translate(0em, -1em);
@@ -54,23 +57,8 @@ export const ThumbnailBase = styled(Link)`
5457
5558export const ThumbnailContent = styled . div `
5659 padding: 1.33em;
57- big {
58- p {
59- margin-bottom: 1em;
60- }
61- }
62- small {
63- @media (${ mediaQueryMin . md } ) {
64- display: block;
65- margin: 1.66em 0em;
66- }
67-
68- img {
69- width: 2em;
70- height: 0.5em;
71- margin-left: 0.66em;
72- }
73- }
60+ background-color: ${ theme . colors . secondary } ;
61+ height: 13rem;
7462` ;
7563
7664export const BigThumbnailImg = styled . div `
@@ -82,18 +70,33 @@ export const BigThumbnailImg = styled.div`
8270 transition: all 0.3s ease;
8371
8472` ;
85-
86- export const ThumbnailImg = styled . div `
87- background: url('${ props => props . img } '), ${ secondary } ;
73+ const ThumbnailImgBase = styled . figure `
74+ background: ${ secondary } ;
8875 background-position: center center;
8976 background-size: cover;
9077 transition: all 0.5s ease;
91- height: 50vh;
92- max-height: 40em;
78+ height: 25rem;
79+ overflow: hidden;
80+ object-fit: cover;
9381 @media (${ mediaQueryMin . md } ) {
94- height: ${ props => ( props . big ? '50vh' : '15em' ) } ;
82+ height: ${ props => ( props . big ? '50vh' : '20rem' ) } ;
83+ }
84+ ` ;
85+
86+ const ThumbnailImgContent = styled . img `
87+ width: 100%;
88+ height: 100%;
89+ object-fit: cover;
90+ transition: 0.3s ease-in-out;
91+ &:hover {
92+ transform: scale(1.05);
9593 }
9694` ;
95+ export const ThumbnailImg = ( { img, alt} ) => (
96+ < ThumbnailImgBase >
97+ < ThumbnailImgContent src = { img } alt = { alt || 'featured image' } />
98+ </ ThumbnailImgBase >
99+ ) ;
97100
98101export const Arrow = styled . img `
99102 margin-left: 0.01em;
0 commit comments