Skip to content

Commit

Permalink
Archeo: fix image block widths (#5634)
Browse files Browse the repository at this point in the history
* Add wp-image- class to Layered images with headline

* Add wp-image- class to Image with description

* Add wp-image- class to Layout with two images and text

* Revert "Add wp-image- class to Layout with two images and text"

This reverts commit 8627c3f.

* Revert "Add wp-image- class to Image with description"

This reverts commit 6ced737.

* Revert "Add wp-image- class to Layered images with headline"

This reverts commit 7616eb3.

* Fix invalid block error

* Add CSS patch for responsive images

* Remove ID attribute from Image with description
  • Loading branch information
mikachan committed Mar 9, 2022
1 parent fd1e51a commit d401a92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion archeo/inc/patterns/image-with-description.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<p class="has-small-font-size" style="font-style:italic;font-weight:400">' . __( 'From "American Cities and Ruins: Mitla, Palenqué, Izamal, Chichen-Itza, Uxmal, Atlas" housed at the New York Public Library.', 'archeo' ) . '</p>
<!-- /wp:paragraph -->
<!-- wp:image {"id":840,"sizeSlug":"full","linkDestination":"none"} -->
<!-- wp:image {"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/ancien-temple.jpg" alt="' . __( 'Photo of ancient temple, at Chichen-Itza', 'archeo' ) . '"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column --></div>
Expand Down
2 changes: 1 addition & 1 deletion archeo/inc/patterns/layout-with-two-images-and-text.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- /wp:paragraph -->
<!-- wp:image {"align":"left","sizeSlug":"full","linkDestination":"none"} -->
<div class="wp-block-image"><figure class="alignleft size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/pyramid.jpg" alt="' . __( 'Photograph by Désiré Charnay, 1862 to 1863', 'archeo' ) . '"/><figcaption><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-background-color"><em>' . __( 'Photograph by Désiré Charnay, 1862 – 1863', 'archeo' ) . '</em></mark></figcaption></figure></div>
<figure class="wp-block-image alignleft size-full"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/pyramid.jpg" alt="' . __( 'Photograph by Désiré Charnay, 1862 to 1863', 'archeo' ) . '"/><figcaption><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-background-color"><em>' . __( 'Photograph by Désiré Charnay, 1862 – 1863', 'archeo' ) . '</em></mark></figcaption></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->
Expand Down
9 changes: 9 additions & 0 deletions archeo/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,12 @@ body > .is-root-container > .wp-block-template-part > .wp-block-cover,
.wp-block-group.simple-list-of-posts {
align-items: baseline;
}

/*
* Needed until there's a fix in GB.
* Related: https://github.com/WordPress/gutenberg/pull/39045
*/
.wp-block-image img {
height: auto;
max-width: 100%;
}

0 comments on commit d401a92

Please sign in to comment.