Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Add sizes attribute for responsive images markup #411

Closed
wants to merge 2 commits into from

Conversation

mor10
Copy link
Contributor

@mor10 mor10 commented Oct 30, 2018

Addresses #50.

Prototype. Currently only works properly for "regular" width images.

Notes:

  • $GLOBALS['block_width'] section needs work as the theme uses fluid widths for all images on wider screens. Current values are effectively random.
  • To provide correct sizes attributes for alignwide and alignfull images we need a way of knowing, from within the wp_calculate_image_sizes filter, what the width display setting is for the current image. At present it is only defined in a class on the parent <figure> element which to my knowledge is inaccessible from the filter.

Works as prototype for testing of Gutenberg issue 6177.

cc @azaozz

Todo:

  • sizes attributes for alignwide and alignfull
  • sizes attribute for featured images

@mor10
Copy link
Contributor Author

mor10 commented Nov 16, 2018

sizes attribute for featured images added and merged in #493.

@mor10
Copy link
Contributor Author

mor10 commented Nov 17, 2018

Closing in favor of #629

@mor10 mor10 closed this Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant