New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definitively fix issues with images in AMP not visually matching non-AMP version #2036
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7371ee5
Eliminate handle_centering for images since apparently unnecessary
westonruter e914f21
Eliminate duplicated CSS by including amp-default.css in classic styles
westonruter 835e1da
Ensure amp-default style is enqueued before theme's stylesheet
westonruter e1296f7
Ensure <img> elements converted to <amp-img> which have layout=intris…
westonruter fc4ab0a
Give responsive layout to alignwide/alignfull instead of intrinsic la…
westonruter 035131c
Ensure featured image gets responsive layout in Twenty Nineteen, as i…
westonruter 45bf5a3
Eliminate sizes from amp-img converted from img
westonruter e7d4247
Rename method to adjust_twentynineteen_images
westonruter 93ce9e8
Improve aligncenter, alignwide, and alignfull in classic templates
westonruter a82a87f
Add test for sizes attribute being removed from converted img
westonruter 65f1c0c
Remove obsolete add_auto_width_to_figure from #1086
westonruter 0180357
Opt-in to amp-img-auto-sizes experiment when there are converted images
westonruter File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
|
||
.aligncenter { | ||
display: block; | ||
text-align: center; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
@@ -44,11 +45,7 @@ | |
margin: 0 auto; | ||
} | ||
|
||
.amp-wp-unknown-size img { | ||
/** Worst case scenario when we can't figure out dimensions for an image. **/ | ||
/** Force the image into a box of fixed dimensions and use object-fit to scale. **/ | ||
object-fit: contain; | ||
} | ||
<?php echo file_get_contents( AMP__DIR__ . '/assets/css/amp-default.css' ); // phpcs:ignore WordPress.WP.AlternativeFunctions ?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea to echo |
||
|
||
/* Template Styles */ | ||
|
||
|
@@ -284,6 +281,11 @@ | |
|
||
/* AMP Media */ | ||
|
||
.alignwide, | ||
.alignfull { | ||
clear: both; | ||
} | ||
|
||
amp-carousel { | ||
background: <?php echo sanitize_hex_color( $border_color ); ?>; | ||
margin: 0 -16px 1.5em; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great to be able to remove these workarounds!