Last active
March 3, 2024 23:44
-
-
Save dpw1/9b54c860b8796b6c9f711b497bae02b5 to your computer and use it in GitHub Desktop.
Change how many variants are shown per row
This file contains hidden or 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
{% assign variants_per_row_desktop = 4 %} | |
{% assign variants_per_row_mobile = 3 %} | |
<style> | |
@media (min-width: 750px){ | |
[id*='ProductInfo-'] variant-radios fieldset, | |
[id*='ProductInfo-'] variant-selects fieldset{ | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(calc(100% / {{ variants_per_row_desktop }}), 1fr)); | |
} | |
} | |
@media (max-width: 749px){ | |
[id*='ProductInfo-'] variant-radios fieldset, | |
[id*='ProductInfo-'] variant-selects fieldset{ | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(calc(100% / {{ variants_per_row_mobile }}), 1fr)); | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment