Skip to content

Commit

Permalink
Set valid defaults for noscript images (#4328)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-allanson authored and KyleAMathews committed Mar 2, 2018
1 parent edb4135 commit fc2180e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gatsby-image/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ const isWebpSupported = () => {

const noscriptImg = props => {
const {
opacity = ``,
opacity = `1`,
src,
srcSet,
sizes = ``,
title = ``,
alt = ``,
width = ``,
height = ``,
transitionDelay = ``,
transitionDelay = `0.5s`,
} = props
return `<img width=${width} height=${height} src="${src}" srcset="${srcSet}" alt="${alt}" title="${title}" sizes="${sizes}" style="position:absolute;top:0;left:0;transition:opacity 0.5s;transition-delay:${transitionDelay};opacity:${opacity};width:100%;height:100%;object-fit:cover;object-position:center"/>`
return `<img width="${width}" height="${height}" src="${src}" srcset="${srcSet}" alt="${alt}" title="${title}" sizes="${sizes}" style="position:absolute;top:0;left:0;transition:opacity 0.5s;transition-delay:${transitionDelay};opacity:${opacity};width:100%;height:100%;object-fit:cover;object-position:center"/>`
}

const Img = props => {
Expand Down

0 comments on commit fc2180e

Please sign in to comment.