Skip to content

Instantly share code, notes, and snippets.

@dpw1
Last active March 3, 2024 23:44
Show Gist options
  • Save dpw1/9b54c860b8796b6c9f711b497bae02b5 to your computer and use it in GitHub Desktop.
Save dpw1/9b54c860b8796b6c9f711b497bae02b5 to your computer and use it in GitHub Desktop.
Change how many variants are shown per row
{% 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