Skip to content

Commit

Permalink
Screenshots: Add aspect ratio to the desktop image screenshot
Browse files Browse the repository at this point in the history
This will keep mshots pending & 404 images consistent with the real screenshot sizes.

Fixes #148
  • Loading branch information
ryelle committed Sep 13, 2023
1 parent a5755b5 commit 5739e9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function render( $attributes, $content, $block ) {
function get_site_screenshot_src( $post, $type = 'desktop' ) {
$screenshot_url = false;
$media_id = get_post_meta( $post->ID, 'screenshot-' . $type, true );
$cache_key = '20221208'; // To break out of cached image.
$cache_key = '20230913'; // To break out of cached image.

$size = 'screenshot-' . $type;
$all_sizes = wp_get_registered_image_subsizes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@
width: 100%;
vertical-align: middle;
}

&.is-size-desktop img {
aspect-ratio: 535 / 300;
}
}

0 comments on commit 5739e9e

Please sign in to comment.