Hi there,
yeah the core Galleries block really didn’t consider gutters – its tricky but try this CSS:
/* Set default gap of 5px */
.wp-block-gallery .blocks-gallery-item {
margin: 0 5px 5px 0;
}
/* adjust gap for 3 column gallery */
/* if above 5px is adjusted then the below 5px need to be matched */
@media (min-width: 600px) {
.wp-block-gallery.columns-3 .blocks-gallery-item {
width: calc(33.33333% - 5px);
margin-right: 5px;
}
.wp-block-gallery.columns-3 .blocks-gallery-item:last-child {
margin-right: 0;
}
}
It does mean you need to add an additional CSS rule for each different column count. For example this will update the column gallery:
@media (min-width: 600px) {
.wp-block-gallery.columns-4 .blocks-gallery-item {
width: calc(25% - 5px);
margin-right: 5px;
}
.wp-block-gallery.columns-3 .blocks-gallery-item:last-child {
margin-right: 0;
}
}