How can I add a custom sizes attribute to the images inside the gallery block?
You can apply size attributes to images within a Gallery block through the Settings tab:
Both the default size attributes and those added by plugins will be displayed in this section.
If you prefer to add custom sizes manually, be sure to take a look at this: add_image_size() | Function | WordPress Developer Resources
You should be able to easily implement the solutions provided, some of which can also be found in the comments.
Please let me know if this helps!
I mean the sizes attribute like: sizes=“(max-width: 1280px) 100vw, 1280px”.