Skip to content

Commit 2ae4473

Browse files
committed
Editor: Fix writingMode support in dynamic blocks.
Adds missing handling for the `typography.writingMode` property to the style engine, so that dynamic blocks correctly render text orientation styles on the site frontend. Props wildworks, aaronrobertshaw, poena, get_dave, ndiego. Fixes #62189. See #59306. git-svn-id: https://develop.svn.wordpress.org/trunk@59199 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8eec9f2 commit 2ae4473

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/wp-includes/style-engine/class-wp-style-engine.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @since 6.4.0 Added support for background.backgroundImage.
2626
* @since 6.5.0 Added support for background.backgroundPosition,
2727
* background.backgroundRepeat and dimensions.aspectRatio.
28+
* @since 6.7.0 Added support for typography.writingMode.
2829
*/
2930
#[AllowDynamicProperties]
3031
final class WP_Style_Engine {
@@ -305,6 +306,12 @@ final class WP_Style_Engine {
305306
),
306307
'path' => array( 'typography', 'letterSpacing' ),
307308
),
309+
'writingMode' => array(
310+
'property_keys' => array(
311+
'default' => 'writing-mode',
312+
),
313+
'path' => array( 'typography', 'writingMode' ),
314+
),
308315
),
309316
);
310317

tests/phpunit/tests/style-engine/styleEngine.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function tear_down() {
2929
* @ticket 58590
3030
* @ticket 60175
3131
* @ticket 61720
32+
* @ticket 62189
3233
*
3334
* @covers ::wp_style_engine_get_styles
3435
*
@@ -228,11 +229,12 @@ public function data_wp_style_engine_get_styles() {
228229
'textDecoration' => 'underline',
229230
'textTransform' => 'uppercase',
230231
'letterSpacing' => '2',
232+
'writingMode' => 'vertical-rl',
231233
),
232234
),
233235
'options' => null,
234236
'expected_output' => array(
235-
'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;column-count:2;text-decoration:underline;text-transform:uppercase;letter-spacing:2;',
237+
'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;column-count:2;text-decoration:underline;text-transform:uppercase;letter-spacing:2;writing-mode:vertical-rl;',
236238
'declarations' => array(
237239
'font-size' => 'clamp(2em, 2vw, 4em)',
238240
'font-family' => 'Roboto,Oxygen-Sans,Ubuntu,sans-serif',
@@ -243,6 +245,7 @@ public function data_wp_style_engine_get_styles() {
243245
'text-decoration' => 'underline',
244246
'text-transform' => 'uppercase',
245247
'letter-spacing' => '2',
248+
'writing-mode' => 'vertical-rl',
246249
),
247250
),
248251
),

0 commit comments

Comments
 (0)