Skip to content

Instantly share code, notes, and snippets.

@paulstraw
Last active June 20, 2019 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulstraw/c43243867b53a7455e077f81651988c0 to your computer and use it in GitHub Desktop.
Save paulstraw/c43243867b53a7455e077f81651988c0 to your computer and use it in GitHub Desktop.
LDS Example
<style scoped>
.hero-placeholder {
background-image: url("https://my-source.imgix.net/header1.jpg?w=320");
}
@media (min-width: 640px) {
.hero-placeholder {
background-image: url("https://my-source.imgix.net/header1.jpg?w=640");
}
}
@media (min-width: 960px) {
.hero-placeholder {
background-image: url("https://my-source.imgix.net/header1.jpg?w=960");
}
}
</style>
<section class="hero-placeholder">
Lorem ipsum dolor sit amet
</section>
@mountainash
Copy link

This is linked to from https://blog.imgix.com/2016/06/22/imgix-js-3

I saw the use of the "scoped" attribute - not knowing what it was, I was quick to learn that it's all but dead. Seemed very short lived although I could see lost of frameworks would live this in their spaghetti output. On top of that - this gist doesn't really show it's correct usage anyway (would need a wrapper HTML element).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment