From 73bf3bfa2fcfac63d469bea3263aefa1e82db187 Mon Sep 17 00:00:00 2001 From: AlexKvazos Date: Thu, 1 Mar 2018 17:35:24 -0600 Subject: [PATCH] Fix background image --- src/widget/index.html | 5 +---- src/widget/widget.js | 7 ++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/widget/index.html b/src/widget/index.html index 2352db8..049c59b 100644 --- a/src/widget/index.html +++ b/src/widget/index.html @@ -8,9 +8,6 @@ - +
diff --git a/src/widget/widget.js b/src/widget/widget.js index 28efed6..85fd064 100644 --- a/src/widget/widget.js +++ b/src/widget/widget.js @@ -78,7 +78,12 @@ function render() { const cropUrl = `${baseUrl}/${state.width * DPR}x${state.height * DPR}`; const url = `${cropUrl}/${design.backgroundImage}`; - window.document.body.style.backgroundImage = `url(${url})`; + window.document.body.setAttribute('style', ` + background-position: center !important; + background-size: cover !important; + background-attachment: fixed !important; + background-image: url(${url}) !important; + `); } else { window.document.body.style.backgroundImage = ''; }