Skip to content

Commit

Permalink
refactor: preload WebP background image based on media query
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Nov 13, 2024
1 parent 526abe4 commit d8e85c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions benefits/core/templates/core/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
{% endblock title %}
{% endblock page-title %}

{% block preload %}
<link rel="preload" as="image" href="{% static "img/benefits-bg-mobile.webp" %}" media="(max-width: 992px)" />
<link rel="preload" as="image" href="{% static "img/benefits-bg-desktop.webp" %}" media="(min-width: 992px)">
{% endblock preload %}

{% block main-content %}
<div class="container">
<div class="row align-items-end align-items-lg-center">
Expand Down

0 comments on commit d8e85c7

Please sign in to comment.