I have investigated this issue. In file: Magento\Swatches\Helper\Media, we have this method:
vendor/magento/module-swatches/Helper/Media.php
/**
* Merged config from view.xml
*
* @return array
*/
public function getImageConfig()
{
$imageConfig = [];
foreach ($this->themeCollection->loadRegisteredThemes() as $theme) {
$config = $this->viewConfig->getViewConfig([
'area' => Area::AREA_FRONTEND,
'themeModel' => $theme,
]);
$imageConfig = array_merge(
$imageConfig,
$config->getMediaEntities('Magento_Catalog', Image::MEDIA_TYPE_CONFIG_NODE)
);
}
return $imageConfig;
}
It merge the config in all registered theme. But in loadRegisterdThemes()
vendor/magento/module-theme/Model/ResourceModel/Theme/Collection.php
/**
* @return $this
*/
public function loadRegisteredThemes()
{
$this->_reset()->clear();
return $this->setOrder('theme_title', \Magento\Framework\Data\Collection::SORT_ORDER_ASC)
->filterVisibleThemes()->addAreaFilter(\Magento\Framework\App\Area::AREA_FRONTEND);
}
The theme list was sorted by title. In this case, my "Diamond Theme" was override by Luma and Blank theme.
The most quickly solution is just modify your theme name. I changed to Magento Theme Diamond, then swatch size in my theme was effected.