fix: fallback to cover image when site background isn't available

This commit is contained in:
Damillora 2021-04-20 17:50:19 +07:00
parent 506123bfac
commit 276119e573
1 changed files with 20 additions and 0 deletions

View File

@ -36,5 +36,25 @@ for it, and apply those styles to the <header> tag. Else, we just output a <head
{{else}}
<style type="text/css">
.responsive-header-img {
background-image: url({{img_url @site.cover_image size='xl'}});
background-size: cover;
}
@media(max-width: 1000px) {
.responsive-header-img {
background-image: url({{img_url @site.cover_image size='l'}});
background-position: center;
}
}
@media(max-width: 600px) {
.responsive-header-img {
background-image: url({{img_url @site.cover_image size='m'}});
background-position: center;
}
}
</style>
{{/if}}