Editor: introduce dimensions.aspectRatio block support.

Adds front end rendering logic for the `dimensions.aspectRatio` block support as well as the required logic in `WP_Theme_JSON` and the style engine.

Props andrewserong.
Fixes #60365.


git-svn-id: https://develop.svn.wordpress.org/trunk@57491 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Isabel Brison
2024-01-31 02:52:25 +00:00
parent 5a59dbed82
commit 5d3f66ac5b
6 changed files with 318 additions and 10 deletions
@@ -23,7 +23,8 @@
* @since 6.1.0
* @since 6.3.0 Added support for text-columns.
* @since 6.4.0 Added support for background.backgroundImage.
* @since 6.5.0 Added support for background.backgroundPosition and background.backgroundRepeat.
* @since 6.5.0 Added support for background.backgroundPosition,
* background.backgroundRepeat and dimensions.aspectRatio.
*/
#[AllowDynamicProperties]
final class WP_Style_Engine {
@@ -190,7 +191,16 @@ final class WP_Style_Engine {
),
),
'dimensions' => array(
'minHeight' => array(
'aspectRatio' => array(
'property_keys' => array(
'default' => 'aspect-ratio',
),
'path' => array( 'dimensions', 'aspectRatio' ),
'classnames' => array(
'has-aspect-ratio' => true,
),
),
'minHeight' => array(
'property_keys' => array(
'default' => 'min-height',
),