I want to make these variant options appear inline with their label so instead of 6 rows, It’s just 3. Any idea how it can be done? Here’s the image and code
{%- for value in option.values -%}
<button type=“button” class=“popover-listbox__option” role=“option” value=“{{ value | escape }}” {% if value == option.selected_value %}aria-selected=“true”{% endif %} data-option-value>{{ value }}
{%- endfor -%}
{%- else -%}
{%- assign name = 'option' | append: option.position -%}
{%- for value in option.values -%}
{%- assign selected = false -%}
{%- if value == option.selected_value -%}
{%- assign selected = true -%}
{%- endif -%}
{%- case selector_type -%}
{%- when ‘variant’ -%}
{%- assign variant_for_value = product.variants | where: name, value | first -%}
{%- render ‘swatch’ with ‘media’, value: value, media: variant_for_value.featured_media, selected: selected, name: name, form: form_id, bordered: true -%}
{%- when ‘color’ -%}
{%- render ‘swatch’ with ‘color’, value: value, selected: selected, name: name, form: form_id -%}
{%- when ‘block’ -%}
{%- render ‘swatch’ with ‘block’, value: value, selected: selected, name: name, form: form_id -%}
{%- when ‘block_swatch’ -%}
{%- render ‘swatch’ with ‘block’, value: value, selected: selected, name: name, form: form_id, show_color: true -%}
{%- endcase -%}
{%- endfor -%}
From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
Find the theme that you want to edit and click on “Actions” and then “Edit code”.
In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
variant-picker.variant-picker {
width: 20%;
}
And Save.
Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!
Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.