Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Responsive hi-dpi/retina images as background?

Started by Muut Archive 11 years ago · 0 replies · 477 views
11 years ago

As much as I understand there is no such functionality in grav yet.
If I do it like this, and provide a [email protected], always the "1x" version is used

---html
<div class="hero-image" style="background-image:url( {{ page.media['hero.jpg'].url }} )"></div>

TXT


I'm not a CSS expert but it looks like image-set is the equivalent to srcset for background images. Unfortunately image-set is not well supported by browsers at this time. 

Any ideas or plans to achieve this? Thx
👍 1

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2559 9 years ago
Archive · by Muut Archive, 9 years ago
2 1687 9 years ago
Archive · by Muut Archive, 9 years ago
2 4978 9 years ago
Archive · by Muut Archive, 9 years ago
1 3801 9 years ago
Archive · by Muut Archive, 9 years ago
3 1797 9 years ago