Onboarding: Stretch theme image to fit card container (https://github.com/woocommerce/woocommerce-admin/pull/3266)

This commit is contained in:
Joshua T Flowers 2019-11-19 09:18:22 +08:00 committed by GitHub
parent 7385170781
commit 1e792b7e86
2 changed files with 8 additions and 2 deletions

View File

@ -150,7 +150,12 @@ class Theme extends Component {
return (
<Card className="woocommerce-profile-wizard__theme" key={ theme.slug }>
{ image && (
<img alt={ title } src={ image } className="woocommerce-profile-wizard__theme-image" />
<div
className="woocommerce-profile-wizard__theme-image"
style={ { backgroundImage: `url(${ image })` } }
role="img"
aria-label={ title }
/>
) }
<div className="woocommerce-profile-wizard__theme-details">
<H className="woocommerce-profile-wizard__theme-name">

View File

@ -62,8 +62,9 @@
}
.woocommerce-profile-wizard__theme-image {
display: block;
width: 100%;
height: 300px;
background-size: cover;
}
.woocommerce-profile-wizard__theme-name {