From 276119e5739d5983a6b1e030d7f85324cb9977a5 Mon Sep 17 00:00:00 2001 From: Damillora Date: Tue, 20 Apr 2021 17:50:19 +0700 Subject: [PATCH] fix: fallback to cover image when site background isn't available --- partials/header-background.hbs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/partials/header-background.hbs b/partials/header-background.hbs index c183be6..7bf27e6 100644 --- a/partials/header-background.hbs +++ b/partials/header-background.hbs @@ -36,5 +36,25 @@ for it, and apply those styles to the
tag. Else, we just output a + .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; + } + } + {{/if}}