Skip to content
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

Let WP make images responsive #4898

Merged
merged 2 commits into from
Feb 7, 2018
Merged

Let WP make images responsive #4898

merged 2 commits into from
Feb 7, 2018

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Feb 6, 2018

Description

Let WP make images responsive. WP looks at the class with ID for this.

How Has This Been Tested?

Upload an image, and view on the front-end. Verify it has srcset attributes etc.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

@ellatrix ellatrix added the [Feature] Media Anything that impacts the experience of managing media label Feb 6, 2018
@ellatrix ellatrix requested a review from a team February 6, 2018 20:14
<img
src={ url }
alt={ alt }
className={ id ? `wp-image-${ id }` : null }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this invalidate existing image blocks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, somehow didn't expect missing attributes to error.

@ellatrix ellatrix requested a review from a team February 7, 2018 00:12
@youknowriad
Copy link
Contributor

closes #4163 and #869

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Adam-Collier
Copy link

Hey, does adding this class presume it is full width? Say you had something half the width of the viewport can we account for that too? My images seem bigger than they should be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants