UCDavisLibrary / ucdlib-theme-wp

Wordpress theme port of the UC Davis SiteFarm One Theme
2 stars 0 forks source link

Percent width container for image placement is broken #211

Closed wrenaria closed 1 year ago

wrenaria commented 1 year ago

It wasn't working at all for a bit, now it is leaving a bunch of extra space to the right of right-aligned images as you can see in the examples below.

Example 1:

Screen Shot 2022-08-13 at 9 18 33 AM Source: https://stage.library.ucdavis.edu/archives-and-special-collections/visitor-information/class-visits/

Example 2:

Screen Shot 2022-08-13 at 9 26 39 AM Source: https://stage.library.ucdavis.edu/location/peter-j-shields-library/

spelkey-ucd commented 1 year ago

@wrenaria i figured out what was going on here. WP changed the html structure of image blocks; however, these changes are only applied when a page is updated. So, I had to adjust the custom percent width class to support both versions of the block.

https://sandbox.library.ucdavis.edu/archives-and-special-collections/visitor-information/class-visits/

https://sandbox.library.ucdavis.edu/location/peter-j-shields-library/

wrenaria commented 1 year ago

This looks good!

wrenaria commented 1 year ago

Oh wait! I forgot to check it on my phone. Did it always do this?

If the image is going to break to its own line in mobile, I'd rather drop the size percentage entirely at that point and let it fill the space since text isn't wrapping around it anymore and phone screens are small so larger images are more helpful in that context.

spelkey-ucd commented 1 year ago

I can set it to 100% on mobile, or I can stop it from breaking to its own line. Preference?

I could also do a combo of the two - e.g. if less than 50% continue wrapping, otherwise drop to new and make 100%

wrenaria commented 1 year ago

I like the second option -- less than 50% continue wrapping, otherwise drop to new and make 100%

spelkey-ucd commented 1 year ago

deployed to website_tag: v3.1.0