Magento – the use of the view.xml of theme etc directory

luma-thememagento2media-imagesthemexml

I found this file located in the app/design/frontend/Magento/luma/etc/view.xml
Can we depend on this file to make change to the image resolution?

Any other specific use of this file.
Shall we put any color variables in this file and load on theme level.

Best Answer

In this file you can configure some properties related with FE.

E.g size of the images of prodcuts on the overview list. You can also add here a custom ID of image with your own size and generate picture in PHP

Additionally, you can set some properties without override templates files like

<vars module="Magento_ConfigurableProduct">
        <var name="gallery_switch_strategy">replace</var>
</vars>

This example change behavior of gallery for configurable prodcuts. So sometimes instead override the template file, you can reach your goal by this file

Related Topic