You can add srcsets to config.php, but can you do the same with sizes? I’ve tried placing it in there in the same format, but it doesn’t seem to work
Currently no. I’d recommend creating a snippet for your responsive images in which you could also define your set of sizes. And then wherever you need to use a responsive image, you use the snippet and pass the image file.
Even if an option like this doesn’t exist, there’s nothing preventing you from setting an option in your config, either on the first level or as parts of the thumbs options array and then call it whereever you need it
'thumbs' => [
'sizes_default' => '(min-width: 1200px) 25vw,
(min-width: 900px) 33vw,
(min-width: 600px) 50vw,
100vw'
]
in your template:
echo option('thumbs.sizes_default');
I did something similar, thank you. But would be nice if it was supported in the same way as srcset