ideas
ideas copied to clipboard
Add Responsive image feature to core
Hey all,
I'd love to see a responsive image feature out of the box with statamic (I know, and have used, the addons like Spatie's great addon).
Inspirations to look at:
- GatsbyJS has a great responsive image plugin
- Rob's Peak starter kit
This feature doesn't have to be a replacement for packages like Spatie's, but perhaps in an ideal world it would.
I know a lot of this is possible to write by hand with Glide, but it would be nice if core did it.
Thanks! ✌🏻
Nuxt also has a great first-party module for this. Link
I would love this and to be able to define presets using ratios (e.g. 3/2) instead of exact dimensions (e.g. 300w 200h) - Responsive sizes could be automatically calculated from these ratios. At the moment we can only calculate responsive dimensions manually and that could mean adding 5 or 6 responsive presets for every image shape. For one of my websites that would require 30+ presets.
Spatie's package uses ratios but it doesn't have presets, which creates a few problems - The biggest one being that images can only be generated on request, which means occasionally server freezes / crashes. Also, Glide filenames are not pretty when manipulated on the fly (bad for SEO).
This feature would be good for everyone and for the environment. Better optimisation, less bandwidth required.