Skip to content

Commit

Permalink
Subtract padding on full width
Browse files Browse the repository at this point in the history
* The padding is there if the whole Query Loop block isn't set as full
width. If it is set as full width, the image size calculation is very
different.
  • Loading branch information
Inwerpsel committed Apr 25, 2022
1 parent c92ff99 commit f9d7537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion planet4-gutenberg-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function ( $breakpoint ) use ( $column_count ) {
$breakpoints
);

$sizes_attr = 'sizes="' . implode( ', ', $sizes ) . ', 100vw"';
$sizes_attr = 'sizes="' . implode( ', ', $sizes ) . ', 100vw - 24px"';

// Assume all images are full width in a container.
$block_content = preg_replace( '/sizes=".*"/', $sizes_attr, $block_content );
Expand Down

0 comments on commit f9d7537

Please sign in to comment.