cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Swatch Size

SOLVED

Visual Swatch Size

Quick question, is there an option to adjust the size of the visual swatch on the product page? Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Visual Swatch Size

I think there may be a multi-step process to get the image size to change.

 

1. Get a nice easy to repeat example of what you are trying to do

2. Go to github.com

3. Raise an issue reporting a bug...

 

(I asked internally - the suspicion is there is actually a bug there which is why it is not working as it should. Feel free to raise a ticket on GitHub if you want it tracked, but the PM is now aware of it and suspects something might be broken. If there is a bug, then there is probably nothing you can do - other than provide a test case, or submit a pull request with a bug fix! ;-) )

View solution in original post

8 REPLIES 8

Re: Visual Swatch Size

The swatch size is defined in vendor/magento/module-swatches/etc/view.xml.  (That is, its in the Magento/Swatches module, in the etc/view.xml file. You can define another module to override the default settings.)

Re: Visual Swatch Size

Thank you!!!

Re: Visual Swatch Size

If I answered, can you mark as accepted? Helps with my tracking unanswered questions. Thx!

Re: Visual Swatch Size

I made the necessary changes to public_html/vendor/magento/module-swatches/etc/view.xml and it didn't seem to adjust the size of the swatches. Am I missing any other steps?

 

Thanks

Re: Visual Swatch Size

Ignoring the point that you should never modify the code of other modules in real life, I tried and found the same problem. Changing that file, flushing all the caches, seemed to have no effect. So I am not sure what those particular settings do myself.

 

I was having a look at vendor/module-swatches/view/frontend/web/css/swatches.css - it seems to control a fair bit of the CSS on the page. That might be something to explore. It talks about minimum sizes for images for example.

 

Could you do me a favor? Can you clarify exactly what you are trying to change the dimensions of?  Use Luma as a reference site. I want to make sure I am looking for the same setting as you need. Thx

 

Re: Visual Swatch Size

akent99 - One quick question, I can get the border size around the swatch image to change, however I can't seem to change the swatch image itself. What changes should I make to adjust the image size?

Thanks,

Rob

Re: Visual Swatch Size

I think there may be a multi-step process to get the image size to change.

 

1. Get a nice easy to repeat example of what you are trying to do

2. Go to github.com

3. Raise an issue reporting a bug...

 

(I asked internally - the suspicion is there is actually a bug there which is why it is not working as it should. Feel free to raise a ticket on GitHub if you want it tracked, but the PM is now aware of it and suspects something might be broken. If there is a bug, then there is probably nothing you can do - other than provide a test case, or submit a pull request with a bug fix! ;-) )

Re: Visual Swatch Size

Will do, thanks for you help!