Created
February 23, 2021 22:30
-
-
Save wvuwebgist/f118396cdac8cff76c624a53e9282172 to your computer and use it in GitHub Desktop.
CleanSlate: Randomize the hero image and generate variables for different sizes based on a label in Liquid.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% liquid | |
assign background_image_small = site | first_random_image_tagged_with: label: "backpage-1-thumbnail" | image_url: size: "1780x580" | css_background_image | |
assign background_image_large = site | first_random_image_tagged_with: label: "backpage-1-thumbnail" | image_url: size: "1780x1780" | css_background_image | |
%} | |
<style> | |
.wvu-hero { | |
{{ background_image_small }} | |
} /* /.wvu-hero */ | |
@media (min-width: 501px) { | |
.wvu-hero { | |
{{ background_image_large }} | |
} /* /.wvu-hero */ | |
} /* /mq */ | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment