WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
356 stars 97 forks source link

improved image `sizes` for left/right/center alignment #1289

Closed mukeshpanchal27 closed 2 months ago

mukeshpanchal27 commented 3 months ago

Overview

Follow-up: #1187 This issue cover calculate sizes for left/right/center alignment.

Approach

For initial work:

Core editor issues:

joemcgill commented 3 months ago

@mukeshpanchal27 once #1251 is fixed, I think this issue should be updated to focus only on applying a maximum constraint to left/right/center aligned images that are larger than their container.

I'm also unclear about what you mean by:

Parse the width value for "px"; for other types( vw, min() ), return the image width according to the default WordPress behaviour.

Could you clarify?

ramiy commented 3 months ago

Any chance to support start/end for RTL websites?

joemcgill commented 3 months ago

This is now unblocked since #1251 is fixed.

mukeshpanchal27 commented 3 months ago

Any chance to support start/end for RTL websites?

@ramiy Could you please share more details where is use in RTL sites so we can explore it? Thanks!

westonruter commented 2 months ago

Any chance to support start/end for RTL websites?

@ramiy Perhaps you're referring to supporting logical properties? So instead having to switch from left to right when switching from LTR to RTL, you can just use start. I'm not sure exactly how this would apply here since WordPress core is is using left and right for the block attribute values. See https://github.com/WordPress/gutenberg/blob/a8501ab1562cfdcd33e342440431b09717f0a9c1/schemas/json/block.json#L234-L255

mukeshpanchal27 commented 2 months ago

The PR #1290 has been merged. As we are still discussing start/end for RTL sites, we will close it once that is finalized.

sstopfer commented 2 months ago

If we don't hear back by the end of the week, let's close the ticket. @mukeshpanchal27

westonruter commented 2 months ago

I think the RTL issue is something to be tracked upstream in Gutenberg, for example https://github.com/WordPress/gutenberg/issues/52353

Since Gutenberg doesn't use logical properties, there's nothing we can do here.