How to change size of the photo inside the variant color button

Topic summary

A user wants to enlarge color variant selector photos to fill their button containers while keeping the button size unchanged.

Initial Solution:

  • Support provided CSS code to add in theme.liquid file under <head> element
  • First code snippet increased both photo and button size (not desired)

Refined Solution:

  • Updated CSS code successfully enlarged only the internal photo while maintaining button dimensions
  • Side effect: Collection page images were unintentionally affected
  • Final CSS adjustment resolved the collection page issue
  • Original poster confirmed everything worked correctly

Follow-up Issue:
Another user (Juanpa11) encountered the same problem but struggles with code placement. They attempted inserting code under <head> without success and shared screenshots showing their issue and code placement attempts. This remains unresolved and awaiting assistance.

Summarized with AI on November 6. AI used: claude-sonnet-4-5-20250929.

Please see 2 different screenshot below, I can change the size of the button, but how do I make color selector the photo inside the box button bigger? I want the photo to fit the whole box.

Thanks

www.x-dream.com.au

password: 666

Hi @X-DREAM

Please go to Online store > Themes > Edit code > open theme.liquid file, add this code under element


this can increase the photo inside the box but it also increased box bigger, anyway can keep the box size only make the photo inside bigger?

thanks

Please update the code.


It worked perfect, but the collection page image been changed, I attached below. thanks

(left image is the original, right image is after I update the code)

Please update code to this


1 Like

Thanks a lot, everything worked

I have the same problem

But I don´t know where to insert the code, can you help me? I try to put under , but nothing happen

Please Help!

I have the same problem

But I don´t know where to insert the code, can you help me? I try to put under , but nothing happen

Please Help!